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.hpp
Go to the documentation of this file.
1
#ifndef __STDAIR_BOM_SEGMENTCABIN_HPP
2
#define __STDAIR_BOM_SEGMENTCABIN_HPP
3
4
// //////////////////////////////////////////////////////////////////////
5
// Import section
6
// //////////////////////////////////////////////////////////////////////
7
// STL
8
#include <iosfwd>
9
#include <string>
10
// StdAir
11
#include <
stdair/stdair_inventory_types.hpp
>
12
#include <
stdair/bom/BomAbstract.hpp
>
13
#include <
stdair/bom/SegmentCabinKey.hpp
>
14
#include <
stdair/bom/SegmentCabinTypes.hpp
>
15
17
namespace
boost {
18
namespace
serialization {
19
class
access;
20
}
21
}
22
23
namespace
stdair {
24
// Forward declarations
25
class
GuillotineBlock;
26
31
class
SegmentCabin
:
public
BomAbstract
{
32
template
<
typename
BOM>
friend
class
FacBom
;
33
friend
class
FacBomManager
;
34
friend
class
boost::serialization::access
;
35
36
public
:
37
// ////////// Type definitions ////////////
41
typedef
SegmentCabinKey
Key_T
;
42
43
44
public
:
45
// /////////// Getters /////////////
49
const
Key_T
&
getKey
()
const
{
50
return
_key
;
51
}
52
56
BomAbstract
*
const
getParent
()
const
{
57
return
_parent
;
58
}
59
63
const
HolderMap_T
&
getHolderMap
()
const
{
64
return
_holderMap
;
65
}
66
70
const
CabinCode_T
&
getCabinCode
()
const
{
71
return
_key
.
getCabinCode
();
72
}
73
82
const
MapKey_T
getFullerKey
()
const
;
83
85
const
GuillotineBlock
&
getGuillotineBlock
()
const
{
86
assert (
_guillotineBlock
!= NULL);
87
return
*
_guillotineBlock
;
88
}
89
91
const
CabinCapacity_T
&
getCapacity
()
const
{
92
return
_capacity
;
93
}
94
96
const
BlockSpace_T
&
getBlockSpace
()
const
{
97
return
_blockSpace
;
98
}
99
101
const
BlockSpace_T
&
getMIN
()
const
{
102
return
_min
;
103
}
104
106
const
UPR_T
&
getUPR
()
const
{
107
return
_upr
;
108
}
109
111
const
NbOfBookings_T
&
getBookingCounter
()
const
{
112
return
_bookingCounter
;
113
}
114
116
const
CommittedSpace_T
&
getCommittedSpace
()
const
{
117
return
_committedSpace
;
118
}
119
121
const
Availability_T
&
getAvailabilityPool
()
const
{
122
return
_availabilityPool
;
123
}
124
126
const
BidPrice_T
&
getCurrentBidPrice
()
const
{
127
return
_currentBidPrice
;
128
}
129
131
const
BidPriceVector_T
&
getBidPriceVector
()
const
{
132
return
_bidPriceVector
;
133
}
134
136
const
bool
getFareFamilyStatus
()
const
{
137
return
_fareFamilyActivation
;
138
}
139
140
public
:
141
// ///////// Setters //////////
143
void
setGuillotineBlock
(
GuillotineBlock
& ioGuillotine) {
144
_guillotineBlock
= &ioGuillotine;
145
}
146
148
void
setCapacity
(
const
CabinCapacity_T
& iCapacity) {
149
_capacity
= iCapacity;
150
}
151
153
void
setBlockSpace
(
const
BlockSpace_T
& iBlockSpace) {
154
_blockSpace
= iBlockSpace;
155
}
156
158
void
setMIN
(
const
BlockSpace_T
& iMIN) {
159
_min
= iMIN;
160
}
161
163
void
setUPR
(
const
UPR_T
& iUPR) {
164
_upr
= iUPR;
165
}
166
168
void
setBookingCounter
(
const
NbOfBookings_T
& iBookingCounter) {
169
_bookingCounter
= iBookingCounter;
170
}
171
173
void
setCommittedSpace
(
const
CommittedSpace_T
& iCommittedSpace) {
174
_committedSpace
= iCommittedSpace;
175
}
176
178
void
setAvailabilityPool
(
const
Availability_T
& iAvailabilityPool) {
179
_availabilityPool
= iAvailabilityPool;
180
}
181
183
void
setBidPriceVector
(
const
BidPriceVector_T
& iBPV) {
184
_bidPriceVector
= iBPV;
185
}
186
188
void
activateFareFamily
() {
189
_fareFamilyActivation
=
true
;
190
}
191
192
public
:
193
// /////////// Business methods //////////
195
void
updateFromReservation
(
const
NbOfBookings_T
&);
196
197
198
public
:
199
// /////////// Display support methods /////////
205
void
toStream
(std::ostream& ioOut)
const
{
206
ioOut <<
toString
();
207
}
208
214
void
fromStream
(std::istream& ioIn) {
215
}
216
220
std::string
toString
()
const
;
221
225
const
std::string
describeKey
()
const
{
226
return
_key
.
toString
();
227
}
228
229
230
public
:
231
// /////////// (Boost) Serialisation support methods /////////
235
template
<
class
Archive>
236
void
serialize
(Archive& ar,
const
unsigned
int
iFileVersion);
237
238
private
:
246
void
serialisationImplementationExport()
const
;
247
void
serialisationImplementationImport();
248
249
250
protected
:
251
// ////////// Constructors and destructors /////////
255
SegmentCabin
(
const
Key_T
&);
256
260
virtual
~SegmentCabin
();
261
262
private
:
266
SegmentCabin
();
267
271
SegmentCabin
(
const
SegmentCabin
&);
272
273
274
protected
:
275
// ////////// Attributes /////////
279
Key_T
_key
;
280
284
BomAbstract
*
_parent
;
285
289
HolderMap_T
_holderMap
;
290
294
GuillotineBlock
*
_guillotineBlock
;
295
297
CabinCapacity_T
_capacity
;
298
300
BlockSpace_T
_blockSpace
;
301
303
BlockSpace_T
_min
;
304
306
UPR_T
_upr
;
307
309
NbOfBookings_T
_bookingCounter
;
310
312
CommittedSpace_T
_committedSpace
;
313
315
Availability_T
_availabilityPool
;
316
318
BidPriceVector_T
_bidPriceVector
;
319
321
BidPrice_T
_currentBidPrice
;
322
324
bool
_fareFamilyActivation
;
325
};
326
327
}
328
#endif // __STDAIR_BOM_SEGMENTCABIN_HPP
329
Generated on Fri Aug 17 2012 16:00:33 for StdAir by
1.8.1.2