StdAir Logo  1.00.3
C++ Standard Airline IT Object Library
LegCabin.hpp
Go to the documentation of this file.
1 #ifndef __STDAIR_BOM_LEGCABIN_HPP
2 #define __STDAIR_BOM_LEGCABIN_HPP
3 // //////////////////////////////////////////////////////////////////////
4 // Import section
5 // //////////////////////////////////////////////////////////////////////
6 // STL
7 #include <iosfwd>
8 #include <string>
9 // StdAir
17 
18 
19 namespace stdair {
20 
25  class LegCabin : public BomAbstract {
26  template <typename BOM> friend class FacBom;
27  template <typename BOM> friend class FacCloneBom;
28  friend class FacBomManager;
29 
30  public:
31  // ////////// Type definitions ////////////
35  typedef LegCabinKey Key_T;
36 
37  public:
38  // /////////// Getters ////////////
42  const Key_T& getKey() const {
43  return _key;
44  }
45 
49  BomAbstract* const getParent() const {
50  return _parent;
51  }
52 
56  const CabinCode_T& getCabinCode() const {
57  return _key.getCabinCode();
58  }
59 
67  const MapKey_T getFullerKey() const;
68 
72  const HolderMap_T& getHolderMap() const {
73  return _holderMap;
74  }
75 
78  return _offeredCapacity;
79  }
80 
83  return _physicalCapacity;
84  }
85 
87  const NbOfSeats_T& getSoldSeat() const {
88  return _soldSeat;
89  }
90 
93  return _committedSpace;
94  }
95 
98  return _availabilityPool;
99  }
100 
103  return _availability;
104  }
105 
108  return _currentBidPrice;
109  }
110 
113  return _previousBidPrice;
114  }
115 
118  return _bidPriceVector;
119  }
120 
123  return _dcsRegrade;
124  }
125 
128  return _au;
129  }
130 
132  const UPR_T& getUPR() const {
133  return _upr;
134  }
135 
138  return _nav;
139  }
140 
143  return _gav;
144  }
145 
148  return _acp;
149  }
150 
152  const NbOfSeats_T& getETB() const {
153  return _etb;
154  }
155 
158  return _staffNbOfBookings;
159  }
160 
162  const NbOfSeats_T& getWLNbOfSeats() const {
163  return _wlNbOfBookings;
164  }
165 
168  return _groupNbOfBookings;
169  }
170 
173  return _virtualClassList;
174  }
175 
178  return _bidPriceVector;
179  }
180 
181 
184  return _yieldLevelDemandMap;
185  }
186 
187 
188  public:
189  // ///////////// Setters ///////////////
191  void setCapacities (const CabinCapacity_T& iCapacity);
192 
194  void setSoldSeat (const NbOfSeats_T& iSoldSeat) {
195  _soldSeat = iSoldSeat;
196  }
197 
199  void setCommittedSpace (const CommittedSpace_T& iCommittedSpace) {
200  _committedSpace = iCommittedSpace;
201  }
202 
204  void setAvailabilityPool (const Availability_T& iAvailabilityPool) {
205  _availabilityPool = iAvailabilityPool;
206  }
207 
209  void setAvailability (const Availability_T& iAvailability) {
210  _availability = iAvailability;
211  }
212 
214  void setCurrentBidPrice (const BidPrice_T& iBidPrice) {
215  _currentBidPrice = iBidPrice;
216  }
217 
219  void setPreviousBidPrice (const BidPrice_T& iBidPrice) {
220  _previousBidPrice = iBidPrice;
221  }
222 
226  }
227 
229  void setRegradeAdjustment (const CapacityAdjustment_T& iRegradeAdjustment) {
230  _dcsRegrade = iRegradeAdjustment;
231  }
232 
235  _au = iAU;
236  }
237 
239  void setUPR (const UPR_T& iUPR) {
240  _upr = iUPR;
241  }
242 
244  void setNetAvailability (const Availability_T& iNAV) {
245  _nav = iNAV;
246  }
247 
250  _gav = iGAV;
251  }
252 
255  _acp = iACP;
256  }
257 
259  void setETB (const NbOfSeats_T& iETB) {
260  _etb = iETB;
261  }
262 
264  void setStaffNbOfSeats (const NbOfSeats_T& iStaffSeats) {
265  _staffNbOfBookings = iStaffSeats;
266  }
267 
269  void setWLNbOfSeats (const NbOfSeats_T& iWLSeats) {
270  _wlNbOfBookings = iWLSeats;
271  }
272 
274  void setGroupNbOfSeats (const NbOfSeats_T& iGroupSeats) {
275  _groupNbOfBookings = iGroupSeats;
276  }
277 
279  void updateCurrentBidPrice();
280 
281 
282  public:
283  // /////////// Display support methods /////////
288  void toStream (std::ostream& ioOut) const {
289  ioOut << toString();
290  }
291 
296  void fromStream (std::istream& ioIn) {
297  }
298 
302  std::string toString() const;
303 
307  const std::string describeKey() const {
308  return _key.toString();
309  }
310 
314  const std::string displayVirtualClassList() const;
315 
316 
317  public:
318  // /////////// Business methods //////////
323 
328  _virtualClassList.push_back (iVC);
329  }
330 
335  _virtualClassList.clear();
336  }
337 
342  _bidPriceVector.clear();
343  }
344 
348  void addDemandInformation (const YieldValue_T&, const MeanValue_T&,
349  const StdDevValue_T&);
350 
355  _yieldLevelDemandMap.clear();
356  }
357 
358 
359  protected:
360  // ////////// Constructors and destructors /////////
364  LegCabin (const Key_T&);
368  ~LegCabin();
369 
370 
371  private:
375  LegCabin();
379  LegCabin (const LegCabin&);
380 
381 
382  protected:
383  // ////////// Attributes /////////
387  Key_T _key;
388 
393 
398 
401 
404 
407 
408  /* Committed space. */
410 
413 
416 
419 
422 
425 
428 
431 
432 
433  public:
436 
439 
442 
445 
448 
451 
454 
457 
460 
463  };
464 
465 }
466 #endif // __STDAIR_BOM_LEGCABIN_HPP
467 
void setSoldSeat(const NbOfSeats_T &iSoldSeat)
Definition: LegCabin.hpp:194
const NbOfSeats_T & getETB() const
Definition: LegCabin.hpp:152
const Key_T & getKey() const
Definition: LegCabin.hpp:42
const CapacityAdjustment_T & getRegradeAdjustment() const
Definition: LegCabin.hpp:122
BidPrice_T _currentBidPrice
Definition: LegCabin.hpp:418
std::map< YieldLevel_T, MeanStdDevPair_T > YieldLevelDemandMap_T
const YieldLevelDemandMap_T & getYieldLevelDemandMap()
Definition: LegCabin.hpp:183
BidPriceVector_T & getBidPriceVector()
Definition: LegCabin.hpp:177
HolderMap_T _holderMap
Definition: LegCabin.hpp:397
std::string CabinCode_T
const NbOfSeats_T & getSoldSeat() const
Definition: LegCabin.hpp:87
const NbOfSeats_T & getStaffNbOfSeats() const
Definition: LegCabin.hpp:157
void updateFromReservation(const NbOfBookings_T &)
Definition: LegCabin.cpp:114
Class representing the actual attributes for an airline leg-cabin.
Definition: LegCabin.hpp:25
Utility class for linking StdAir-based objects.
double Availability_T
const std::string toString() const
Definition: LegCabinKey.cpp:46
std::vector< BidPrice_T > BidPriceVector_T
void setCurrentBidPrice(const BidPrice_T &iBidPrice)
Definition: LegCabin.hpp:214
void addVirtualClass(const VirtualClassStruct &iVC)
Definition: LegCabin.hpp:327
Availability_T _gav
Definition: LegCabin.hpp:447
const NbOfSeats_T & getWLNbOfSeats() const
Definition: LegCabin.hpp:162
const CommittedSpace_T & getCommittedSpace() const
Definition: LegCabin.hpp:92
void updateCurrentBidPrice()
Definition: LegCabin.cpp:120
BidPriceVector_T _bidPriceVector
Definition: LegCabin.hpp:424
Handle on the StdAir library context.
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 updatePreviousBidPrice()
Definition: LegCabin.hpp:224
void toStream(std::ostream &ioOut) const
Definition: LegCabin.hpp:288
const MapKey_T getFullerKey() const
Definition: LegCabin.cpp:80
CapacityAdjustment_T _dcsRegrade
Definition: LegCabin.hpp:435
void emptyYieldLevelDemandMap()
Definition: LegCabin.hpp:354
YieldLevelDemandMap_T _yieldLevelDemandMap
Definition: LegCabin.hpp:430
NbOfRequests_T NbOfBookings_T
const std::string displayVirtualClassList() const
Definition: LegCabin.cpp:96
std::string MapKey_T
Definition: key_types.hpp:15
Availability_T _availabilityPool
Definition: LegCabin.hpp:412
BomAbstract *const getParent() const
Definition: LegCabin.hpp:49
void setGroupNbOfSeats(const NbOfSeats_T &iGroupSeats)
Definition: LegCabin.hpp:274
const UPR_T & getUPR() const
Definition: LegCabin.hpp:132
const Availability_T & getAvailability() const
Definition: LegCabin.hpp:102
void emptyVirtualClassList()
Definition: LegCabin.hpp:334
const BidPrice_T & getCurrentBidPrice() const
Definition: LegCabin.hpp:107
std::string toString() const
Definition: LegCabin.cpp:89
CabinCapacity_T _physicalCapacity
Definition: LegCabin.hpp:403
const BidPrice_T & getPreviousBidPrice() const
Definition: LegCabin.hpp:112
void setPreviousBidPrice(const BidPrice_T &iBidPrice)
Definition: LegCabin.hpp:219
BomAbstract * _parent
Definition: LegCabin.hpp:392
double NbOfSeats_T
std::list< VirtualClassStruct > VirtualClassList_T
void setWLNbOfSeats(const NbOfSeats_T &iWLSeats)
Definition: LegCabin.hpp:269
void setCapacities(const CabinCapacity_T &iCapacity)
Definition: LegCabin.cpp:73
void setAvailability(const Availability_T &iAvailability)
Definition: LegCabin.hpp:209
double StdDevValue_T
void setNetAvailability(const Availability_T &iNAV)
Definition: LegCabin.hpp:244
OverbookingRate_T _acp
Definition: LegCabin.hpp:450
Base class for Factory layer.
Definition: FacBom.hpp:22
double MeanValue_T
void setAuthorizationLevel(const AuthorizationLevel_T &iAU)
Definition: LegCabin.hpp:234
const Availability_T & getNetAvailability() const
Definition: LegCabin.hpp:137
void setAvgCancellationPercentage(const OverbookingRate_T &iACP)
Definition: LegCabin.hpp:254
CommittedSpace_T _committedSpace
Definition: LegCabin.hpp:409
void setCommittedSpace(const CommittedSpace_T &iCommittedSpace)
Definition: LegCabin.hpp:199
void setUPR(const UPR_T &iUPR)
Definition: LegCabin.hpp:239
void setAvailabilityPool(const Availability_T &iAvailabilityPool)
Definition: LegCabin.hpp:204
const NbOfSeats_T & getGroupNbOfSeats() const
Definition: LegCabin.hpp:167
LegCabinKey Key_T
Definition: LegCabin.hpp:35
const CabinCapacity_T & getOfferedCapacity() const
Definition: LegCabin.hpp:77
VirtualClassList_T _virtualClassList
Definition: LegCabin.hpp:427
const BidPriceVector_T & getBidPriceVector() const
Definition: LegCabin.hpp:117
void fromStream(std::istream &ioIn)
Definition: LegCabin.hpp:296
const std::string describeKey() const
Definition: LegCabin.hpp:307
void addDemandInformation(const YieldValue_T &, const MeanValue_T &, const StdDevValue_T &)
Definition: LegCabin.cpp:133
NbOfSeats_T _soldSeat
Definition: LegCabin.hpp:406
CabinCapacity_T _offeredCapacity
Definition: LegCabin.hpp:400
double AuthorizationLevel_T
const CabinCode_T & getCabinCode() const
Definition: LegCabin.hpp:56
void setETB(const NbOfSeats_T &iETB)
Definition: LegCabin.hpp:259
BidPrice_T _previousBidPrice
Definition: LegCabin.hpp:421
const Availability_T & getAvailabilityPool() const
Definition: LegCabin.hpp:97
AuthorizationLevel_T _au
Definition: LegCabin.hpp:438
const CabinCapacity_T & getPhysicalCapacity() const
Definition: LegCabin.hpp:82
double YieldValue_T
NbOfSeats_T _etb
Definition: LegCabin.hpp:453
const Availability_T & getGrossAvailability() const
Definition: LegCabin.hpp:142
Key of a given leg-cabin, made of a cabin code (only).
Definition: LegCabinKey.hpp:26
const OverbookingRate_T & getAvgCancellationPercentage() const
Definition: LegCabin.hpp:147
void setGrossAvailability(const Availability_T &iGAV)
Definition: LegCabin.hpp:249
const AuthorizationLevel_T & getAuthorizationLevel() const
Definition: LegCabin.hpp:127
const CabinCode_T & getCabinCode() const
Definition: LegCabinKey.hpp:56
const HolderMap_T & getHolderMap() const
Definition: LegCabin.hpp:72
NbOfSeats_T _staffNbOfBookings
Definition: LegCabin.hpp:456
Availability_T _nav
Definition: LegCabin.hpp:444
void setRegradeAdjustment(const CapacityAdjustment_T &iRegradeAdjustment)
Definition: LegCabin.hpp:229
double CapacityAdjustment_T
Base class for Factory layer.
Definition: FacCloneBom.hpp:22
NbOfSeats_T _groupNbOfBookings
Definition: LegCabin.hpp:462
NbOfSeats_T _wlNbOfBookings
Definition: LegCabin.hpp:459
Availability_T _availability
Definition: LegCabin.hpp:415
VirtualClassList_T & getVirtualClassList()
Definition: LegCabin.hpp:172
void emptyBidPriceVector()
Definition: LegCabin.hpp:341
void setStaffNbOfSeats(const NbOfSeats_T &iStaffSeats)
Definition: LegCabin.hpp:264