$treeview $search $mathjax
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 template <typename BOM> friend class FacCloneBom; 00036 friend class FacBomManager; 00037 friend class boost::serialization::access; 00038 00039 public: 00040 // ////////// Type definitions //////////// 00044 typedef OnDDateKey Key_T; 00045 00046 00047 public: 00048 // /////////// Getters /////////////// 00050 const Key_T& getKey() const { 00051 return _key; 00052 } 00053 00055 BomAbstract* const getParent() const { 00056 return _parent; 00057 } 00058 00066 const AirlineCode_T& getAirlineCode() const; 00067 00068 00070 const stdair::Date_T getDate() const { 00071 return _key.getDate(); 00072 } 00073 00075 const stdair::AirportCode_T getOrigin() const { 00076 return _key.getOrigin(); 00077 } 00078 00080 const stdair::AirportCode_T getDestination() const { 00081 return _key.getDestination(); 00082 } 00083 00087 const HolderMap_T& getHolderMap() const { 00088 return _holderMap; 00089 } 00090 00094 const StringDemandStructMap_T& getDemandInfoMap () const { 00095 return _classPathDemandMap; 00096 } 00097 00101 const CabinForecastMap_T& getTotalForecastMap () const { 00102 return _cabinForecastMap; 00103 } 00104 00108 const WTPDemandPair_T& getTotalForecast (const CabinCode_T& iCC) const { 00109 assert (_cabinForecastMap.find(iCC)!=_cabinForecastMap.end()); 00110 return _cabinForecastMap.find(iCC)->second; 00111 } 00112 00116 const CabinClassPairList_T& getCabinClassPairList (const std::string& iStr) const { 00117 assert (_stringCabinClassPairListMap.find(iStr)!=_stringCabinClassPairListMap.end()); 00118 return _stringCabinClassPairListMap.find(iStr)->second; 00119 } 00120 00124 const short getNbOfSegments () const { 00125 return _key.getNbOfSegments(); 00126 } 00127 00128 public: 00129 // /////////// Setters /////////////// 00131 void setDemandInformation (const CabinClassPairList_T&, 00132 const YieldDemandPair_T&); 00133 00134 00136 void setTotalForecast (const CabinCode_T&, 00137 const WTPDemandPair_T&); 00138 00139 00140 public: 00141 // /////////// Display support methods ///////// 00147 void toStream (std::ostream& ioOut) const { 00148 ioOut << toString(); 00149 } 00150 00156 void fromStream (std::istream& ioIn) { 00157 } 00158 00162 std::string toString() const; 00163 00167 const std::string describeKey() const { 00168 return _key.toString(); 00169 } 00170 00171 00172 public: 00173 // /////////// (Boost) Serialisation support methods ///////// 00177 template<class Archive> 00178 void serialize (Archive& ar, const unsigned int iFileVersion); 00179 00180 private: 00185 void serialisationImplementation(); 00186 00187 00188 protected: 00189 // ////////// Constructors and destructors ///////// 00193 OnDDate (const Key_T&); 00194 00198 virtual ~OnDDate(); 00199 00200 private: 00204 OnDDate(); 00205 00209 OnDDate (const OnDDate&); 00210 00211 00212 protected: 00213 // ////////// Attributes ///////// 00217 Key_T _key; 00218 00222 BomAbstract* _parent; 00223 00227 HolderMap_T _holderMap; 00228 00232 StringDemandStructMap_T _classPathDemandMap; 00233 00237 StringCabinClassPairListMap_T _stringCabinClassPairListMap; 00238 00242 CabinForecastMap_T _cabinForecastMap; 00243 }; 00244 00245 } 00246 #endif // __STDAIR_BOM_ONDDATE_HPP