TraDemGen Logo  1.00.8
C++ Simulated Travel Demand Generation Library
DemandStreamKey.cpp
Go to the documentation of this file.
1// //////////////////////////////////////////////////////////////////////
2// Import section
3// //////////////////////////////////////////////////////////////////////
4// STL
5#include <cassert>
6#include <sstream>
7// StdAir
8#include <stdair/basic/BasConst_Inventory.hpp>
9// TraDemGen
11
12namespace TRADEMGEN {
13
14 // ////////////////////////////////////////////////////////////////////
15 DemandStreamKey::DemandStreamKey()
16 : _origin (stdair::DEFAULT_ORIGIN),
17 _destination (stdair::DEFAULT_DESTINATION),
18 _preferredDepartureDate (stdair::DEFAULT_DEPARTURE_DATE),
19 _preferredCabin (stdair::DEFAULT_CABIN_CODE) {
20 assert (false);
21 }
22
23 // ////////////////////////////////////////////////////////////////////
24 DemandStreamKey::
25 DemandStreamKey (const stdair::AirportCode_T& iOrigin,
26 const stdair::AirportCode_T& iDestination,
27 const stdair::Date_T& iPreferredDepartureDate,
28 const stdair::CabinCode_T& iPreferredCabin)
29 : _origin (iOrigin), _destination (iDestination),
30 _preferredDepartureDate (iPreferredDepartureDate),
31 _preferredCabin (iPreferredCabin) {
32 }
33
34 // ////////////////////////////////////////////////////////////////////
35 DemandStreamKey::DemandStreamKey (const DemandStreamKey& iKey)
36 : _origin (iKey._origin), _destination (iKey._destination),
37 _preferredDepartureDate (iKey._preferredDepartureDate),
38 _preferredCabin (iKey._preferredCabin) {
39 }
40
41 // ////////////////////////////////////////////////////////////////////
43 }
44
45 // ////////////////////////////////////////////////////////////////////
46 void DemandStreamKey::toStream (std::ostream& ioOut) const {
47 ioOut << "DemandStreamKey: " << toString();
48 }
49
50 // ////////////////////////////////////////////////////////////////////
51 void DemandStreamKey::fromStream (std::istream& ioIn) {
52 }
53
54 // ////////////////////////////////////////////////////////////////////
55 const std::string DemandStreamKey::toString() const {
56 std::ostringstream oStr;
57 oStr << _origin << "-" << _destination << " " << _preferredDepartureDate
58 << " " << _preferredCabin;
59 return oStr.str();
60 }
61
62}
Forward declarations.
const std::string toString() const
void fromStream(std::istream &ioIn)
void toStream(std::ostream &ioOut) const