StdAir Logo  0.45.1
C++ Standard Airline IT Object Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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  friend class FacBomManager;
37 
38  public:
39  // ////////// Type definitions ////////////
43  typedef OnDDateKey Key_T;
44 
45 
46  public:
47  // /////////// Getters ///////////////
49  const Key_T& getKey() const {
50  return _key;
51  }
52 
54  BomAbstract* const getParent() const {
55  return _parent;
56  }
57 
65  const AirlineCode_T& getAirlineCode() const;
66 
67 
69  const stdair::Date_T getDate() const {
70  return _key.getDate();
71  }
72 
75  return _key.getOrigin();
76  }
77 
80  return _key.getDestination();
81  }
82 
86  const HolderMap_T& getHolderMap() const {
87  return _holderMap;
88  }
89 
94  return _classPathDemandMap;
95  }
96 
101  return _cabinForecastMap;
102  }
103 
107  const WTPDemandPair_T& getTotalForecast (const CabinCode_T& iCC) const {
108  assert (_cabinForecastMap.find(iCC)!=_cabinForecastMap.end());
109  return _cabinForecastMap.find(iCC)->second;
110  }
111 
115  const CabinClassPairList_T& getCabinClassPairList (const std::string& iStr) const {
117  return _stringCabinClassPairListMap.find(iStr)->second;
118  }
119 
123  const short getNbOfSegments () const {
124  return _key.getNbOfSegments();
125  }
126 
127  public:
128  // /////////// Setters ///////////////
131  const YieldDemandPair_T&);
132 
133 
135  void setTotalForecast (const CabinCode_T&,
136  const WTPDemandPair_T&);
137 
138 
139  public:
140  // /////////// Display support methods /////////
146  void toStream (std::ostream& ioOut) const {
147  ioOut << toString();
148  }
149 
155  void fromStream (std::istream& ioIn) {
156  }
157 
161  std::string toString() const;
162 
166  const std::string describeKey() const {
167  return _key.toString();
168  }
169 
170 
171  public:
172  // /////////// (Boost) Serialisation support methods /////////
176  template<class Archive>
177  void serialize (Archive& ar, const unsigned int iFileVersion);
178 
179  private:
184  void serialisationImplementation();
185 
186 
187  protected:
188  // ////////// Constructors and destructors /////////
192  OnDDate (const Key_T&);
193 
197  virtual ~OnDDate();
198 
199  private:
203  OnDDate();
204 
208  OnDDate (const OnDDate&);
209 
210 
211  protected:
212  // ////////// Attributes /////////
217 
222 
227 
232 
237 
242  };
243 
244 }
245 #endif // __STDAIR_BOM_ONDDATE_HPP