StdAir Logo  1.00.8
C++ Standard Airline IT Object Library
OnDDate.hpp
Go to the documentation of this file.
1 #ifndef __STDAIR_BOM_ONDDATE_HPP
2 #define __STDAIR_BOM_ONDDATE_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <iosfwd>
9 #include <string>
10 // StdAir
19 
21 namespace boost {
22  namespace serialization {
23  class access;
24  }
25 }
26 
27 namespace stdair {
28 
33  class OnDDate : public BomAbstract {
34  template <typename BOM> friend class FacBom;
35  template <typename BOM> friend class FacCloneBom;
36  friend class FacBomManager;
38 
39  public:
40  // ////////// Type definitions ////////////
44  typedef OnDDateKey Key_T;
45 
46 
47  public:
48  // /////////// Getters ///////////////
50  const Key_T& getKey() const {
51  return _key;
52  }
53 
55  BomAbstract* const getParent() const {
56  return _parent;
57  }
58 
66  const AirlineCode_T& getAirlineCode() const;
67 
68 
70  const stdair::Date_T getDate() const {
71  return _key.getDate();
72  }
73 
76  return _key.getOrigin();
77  }
78 
81  return _key.getDestination();
82  }
83 
87  const HolderMap_T& getHolderMap() const {
88  return _holderMap;
89  }
90 
95  return _classPathDemandMap;
96  }
97 
102  return _cabinForecastMap;
103  }
104 
108  const WTPDemandPair_T& getTotalForecast (const CabinCode_T& iCC) const {
109  assert (_cabinForecastMap.find(iCC)!=_cabinForecastMap.end());
110  return _cabinForecastMap.find(iCC)->second;
111  }
112 
116  const CabinClassPairList_T& getCabinClassPairList (const std::string& iStr) const {
118  return _stringCabinClassPairListMap.find(iStr)->second;
119  }
120 
124  const short getNbOfSegments () const {
125  return _key.getNbOfSegments();
126  }
127 
128  public:
129  // /////////// Setters ///////////////
132  const YieldDemandPair_T&);
133 
134 
136  void setTotalForecast (const CabinCode_T&,
137  const WTPDemandPair_T&);
138 
139 
140  public:
141  // /////////// Display support methods /////////
147  void toStream (std::ostream& ioOut) const {
148  ioOut << toString();
149  }
150 
156  void fromStream (std::istream& ioIn) {
157  }
158 
162  std::string toString() const;
163 
167  const std::string describeKey() const {
168  return _key.toString();
169  }
170 
171 
172  public:
173  // /////////// (Boost) Serialisation support methods /////////
177  template<class Archive>
178  void serialize (Archive& ar, const unsigned int iFileVersion);
179 
180  private:
185  void serialisationImplementation();
186 
187 
188  protected:
189  // ////////// Constructors and destructors /////////
193  OnDDate (const Key_T&);
194 
198  virtual ~OnDDate();
199 
200  private:
204  OnDDate();
205 
209  OnDDate (const OnDDate&);
210 
211 
212  protected:
213  // ////////// Attributes /////////
218 
223 
228 
233 
238 
243  };
244 
245 }
246 #endif // __STDAIR_BOM_ONDDATE_HPP
stdair::OnDDate::Key_T
OnDDateKey Key_T
Definition: OnDDate.hpp:44
stdair::CabinClassPairList_T
std::list< CabinClassPair_T > CabinClassPairList_T
Definition: stdair_demand_types.hpp:108
stdair::OnDDate::getNbOfSegments
const short getNbOfSegments() const
Definition: OnDDate.hpp:124
stdair::OnDDate::setTotalForecast
void setTotalForecast(const CabinCode_T &, const WTPDemandPair_T &)
Definition: OnDDate.cpp:76
stdair::OnDDate::getTotalForecast
const WTPDemandPair_T & getTotalForecast(const CabinCode_T &iCC) const
Definition: OnDDate.hpp:108
stdair::AirlineCode_T
std::string AirlineCode_T
Definition: stdair_basic_types.hpp:31
stdair::OnDDate::getKey
const Key_T & getKey() const
Definition: OnDDate.hpp:50
stdair::OnDDate::getAirlineCode
const AirlineCode_T & getAirlineCode() const
Definition: OnDDate.cpp:44
stdair::OnDDate::fromStream
void fromStream(std::istream &ioIn)
Definition: OnDDate.hpp:156
stdair::OnDDate::getDemandInfoMap
const StringDemandStructMap_T & getDemandInfoMap() const
Definition: OnDDate.hpp:94
stdair_rm_types.hpp
stdair::OnDDate::_parent
BomAbstract * _parent
Definition: OnDDate.hpp:222
stdair::OnDDate::access
friend class boost::serialization::access
Definition: OnDDate.hpp:37
stdair::OnDDate::_key
Key_T _key
Definition: OnDDate.hpp:217
stdair_inventory_types.hpp
stdair::FacCloneBom
Base class for Factory layer.
Definition: FacCloneBom.hpp:22
stdair::OnDDate::getTotalForecastMap
const CabinForecastMap_T & getTotalForecastMap() const
Definition: OnDDate.hpp:101
stdair_demand_types.hpp
stdair::OnDDate::setDemandInformation
void setDemandInformation(const CabinClassPairList_T &, const YieldDemandPair_T &)
Definition: OnDDate.cpp:53
stdair::OnDDate::getDate
const stdair::Date_T getDate() const
Definition: OnDDate.hpp:70
stdair::OnDDateKey::toString
const std::string toString() const
Definition: OnDDateKey.cpp:77
stdair::FacBomManager
Utility class for linking StdAir-based objects.
Definition: FacBomManager.hpp:30
stdair::OnDDateKey::getNbOfSegments
const short getNbOfSegments() const
Definition: OnDDateKey.hpp:70
stdair::StringCabinClassPairListMap_T
std::map< std::string, CabinClassPairList_T > StringCabinClassPairListMap_T
Definition: OnDDateTypes.hpp:41
stdair::AirportCode_T
LocationCode_T AirportCode_T
Definition: stdair_basic_types.hpp:22
stdair::WTPDemandPair_T
std::pair< WTP_T, MeanStdDevPair_T > WTPDemandPair_T
Definition: stdair_demand_types.hpp:77
OnDDateTypes.hpp
stdair::BomAbstract
Base class for the Business Object Model (BOM) layer.
Definition: BomAbstract.hpp:24
stdair::OnDDateKey
Key of a given O&D-date, made of a list of OnD strings. a OnD string contains the airline code,...
Definition: OnDDateKey.hpp:23
stdair::OnDDate::_classPathDemandMap
StringDemandStructMap_T _classPathDemandMap
Definition: OnDDate.hpp:232
stdair
Handle on the StdAir library context.
Definition: BasChronometer.cpp:9
stdair::CabinForecastMap_T
std::map< CabinCode_T, WTPDemandPair_T > CabinForecastMap_T
Definition: OnDDateTypes.hpp:48
stdair::HolderMap_T
std::map< const std::type_info *, BomAbstract * > HolderMap_T
Definition: BomAbstract.hpp:63
BomAbstract.hpp
stdair_maths_types.hpp
stdair::OnDDate::_cabinForecastMap
CabinForecastMap_T _cabinForecastMap
Definition: OnDDate.hpp:242
stdair::OnDDate::getParent
BomAbstract *const getParent() const
Definition: OnDDate.hpp:55
stdair::OnDDate::getOrigin
const stdair::AirportCode_T getOrigin() const
Definition: OnDDate.hpp:75
stdair::OnDDate::_stringCabinClassPairListMap
StringCabinClassPairListMap_T _stringCabinClassPairListMap
Definition: OnDDate.hpp:237
stdair::OnDDate::~OnDDate
virtual ~OnDDate()
Definition: OnDDate.cpp:33
stdair::OnDDateKey::getDestination
const AirportCode_T getDestination() const
Definition: OnDDateKey.cpp:61
boost
Forward declarations.
Definition: AirlineClassList.hpp:16
stdair::OnDDate::describeKey
const std::string describeKey() const
Definition: OnDDate.hpp:167
stdair::OnDDate::getCabinClassPairList
const CabinClassPairList_T & getCabinClassPairList(const std::string &iStr) const
Definition: OnDDate.hpp:116
stdair::OnDDate
Class representing the actual attributes for an airline flight-date.
Definition: OnDDate.hpp:33
stdair::CabinCode_T
std::string CabinCode_T
Definition: stdair_basic_types.hpp:41
stdair::OnDDate::serialize
void serialize(Archive &ar, const unsigned int iFileVersion)
stdair_basic_types.hpp
stdair::OnDDateKey::getOrigin
const AirportCode_T getOrigin() const
Definition: OnDDateKey.cpp:54
stdair::OnDDateKey::getDate
const Date_T getDate() const
Definition: OnDDateKey.cpp:47
stdair::OnDDate::getHolderMap
const HolderMap_T & getHolderMap() const
Definition: OnDDate.hpp:87
stdair::OnDDate::toStream
void toStream(std::ostream &ioOut) const
Definition: OnDDate.hpp:147
stdair::StringDemandStructMap_T
std::map< std::string, YieldDemandPair_T > StringDemandStructMap_T
Definition: OnDDateTypes.hpp:33
stdair::OnDDate::getDestination
const stdair::AirportCode_T getDestination() const
Definition: OnDDate.hpp:80
stdair::OnDDate::_holderMap
HolderMap_T _holderMap
Definition: OnDDate.hpp:227
stdair::YieldDemandPair_T
std::pair< Yield_T, MeanStdDevPair_T > YieldDemandPair_T
Definition: stdair_inventory_types.hpp:122
OnDDateKey.hpp
stdair::FacBom
Base class for Factory layer.
Definition: FacBom.hpp:22
stdair::Date_T
boost::gregorian::date Date_T
Definition: stdair_date_time_types.hpp:20
stdair::OnDDate::toString
std::string toString() const
Definition: OnDDate.cpp:37