00001 #ifndef __STDAIR_BOM_ONDDATE_HPP 00002 #define __STDAIR_BOM_ONDDATE_HPP 00003 00004 // ////////////////////////////////////////////////////////////////////// 00005 // Import section 00006 // ////////////////////////////////////////////////////////////////////// 00007 // STL 00008 #include <iosfwd> 00009 #include <string> 00010 // StdAir 00011 #include <stdair/stdair_inventory_types.hpp> 00012 #include <stdair/stdair_maths_types.hpp> 00013 #include <stdair/stdair_basic_types.hpp> 00014 #include <stdair/stdair_demand_types.hpp> 00015 #include <stdair/stdair_rm_types.hpp> 00016 #include <stdair/bom/BomAbstract.hpp> 00017 #include <stdair/bom/OnDDateKey.hpp> 00018 #include <stdair/bom/OnDDateTypes.hpp> 00019 00021 namespace boost { 00022 namespace serialization { 00023 class access; 00024 } 00025 } 00026 00027 namespace stdair { 00028 00033 class OnDDate : public BomAbstract { 00034 template <typename BOM> friend class FacBom; 00035 friend class FacBomManager; 00036 friend class boost::serialization::access; 00037 00038 public: 00039 // ////////// Type definitions //////////// 00043 typedef OnDDateKey Key_T; 00044 00045 00046 public: 00047 // /////////// Getters /////////////// 00049 const Key_T& getKey() const { 00050 return _key; 00051 } 00052 00054 BomAbstract* const getParent() const { 00055 return _parent; 00056 } 00057 00065 const AirlineCode_T& getAirlineCode() const; 00066 00067 00069 const stdair::Date_T getDate() const { 00070 return _key.getDate(); 00071 } 00072 00074 const stdair::AirportCode_T getOrigin() const { 00075 return _key.getOrigin(); 00076 } 00077 00079 const stdair::AirportCode_T getDestination() const { 00080 return _key.getDestination(); 00081 } 00082 00086 const HolderMap_T& getHolderMap() const { 00087 return _holderMap; 00088 } 00089 00093 const StringDemandStructMap_T& getDemandInfoMap () const { 00094 return _classPathDemandMap; 00095 } 00096 00100 const CabinForecastMap_T& getTotalForecastMap () const { 00101 return _cabinForecastMap; 00102 } 00103 00107 const WTPDemandPair_T& getTotalForecast (const CabinCode_T& iCC) const { 00108 assert (_cabinForecastMap.find(iCC)!=_cabinForecastMap.end()); 00109 return _cabinForecastMap.find(iCC)->second; 00110 } 00111 00115 const CabinClassPairList_T& getCabinClassPairList (const std::string& iStr) { 00116 assert (_stringCabinClassPairListMap.find(iStr)!=_stringCabinClassPairListMap.end()); 00117 return _stringCabinClassPairListMap.find(iStr)->second; 00118 } 00119 00123 const short getNbOfSegments () const { 00124 return _key.getNbOfSegments(); 00125 } 00126 00127 public: 00128 // /////////// Setters /////////////// 00130 void setDemandInformation (const CabinClassPairList_T&, 00131 const YieldDemandPair_T&); 00132 00133 00135 void setTotalForecast (const CabinCode_T&, 00136 const WTPDemandPair_T&); 00137 00138 00139 public: 00140 // /////////// Display support methods ///////// 00146 void toStream (std::ostream& ioOut) const { 00147 ioOut << toString(); 00148 } 00149 00155 void fromStream (std::istream& ioIn) { 00156 } 00157 00161 std::string toString() const; 00162 00166 const std::string describeKey() const { 00167 return _key.toString(); 00168 } 00169 00170 00171 public: 00172 // /////////// (Boost) Serialisation support methods ///////// 00176 template<class Archive> 00177 void serialize (Archive& ar, const unsigned int iFileVersion); 00178 00179 private: 00184 void serialisationImplementation(); 00185 00186 00187 protected: 00188 // ////////// Constructors and destructors ///////// 00192 OnDDate (const Key_T&); 00193 00197 virtual ~OnDDate(); 00198 00199 private: 00203 OnDDate(); 00204 00208 OnDDate (const OnDDate&); 00209 00210 00211 protected: 00212 // ////////// Attributes ///////// 00216 Key_T _key; 00217 00221 BomAbstract* _parent; 00222 00226 HolderMap_T _holderMap; 00227 00231 StringDemandStructMap_T _classPathDemandMap; 00232 00236 StringCabinClassPairListMap_T _stringCabinClassPairListMap; 00237 00241 CabinForecastMap_T _cabinForecastMap; 00242 }; 00243 00244 } 00245 #endif // __STDAIR_BOM_ONDDATE_HPP