StdAir Logo  1.00.3
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 /////////
217  Key_T _key;
218 
223 
228 
233 
238 
243  };
244 
245 }
246 #endif // __STDAIR_BOM_ONDDATE_HPP
BomAbstract * _parent
Definition: OnDDate.hpp:222
const CabinClassPairList_T & getCabinClassPairList(const std::string &iStr) const
Definition: OnDDate.hpp:116
const AirlineCode_T & getAirlineCode() const
Definition: OnDDate.cpp:44
void serialize(Archive &ar, const unsigned int iFileVersion)
LocationCode_T AirportCode_T
std::string CabinCode_T
std::pair< Yield_T, MeanStdDevPair_T > YieldDemandPair_T
Utility class for linking StdAir-based objects.
const std::string describeKey() const
Definition: OnDDate.hpp:167
const HolderMap_T & getHolderMap() const
Definition: OnDDate.hpp:87
Handle on the StdAir library context.
const stdair::AirportCode_T getOrigin() const
Definition: OnDDate.hpp:75
std::map< const std::type_info *, BomAbstract * > HolderMap_T
Definition: BomAbstract.hpp:63
Base class for the Business Object Model (BOM) layer.
Definition: BomAbstract.hpp:24
void setTotalForecast(const CabinCode_T &, const WTPDemandPair_T &)
Definition: OnDDate.cpp:76
Class representing the actual attributes for an airline flight-date.
Definition: OnDDate.hpp:33
std::list< CabinClassPair_T > CabinClassPairList_T
CabinForecastMap_T _cabinForecastMap
Definition: OnDDate.hpp:242
std::string AirlineCode_T
void fromStream(std::istream &ioIn)
Definition: OnDDate.hpp:156
const WTPDemandPair_T & getTotalForecast(const CabinCode_T &iCC) const
Definition: OnDDate.hpp:108
std::map< CabinCode_T, WTPDemandPair_T > CabinForecastMap_T
const StringDemandStructMap_T & getDemandInfoMap() const
Definition: OnDDate.hpp:94
std::pair< WTP_T, MeanStdDevPair_T > WTPDemandPair_T
StringCabinClassPairListMap_T _stringCabinClassPairListMap
Definition: OnDDate.hpp:237
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
const short getNbOfSegments() const
Definition: OnDDate.hpp:124
Base class for Factory layer.
Definition: FacBom.hpp:22
const stdair::AirportCode_T getDestination() const
Definition: OnDDate.hpp:80
virtual ~OnDDate()
Definition: OnDDate.cpp:33
const Key_T & getKey() const
Definition: OnDDate.hpp:50
std::string toString() const
Definition: OnDDate.cpp:37
const CabinForecastMap_T & getTotalForecastMap() const
Definition: OnDDate.hpp:101
const stdair::Date_T getDate() const
Definition: OnDDate.hpp:70
const short getNbOfSegments() const
Definition: OnDDateKey.hpp:70
BomAbstract *const getParent() const
Definition: OnDDate.hpp:55
void toStream(std::ostream &ioOut) const
Definition: OnDDate.hpp:147
friend class boost::serialization::access
Definition: OnDDate.hpp:37
Forward declarations.
std::map< std::string, YieldDemandPair_T > StringDemandStructMap_T
const std::string toString() const
Definition: OnDDateKey.cpp:77
boost::gregorian::date Date_T
const AirportCode_T getOrigin() const
Definition: OnDDateKey.cpp:54
void setDemandInformation(const CabinClassPairList_T &, const YieldDemandPair_T &)
Definition: OnDDate.cpp:53
HolderMap_T _holderMap
Definition: OnDDate.hpp:227
std::map< std::string, CabinClassPairList_T > StringCabinClassPairListMap_T
const Date_T getDate() const
Definition: OnDDateKey.cpp:47
OnDDateKey Key_T
Definition: OnDDate.hpp:44
Base class for Factory layer.
Definition: FacCloneBom.hpp:22
const AirportCode_T getDestination() const
Definition: OnDDateKey.cpp:61
StringDemandStructMap_T _classPathDemandMap
Definition: OnDDate.hpp:232