$treeview $search $mathjax
00001 #ifndef __STDAIR_BOM_LEGCABIN_HPP 00002 #define __STDAIR_BOM_LEGCABIN_HPP 00003 // ////////////////////////////////////////////////////////////////////// 00004 // Import section 00005 // ////////////////////////////////////////////////////////////////////// 00006 // STL 00007 #include <iosfwd> 00008 #include <string> 00009 // StdAir 00010 #include <stdair/stdair_inventory_types.hpp> 00011 #include <stdair/stdair_maths_types.hpp> 00012 #include <stdair/bom/BomAbstract.hpp> 00013 #include <stdair/bom/LegCabinKey.hpp> 00014 #include <stdair/bom/LegCabinTypes.hpp> 00015 #include <stdair/bom/VirtualClassStruct.hpp> 00016 #include <stdair/bom/VirtualClassTypes.hpp> 00017 00018 00019 namespace stdair { 00020 00025 class LegCabin : public BomAbstract { 00026 template <typename BOM> friend class FacBom; 00027 template <typename BOM> friend class FacCloneBom; 00028 friend class FacBomManager; 00029 00030 public: 00031 // ////////// Type definitions //////////// 00035 typedef LegCabinKey Key_T; 00036 00037 public: 00038 // /////////// Getters //////////// 00042 const Key_T& getKey() const { 00043 return _key; 00044 } 00045 00049 BomAbstract* const getParent() const { 00050 return _parent; 00051 } 00052 00056 const CabinCode_T& getCabinCode() const { 00057 return _key.getCabinCode(); 00058 } 00059 00067 const MapKey_T getFullerKey() const; 00068 00072 const HolderMap_T& getHolderMap() const { 00073 return _holderMap; 00074 } 00075 00077 const CabinCapacity_T& getOfferedCapacity() const { 00078 return _offeredCapacity; 00079 } 00080 00082 const CabinCapacity_T& getPhysicalCapacity() const { 00083 return _physicalCapacity; 00084 } 00085 00087 const NbOfSeats_T& getSoldSeat() const { 00088 return _soldSeat; 00089 } 00090 00092 const CommittedSpace_T& getCommittedSpace() const { 00093 return _committedSpace; 00094 } 00095 00097 const Availability_T& getAvailabilityPool() const { 00098 return _availabilityPool; 00099 } 00100 00102 const Availability_T& getAvailability() const { 00103 return _availability; 00104 } 00105 00107 const BidPrice_T& getCurrentBidPrice() const { 00108 return _currentBidPrice; 00109 } 00110 00112 const BidPrice_T& getPreviousBidPrice() const { 00113 return _previousBidPrice; 00114 } 00115 00117 const BidPriceVector_T& getBidPriceVector() const { 00118 return _bidPriceVector; 00119 } 00120 00122 const CapacityAdjustment_T& getRegradeAdjustment() const { 00123 return _dcsRegrade; 00124 } 00125 00127 const AuthorizationLevel_T& getAuthorizationLevel() const { 00128 return _au; 00129 } 00130 00132 const UPR_T& getUPR() const { 00133 return _upr; 00134 } 00135 00137 const Availability_T& getNetAvailability() const { 00138 return _nav; 00139 } 00140 00142 const Availability_T& getGrossAvailability() const { 00143 return _gav; 00144 } 00145 00147 const OverbookingRate_T& getAvgCancellationPercentage() const { 00148 return _acp; 00149 } 00150 00152 const NbOfSeats_T& getETB() const { 00153 return _etb; 00154 } 00155 00157 const NbOfSeats_T& getStaffNbOfSeats() const { 00158 return _staffNbOfBookings; 00159 } 00160 00162 const NbOfSeats_T& getWLNbOfSeats() const { 00163 return _wlNbOfBookings; 00164 } 00165 00167 const NbOfSeats_T& getGroupNbOfSeats() const { 00168 return _groupNbOfBookings; 00169 } 00170 00172 VirtualClassList_T& getVirtualClassList() { 00173 return _virtualClassList; 00174 } 00175 00177 BidPriceVector_T& getBidPriceVector() { 00178 return _bidPriceVector; 00179 } 00180 00181 00183 const YieldLevelDemandMap_T& getYieldLevelDemandMap() { 00184 return _yieldLevelDemandMap; 00185 } 00186 00187 00188 public: 00189 // ///////////// Setters /////////////// 00191 void setCapacities (const CabinCapacity_T& iCapacity); 00192 00194 void setSoldSeat (const NbOfSeats_T& iSoldSeat) { 00195 _soldSeat = iSoldSeat; 00196 } 00197 00199 void setCommittedSpace (const CommittedSpace_T& iCommittedSpace) { 00200 _committedSpace = iCommittedSpace; 00201 } 00202 00204 void setAvailabilityPool (const Availability_T& iAvailabilityPool) { 00205 _availabilityPool = iAvailabilityPool; 00206 } 00207 00209 void setAvailability (const Availability_T& iAvailability) { 00210 _availability = iAvailability; 00211 } 00212 00214 void setCurrentBidPrice (const BidPrice_T& iBidPrice) { 00215 _currentBidPrice = iBidPrice; 00216 } 00217 00219 void setPreviousBidPrice (const BidPrice_T& iBidPrice) { 00220 _previousBidPrice = iBidPrice; 00221 } 00222 00224 void updatePreviousBidPrice () { 00225 _previousBidPrice = _currentBidPrice; 00226 } 00227 00229 void setRegradeAdjustment (const CapacityAdjustment_T& iRegradeAdjustment) { 00230 _dcsRegrade = iRegradeAdjustment; 00231 } 00232 00234 void setAuthorizationLevel (const AuthorizationLevel_T& iAU) { 00235 _au = iAU; 00236 } 00237 00239 void setUPR (const UPR_T& iUPR) { 00240 _upr = iUPR; 00241 } 00242 00244 void setNetAvailability (const Availability_T& iNAV) { 00245 _nav = iNAV; 00246 } 00247 00249 void setGrossAvailability (const Availability_T& iGAV) { 00250 _gav = iGAV; 00251 } 00252 00254 void setAvgCancellationPercentage (const OverbookingRate_T& iACP) { 00255 _acp = iACP; 00256 } 00257 00259 void setETB (const NbOfSeats_T& iETB) { 00260 _etb = iETB; 00261 } 00262 00264 void setStaffNbOfSeats (const NbOfSeats_T& iStaffSeats) { 00265 _staffNbOfBookings = iStaffSeats; 00266 } 00267 00269 void setWLNbOfSeats (const NbOfSeats_T& iWLSeats) { 00270 _wlNbOfBookings = iWLSeats; 00271 } 00272 00274 void setGroupNbOfSeats (const NbOfSeats_T& iGroupSeats) { 00275 _groupNbOfBookings = iGroupSeats; 00276 } 00277 00279 void updateCurrentBidPrice(); 00280 00281 00282 public: 00283 // /////////// Display support methods ///////// 00288 void toStream (std::ostream& ioOut) const { 00289 ioOut << toString(); 00290 } 00291 00296 void fromStream (std::istream& ioIn) { 00297 } 00298 00302 std::string toString() const; 00303 00307 const std::string describeKey() const { 00308 return _key.toString(); 00309 } 00310 00314 const std::string displayVirtualClassList() const; 00315 00316 00317 public: 00318 // /////////// Business methods ////////// 00322 void updateFromReservation (const NbOfBookings_T&); 00323 00327 void addVirtualClass (const VirtualClassStruct& iVC) { 00328 _virtualClassList.push_back (iVC); 00329 } 00330 00334 void emptyVirtualClassList() { 00335 _virtualClassList.clear(); 00336 } 00337 00341 void emptyBidPriceVector() { 00342 _bidPriceVector.clear(); 00343 } 00344 00348 void addDemandInformation (const YieldValue_T&, const MeanValue_T&, 00349 const StdDevValue_T&); 00350 00354 void emptyYieldLevelDemandMap() { 00355 _yieldLevelDemandMap.clear(); 00356 } 00357 00358 00359 protected: 00360 // ////////// Constructors and destructors ///////// 00364 LegCabin (const Key_T&); 00368 ~LegCabin(); 00369 00370 00371 private: 00375 LegCabin(); 00379 LegCabin (const LegCabin&); 00380 00381 00382 protected: 00383 // ////////// Attributes ///////// 00387 Key_T _key; 00388 00392 BomAbstract* _parent; 00393 00397 HolderMap_T _holderMap; 00398 00400 CabinCapacity_T _offeredCapacity; 00401 00403 CabinCapacity_T _physicalCapacity; 00404 00406 NbOfSeats_T _soldSeat; 00407 00408 /* Committed space. */ 00409 CommittedSpace_T _committedSpace; 00410 00412 Availability_T _availabilityPool; 00413 00415 Availability_T _availability; 00416 00418 BidPrice_T _currentBidPrice; 00419 00421 BidPrice_T _previousBidPrice; 00422 00424 BidPriceVector_T _bidPriceVector; 00425 00427 VirtualClassList_T _virtualClassList; 00428 00430 YieldLevelDemandMap_T _yieldLevelDemandMap; 00431 00432 00433 public: 00435 CapacityAdjustment_T _dcsRegrade; 00436 00438 AuthorizationLevel_T _au; 00439 00441 UPR_T _upr; 00442 00444 Availability_T _nav; 00445 00447 Availability_T _gav; 00448 00450 OverbookingRate_T _acp; 00451 00453 NbOfSeats_T _etb; 00454 00456 NbOfSeats_T _staffNbOfBookings; 00457 00459 NbOfSeats_T _wlNbOfBookings; 00460 00462 NbOfSeats_T _groupNbOfBookings; 00463 }; 00464 00465 } 00466 #endif // __STDAIR_BOM_LEGCABIN_HPP 00467