StdAir Logo  0.45.1
C++ Standard Airline IT Object Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SegmentCabin.cpp
Go to the documentation of this file.
1 // //////////////////////////////////////////////////////////////////////
2 // Import section
3 // //////////////////////////////////////////////////////////////////////
4 // STL
5 #include <cassert>
6 #include <sstream>
7 // StdAir
14 
15 namespace stdair {
16 
17  // ////////////////////////////////////////////////////////////////////
18  SegmentCabin::SegmentCabin() : _key (DEFAULT_CABIN_CODE), _parent (NULL) {
19  assert (false);
20  }
21 
22  // ////////////////////////////////////////////////////////////////////
23  SegmentCabin::SegmentCabin (const SegmentCabin&)
24  : _key (DEFAULT_CABIN_CODE), _parent (NULL) {
25  assert (false);
26  }
27 
28  // ////////////////////////////////////////////////////////////////////
29  SegmentCabin::SegmentCabin (const Key_T& iKey)
30  : _key (iKey), _parent (NULL),
31  _capacity (DEFAULT_CABIN_CAPACITY),
32  _blockSpace (DEFAULT_BLOCK_SPACE),
33  _bookingCounter (DEFAULT_CLASS_NB_OF_BOOKINGS),
34  _committedSpace (DEFAULT_COMMITTED_SPACE),
35  _availabilityPool (DEFAULT_AVAILABILITY),
36  _bidPriceVector (DEFAULT_BID_PRICE_VECTOR),
37  _currentBidPrice (DEFAULT_BID_PRICE),
38  _fareFamilyActivation (false) {
39  }
40 
41  // ////////////////////////////////////////////////////////////////////
43  }
44 
45  // ////////////////////////////////////////////////////////////////////
47  const SegmentDate& lSegmentDate = BomManager::getParent<SegmentDate>(*this);
48 
49  const MapKey_T oFullKey =
51  return oFullKey;
52  }
53 
54  // ////////////////////////////////////////////////////////////////////
55  std::string SegmentCabin::toString() const {
56  std::ostringstream oStr;
57  oStr << describeKey();
58  return oStr.str();
59  }
60 
61  // ////////////////////////////////////////////////////////////////////
62  void SegmentCabin::
63  updateFromReservation (const NbOfBookings_T& iNbOfBookings) {
64  _committedSpace += iNbOfBookings;
65  }
66 
67 }
68