1.00.0
C++ Standard Airline IT Object Library
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
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
#include <
stdair/bom/PolicyTypes.hpp
>
16
18
namespace
boost {
19
namespace
serialization {
20
class
access;
21
}
22
}
23
24
namespace
stdair {
25
// Forward declarations
26
class
SegmentSnapshotTable;
27
class
Policy;
28
33
class
SegmentCabin
:
public
BomAbstract
{
34
template
<
typename
BOM>
friend
class
FacBom
;
35
template
<
typename
BOM>
friend
class
FacCloneBom
;
36
friend
class
FacBomManager
;
37
friend
class
boost::serialization::access
;
38
39
public
:
40
// ////////// Type definitions ////////////
44
typedef
SegmentCabinKey
Key_T
;
45
46
47
public
:
48
// /////////// Getters /////////////
52
const
Key_T
&
getKey
()
const
{
53
return
_key
;
54
}
55
59
BomAbstract
*
const
getParent
()
const
{
60
return
_parent
;
61
}
62
66
const
HolderMap_T
&
getHolderMap
()
const
{
67
return
_holderMap
;
68
}
69
73
const
CabinCode_T
&
getCabinCode
()
const
{
74
return
_key
.
getCabinCode
();
75
}
76
85
const
MapKey_T
getFullerKey
()
const
;
86
88
const
SegmentSnapshotTable
&
getSegmentSnapshotTable
()
const
{
89
assert (
_segmentSnapshotTable
!= NULL);
90
return
*
_segmentSnapshotTable
;
91
}
92
94
const
CabinCapacity_T
&
getCapacity
()
const
{
95
return
_capacity
;
96
}
97
99
const
BlockSpace_T
&
getBlockSpace
()
const
{
100
return
_blockSpace
;
101
}
102
104
const
BlockSpace_T
&
getMIN
()
const
{
105
return
_min
;
106
}
107
109
const
UPR_T
&
getUPR
()
const
{
110
return
_upr
;
111
}
112
114
const
NbOfBookings_T
&
getBookingCounter
()
const
{
115
return
_bookingCounter
;
116
}
117
119
const
CommittedSpace_T
&
getCommittedSpace
()
const
{
120
return
_committedSpace
;
121
}
122
124
const
Availability_T
&
getAvailabilityPool
()
const
{
125
return
_availabilityPool
;
126
}
127
129
const
BidPrice_T
&
getCurrentBidPrice
()
const
{
130
return
_currentBidPrice
;
131
}
132
134
const
BidPriceVector_T
&
getBidPriceVector
()
const
{
135
return
_bidPriceVector
;
136
}
137
139
const
bool
getFareFamilyStatus
()
const
{
140
return
_fareFamilyActivation
;
141
}
142
144
const
PolicyList_T
&
getConvexHull
()
const
{
145
return
_convexHull
;
146
}
147
148
public
:
149
// ///////// Setters //////////
151
void
setSegmentSnapshotTable
(
SegmentSnapshotTable
& ioTable) {
152
_segmentSnapshotTable
= &ioTable;
153
}
154
156
void
setCapacity
(
const
CabinCapacity_T
& iCapacity) {
157
_capacity
= iCapacity;
158
}
159
161
void
setBlockSpace
(
const
BlockSpace_T
& iBlockSpace) {
162
_blockSpace
= iBlockSpace;
163
}
164
166
void
setMIN
(
const
BlockSpace_T
& iMIN) {
167
_min
= iMIN;
168
}
169
171
void
setUPR
(
const
UPR_T
& iUPR) {
172
_upr
= iUPR;
173
}
174
176
void
setBookingCounter
(
const
NbOfBookings_T
& iBookingCounter) {
177
_bookingCounter
= iBookingCounter;
178
}
179
181
void
setCommittedSpace
(
const
CommittedSpace_T
& iCommittedSpace) {
182
_committedSpace
= iCommittedSpace;
183
}
184
186
void
setAvailabilityPool
(
const
Availability_T
& iAvailabilityPool) {
187
_availabilityPool
= iAvailabilityPool;
188
}
189
191
void
setBidPriceVector
(
const
BidPriceVector_T
& iBPV) {
192
_bidPriceVector
= iBPV;
193
}
194
196
void
activateFareFamily
() {
197
_fareFamilyActivation
=
true
;
198
}
199
200
public
:
201
// /////////// Business methods //////////
203
void
updateFromReservation
(
const
NbOfBookings_T
&);
204
206
void
resetConvexHull
() {
_convexHull
.clear(); }
207
212
void
addPolicy
(
Policy
&);
213
214
public
:
215
// /////////// Display support methods /////////
221
void
toStream
(std::ostream& ioOut)
const
{
222
ioOut <<
toString
();
223
}
224
230
void
fromStream
(std::istream& ioIn) {
231
}
232
236
std::string
toString
()
const
;
237
241
const
std::string
describeKey
()
const
{
242
return
_key
.
toString
();
243
}
244
248
const
std::string
describeConvexHull
()
const
;
249
250
251
public
:
252
// /////////// (Boost) Serialisation support methods /////////
256
template
<
class
Archive>
257
void
serialize
(Archive& ar,
const
unsigned
int
iFileVersion);
258
259
private
:
267
void
serialisationImplementationExport()
const
;
268
void
serialisationImplementationImport();
269
270
271
protected
:
272
// ////////// Constructors and destructors /////////
276
SegmentCabin
(
const
Key_T
&);
277
281
virtual
~SegmentCabin
();
282
283
private
:
287
SegmentCabin
();
288
292
SegmentCabin
(
const
SegmentCabin
&);
293
294
295
protected
:
296
// ////////// Attributes /////////
300
Key_T
_key
;
301
305
BomAbstract
*
_parent
;
306
310
HolderMap_T
_holderMap
;
311
315
SegmentSnapshotTable
*
_segmentSnapshotTable
;
316
318
CabinCapacity_T
_capacity
;
319
321
BlockSpace_T
_blockSpace
;
322
324
BlockSpace_T
_min
;
325
327
UPR_T
_upr
;
328
330
NbOfBookings_T
_bookingCounter
;
331
333
CommittedSpace_T
_committedSpace
;
334
336
Availability_T
_availabilityPool
;
337
339
BidPriceVector_T
_bidPriceVector
;
340
342
BidPrice_T
_currentBidPrice
;
343
345
bool
_fareFamilyActivation
;
346
348
PolicyList_T
_convexHull
;
349
350
};
351
352
}
353
#endif // __STDAIR_BOM_SEGMENTCABIN_HPP
354
Generated on Sat Dec 22 2012 16:51:54 for StdAir by
1.8.1.1