StdAir Logo  1.00.20
C++ Standard Airline IT Object Library
Loading...
Searching...
No Matches
SegmentCabin.cpp
Go to the documentation of this file.
1// //////////////////////////////////////////////////////////////////////
2// Import section
3// //////////////////////////////////////////////////////////////////////
4// STL
5#include <cassert>
6#include <sstream>
7// StdAir
17#include <stdair/bom/Policy.hpp>
18
19namespace stdair {
20
21 // ////////////////////////////////////////////////////////////////////
22 SegmentCabin::SegmentCabin() : _key (DEFAULT_CABIN_CODE), _parent (NULL) {
23 assert (false);
24 }
25
26 // ////////////////////////////////////////////////////////////////////
27 SegmentCabin::SegmentCabin (const SegmentCabin& iSegmentCabin)
28 : _key (iSegmentCabin._key), _parent (NULL),
29 _capacity (iSegmentCabin._capacity),
30 _blockSpace (iSegmentCabin._blockSpace),
31 _bookingCounter (iSegmentCabin._bookingCounter),
32 _committedSpace (iSegmentCabin._committedSpace),
33 _availabilityPool (iSegmentCabin._availabilityPool),
34 _currentBidPrice (iSegmentCabin._currentBidPrice),
35 _fareFamilyActivation (iSegmentCabin._fareFamilyActivation) {
36 }
37
38 // ////////////////////////////////////////////////////////////////////
50
51 // ////////////////////////////////////////////////////////////////////
54
55 // ////////////////////////////////////////////////////////////////////
57 const SegmentDate& lSegmentDate = BomManager::getParent<SegmentDate>(*this);
58
59 const MapKey_T oFullKey =
61 return oFullKey;
62 }
63
64 // ////////////////////////////////////////////////////////////////////
65 std::string SegmentCabin::toString() const {
66 std::ostringstream oStr;
67 oStr << describeKey();
68 return oStr.str();
69 }
70
71 // ////////////////////////////////////////////////////////////////////
72 const std::string SegmentCabin::describeConvexHull() const{
73 std::ostringstream oStr;
74 for (PolicyList_T::const_iterator itP = _convexHull.begin();
75 itP != _convexHull.end(); ++itP) {
76 const Policy* lPolicy = *itP;
77 assert (lPolicy != NULL);
78 oStr << lPolicy->toString();
79 }
80 return oStr.str();
81 }
82
83 // ////////////////////////////////////////////////////////////////////
85 updateFromReservation (const NbOfBookings_T& iNbOfBookings) {
86 _committedSpace += iNbOfBookings;
87 }
88
89 // ////////////////////////////////////////////////////////////////////
91 _convexHull.push_back (&ioPolicy);
92 }
93}
94
Handle on the StdAir library context.
const NbOfBookings_T DEFAULT_CLASS_NB_OF_BOOKINGS
const CommittedSpace_T DEFAULT_COMMITTED_SPACE
std::string MapKey_T
Definition key_types.hpp:15
NbOfRequests_T NbOfBookings_T
const Availability_T DEFAULT_AVAILABILITY
const CabinCode_T DEFAULT_CABIN_CODE
const BidPriceVector_T DEFAULT_BID_PRICE_VECTOR
Definition BasConst.cpp:475
const CabinCapacity_T DEFAULT_CABIN_CAPACITY
const BidPrice_T DEFAULT_BID_PRICE
const BlockSpace_T DEFAULT_BLOCK_SPACE
const std::string DEFAULT_KEY_FLD_DELIMITER
static PARENT & getParent(const CHILD &)
std::string toString() const
Definition Policy.cpp:39
const std::string describeKey() const
NbOfBookings_T _bookingCounter
BidPriceVector_T _bidPriceVector
Availability_T _availabilityPool
std::string toString() const
SegmentCabinKey Key_T
SegmentCabin(const Key_T &)
const MapKey_T getFullerKey() const
const std::string describeConvexHull() const
CommittedSpace_T _committedSpace
void updateFromReservation(const NbOfBookings_T &)
void addPolicy(Policy &)
CabinCapacity_T _capacity
const CabinCode_T & getCabinCode() const
Class representing the actual attributes for an airline segment-date.
const std::string describeKey() const