StdAir Logo  0.45.1
C++ Standard Airline IT Object Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BookingClass.hpp
Go to the documentation of this file.
1 #ifndef __STDAIR_BOM_BOOKINGCLASS_HPP
2 #define __STDAIR_BOM_BOOKINGCLASS_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <iosfwd>
9 #include <string>
10 // StdAir
17 
18 namespace stdair {
19 
24  class BookingClass : public BomAbstract {
25  template <typename BOM> friend class FacBom;
26  friend class FacBomManager;
27 
28  public:
29  // ////////// Type definitions ////////////
32 
33  public:
34  // /////////// Getters ////////////
36  const Key_T& getKey() const {
37  return _key;
38  }
39 
41  const ClassCode_T& getClassCode() const {
42  return _key.getClassCode();
43  }
44 
46  BomAbstract* const getParent() const {
47  return _parent;
48  }
49 
51  const HolderMap_T& getHolderMap() const {
52  return _holderMap;
53  }
54 
57  return _subclassCode;
58  }
59 
62  return _au;
63  }
64 
67  return _protection;
68  }
69 
72  return _cumulatedProtection;
73  }
74 
78  }
79 
82  return _nego;
83  }
84 
87  return _noShowPercentage;
88  }
89 
93  }
94 
97  return _nbOfBookings;
98  }
99 
102  return _groupNbOfBookings;
103  }
104 
108  }
109 
112  return _staffNbOfBookings;
113  }
114 
117  return _wlNbOfBookings;
118  }
119 
122  return _nbOfCancellations;
123  }
124 
126  const NbOfBookings_T& getETB() const {
127  return _etb;
128  }
129 
132  return _netClassAvailability;
133  }
134 
137  return _segmentAvailability;
138  }
139 
143  }
144 
146  const Yield_T& getYield () const { return _yield; }
147 
149  const MeanValue_T& getMean () const { return _mean; }
150  const StdDevValue_T& getStdDev () const {return _stdDev; }
151 
154  return _generatedDemandVector;
155  }
156 
157  public:
158  // /////////// Setters ////////////
161  _cumulatedProtection = iPL;
162  }
163 
165  void setProtection (const ProtectionLevel_T& iPL) {
166  _protection = iPL;
167  }
168 
172  }
173 
176  _au = iAU;
177  }
178 
181  _segmentAvailability = iAvl;
182  }
183 
185  void setYield (const Yield_T& iYield) { _yield = iYield; }
186 
188  void setMean (const MeanValue_T& iMean) { _mean = iMean; }
189  void setStdDev (const StdDevValue_T& iStdDev) { _stdDev = iStdDev; }
190 
191  public:
192  // /////////// Display support methods /////////
195  void toStream (std::ostream& ioOut) const {
196  ioOut << toString();
197  }
198 
201  void fromStream (std::istream& ioIn) {
202  }
203 
205  std::string toString() const;
206 
208  const std::string describeKey() const {
209  return _key.toString();
210  }
211 
212  public:
213  // ////////////// Business Methods /////////////////
215  void sell (const NbOfBookings_T&);
216 
218  void cancel (const NbOfBookings_T&);
219 
222  void generateDemandSamples (const int&);
223 
226  void generateDemandSamples (const int&, const RandomSeed_T&);
227 
228  protected:
229  // ////////// Constructors and destructors /////////
231  BookingClass (const Key_T&);
233  virtual ~BookingClass();
234 
235  private:
237  BookingClass();
239  BookingClass (const BookingClass&);
240 
241 
242  protected:
243  // ////////// Attributes /////////
246 
249 
252 
255 
258 
261 
264 
267 
270 
273 
276 
279 
282 
285 
288 
291 
294 
297 
300 
303 
306 
309 
313 
316  };
317 
318 }
319 #endif // __STDAIR_BOM_BOOKINGCLASS_HPP