0.45.1
C++ Standard Airline IT Object Library
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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
8
#include <
stdair/basic/BasConst_BookingClass.hpp
>
9
#include <
stdair/basic/BasConst_Inventory.hpp
>
10
#include <
stdair/basic/BasConst_BomDisplay.hpp
>
11
#include <
stdair/bom/BomManager.hpp
>
12
#include <
stdair/bom/SegmentDate.hpp
>
13
#include <
stdair/bom/SegmentCabin.hpp
>
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
// ////////////////////////////////////////////////////////////////////
42
SegmentCabin::~SegmentCabin
() {
43
}
44
45
// ////////////////////////////////////////////////////////////////////
46
const
MapKey_T
SegmentCabin::getFullerKey
()
const
{
47
const
SegmentDate
& lSegmentDate = BomManager::getParent<SegmentDate>(*this);
48
49
const
MapKey_T
oFullKey =
50
lSegmentDate.
describeKey
() +
DEFAULT_KEY_FLD_DELIMITER
+
getCabinCode
();
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
Generated on Mon Aug 27 2012 21:34:04 for StdAir by
1.8.1.2