$treeview $search $mathjax
00001 // ////////////////////////////////////////////////////////////////////// 00002 // Import section 00003 // ////////////////////////////////////////////////////////////////////// 00004 // STL 00005 #include <cassert> 00006 #include <sstream> 00007 // StdAir 00008 #include <stdair/basic/BasConst_Inventory.hpp> 00009 // TraDemGen 00010 #include <trademgen/bom/DemandStreamKey.hpp> 00011 00012 namespace TRADEMGEN { 00013 00014 // //////////////////////////////////////////////////////////////////// 00015 DemandStreamKey::DemandStreamKey() 00016 : _origin (stdair::DEFAULT_ORIGIN), 00017 _destination (stdair::DEFAULT_DESTINATION), 00018 _preferredDepartureDate (stdair::DEFAULT_DEPARTURE_DATE), 00019 _preferredCabin (stdair::DEFAULT_CABIN_CODE) { 00020 assert (false); 00021 } 00022 00023 // //////////////////////////////////////////////////////////////////// 00024 DemandStreamKey:: 00025 DemandStreamKey (const stdair::AirportCode_T& iOrigin, 00026 const stdair::AirportCode_T& iDestination, 00027 const stdair::Date_T& iPreferredDepartureDate, 00028 const stdair::CabinCode_T& iPreferredCabin) 00029 : _origin (iOrigin), _destination (iDestination), 00030 _preferredDepartureDate (iPreferredDepartureDate), 00031 _preferredCabin (iPreferredCabin) { 00032 } 00033 00034 // //////////////////////////////////////////////////////////////////// 00035 DemandStreamKey::DemandStreamKey (const DemandStreamKey& iKey) 00036 : _origin (iKey._origin), _destination (iKey._destination), 00037 _preferredDepartureDate (iKey._preferredDepartureDate), 00038 _preferredCabin (iKey._preferredCabin) { 00039 } 00040 00041 // //////////////////////////////////////////////////////////////////// 00042 DemandStreamKey::~DemandStreamKey () { 00043 } 00044 00045 // //////////////////////////////////////////////////////////////////// 00046 void DemandStreamKey::toStream (std::ostream& ioOut) const { 00047 ioOut << "DemandStreamKey: " << toString(); 00048 } 00049 00050 // //////////////////////////////////////////////////////////////////// 00051 void DemandStreamKey::fromStream (std::istream& ioIn) { 00052 } 00053 00054 // //////////////////////////////////////////////////////////////////// 00055 const std::string DemandStreamKey::toString() const { 00056 std::ostringstream oStr; 00057 oStr << _origin << "-" << _destination << " " << _preferredDepartureDate 00058 << " " << _preferredCabin; 00059 return oStr.str(); 00060 } 00061 00062 }