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
BookingClass.hpp
Go to the documentation of this file.
1
#ifndef __STDAIR_BOM_BOOKINGCLASS_HPP
2
#define __STDAIR_BOM_BOOKINGCLASS_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/stdair_maths_types.hpp
>
13
#include <
stdair/stdair_rm_types.hpp
>
14
#include <
stdair/bom/BomAbstract.hpp
>
15
#include <
stdair/bom/BookingClassKey.hpp
>
16
#include <
stdair/bom/BookingClassTypes.hpp
>
17
18
namespace
stdair {
19
24
class
BookingClass
:
public
BomAbstract
{
25
template
<
typename
BOM>
friend
class
FacBom
;
26
friend
class
FacBomManager
;
27
28
public
:
29
// ////////// Type definitions ////////////
31
typedef
BookingClassKey
Key_T
;
32
33
public
:
34
// /////////// Getters ////////////
36
const
Key_T
&
getKey
()
const
{
37
return
_key
;
38
}
39
41
const
ClassCode_T
&
getClassCode
()
const
{
42
return
_key
.
getClassCode
();
43
}
44
46
BomAbstract
*
const
getParent
()
const
{
47
return
_parent
;
48
}
49
51
const
HolderMap_T
&
getHolderMap
()
const
{
52
return
_holderMap
;
53
}
54
56
const
SubclassCode_T
&
getSubclassCode
()
const
{
57
return
_subclassCode
;
58
}
59
61
const
AuthorizationLevel_T
&
getAuthorizationLevel
()
const
{
62
return
_au
;
63
}
64
66
const
ProtectionLevel_T
&
getProtection
()
const
{
67
return
_protection
;
68
}
69
71
const
ProtectionLevel_T
&
getCumulatedProtection
()
const
{
72
return
_cumulatedProtection
;
73
}
74
76
const
BookingLimit_T
&
getCumulatedBookingLimit
()
const
{
77
return
_cumulatedBookingLimit
;
78
}
79
81
const
NbOfSeats_T
&
getNegotiatedSpace
()
const
{
82
return
_nego
;
83
}
84
86
const
OverbookingRate_T
&
getNoShowPercentage
()
const
{
87
return
_noShowPercentage
;
88
}
89
91
const
OverbookingRate_T
&
getCancellationPercentage
()
const
{
92
return
_cancellationPercentage
;
93
}
94
96
const
NbOfBookings_T
&
getNbOfBookings
()
const
{
97
return
_nbOfBookings
;
98
}
99
101
const
NbOfBookings_T
&
getNbOfGroupBookings
()
const
{
102
return
_groupNbOfBookings
;
103
}
104
106
const
NbOfBookings_T
&
getNbOfPendingGroupBookings
()
const
{
107
return
_groupPendingNbOfBookings
;
108
}
109
111
const
NbOfBookings_T
&
getNbOfStaffBookings
()
const
{
112
return
_staffNbOfBookings
;
113
}
114
116
const
NbOfBookings_T
&
getNbOfWLBookings
()
const
{
117
return
_wlNbOfBookings
;
118
}
119
121
const
NbOfCancellations_T
&
getNbOfCancellations
()
const
{
122
return
_nbOfCancellations
;
123
}
124
126
const
NbOfBookings_T
&
getETB
()
const
{
127
return
_etb
;
128
}
129
131
const
Availability_T
&
getNetClassAvailability
()
const
{
132
return
_netClassAvailability
;
133
}
134
136
const
Availability_T
&
getSegmentAvailability
()
const
{
137
return
_segmentAvailability
;
138
}
139
141
const
Availability_T
&
getNetRevenueAvailability
()
const
{
142
return
_netRevenueAvailability
;
143
}
144
146
const
Yield_T
&
getYield
()
const
{
return
_yield
; }
147
149
const
MeanValue_T
&
getMean
()
const
{
return
_mean
; }
150
const
StdDevValue_T
&
getStdDev
()
const
{
return
_stdDev
; }
151
153
const
GeneratedDemandVector_T
&
getGeneratedDemandVector
()
const
{
154
return
_generatedDemandVector
;
155
}
156
157
public
:
158
// /////////// Setters ////////////
160
void
setCumulatedProtection
(
const
ProtectionLevel_T
& iPL) {
161
_cumulatedProtection
= iPL;
162
}
163
165
void
setProtection
(
const
ProtectionLevel_T
& iPL) {
166
_protection
= iPL;
167
}
168
170
void
setCumulatedBookingLimit
(
const
BookingLimit_T
& iBL) {
171
_cumulatedBookingLimit
= iBL;
172
}
173
175
void
setAuthorizationLevel
(
const
AuthorizationLevel_T
& iAU) {
176
_au
= iAU;
177
}
178
180
void
setSegmentAvailability
(
const
Availability_T
& iAvl) {
181
_segmentAvailability
= iAvl;
182
}
183
185
void
setYield
(
const
Yield_T
& iYield) {
_yield
= iYield; }
186
188
void
setMean
(
const
MeanValue_T
& iMean) {
_mean
= iMean; }
189
void
setStdDev
(
const
StdDevValue_T
& iStdDev) {
_stdDev
= iStdDev; }
190
191
public
:
192
// /////////// Display support methods /////////
195
void
toStream
(std::ostream& ioOut)
const
{
196
ioOut <<
toString
();
197
}
198
201
void
fromStream
(std::istream& ioIn) {
202
}
203
205
std::string
toString
()
const
;
206
208
const
std::string
describeKey
()
const
{
209
return
_key
.
toString
();
210
}
211
212
public
:
213
// ////////////// Business Methods /////////////////
215
void
sell
(
const
NbOfBookings_T
&);
216
218
void
cancel
(
const
NbOfBookings_T
&);
219
222
void
generateDemandSamples
(
const
int
&);
223
226
void
generateDemandSamples
(
const
int
&,
const
RandomSeed_T
&);
227
228
protected
:
229
// ////////// Constructors and destructors /////////
231
BookingClass
(
const
Key_T
&);
233
virtual
~BookingClass
();
234
235
private
:
237
BookingClass
();
239
BookingClass
(
const
BookingClass
&);
240
241
242
protected
:
243
// ////////// Attributes /////////
245
Key_T
_key
;
246
248
BomAbstract
*
_parent
;
249
251
HolderMap_T
_holderMap
;
252
254
SubclassCode_T
_subclassCode
;
255
257
ProtectionLevel_T
_cumulatedProtection
;
258
260
ProtectionLevel_T
_protection
;
261
263
BookingLimit_T
_cumulatedBookingLimit
;
264
266
AuthorizationLevel_T
_au
;
267
269
NbOfSeats_T
_nego
;
270
272
OverbookingRate_T
_noShowPercentage
;
273
275
OverbookingRate_T
_cancellationPercentage
;
276
278
NbOfBookings_T
_nbOfBookings
;
279
281
NbOfBookings_T
_groupNbOfBookings
;
282
284
NbOfBookings_T
_groupPendingNbOfBookings
;
285
287
NbOfBookings_T
_staffNbOfBookings
;
288
290
NbOfBookings_T
_wlNbOfBookings
;
291
293
NbOfCancellations_T
_nbOfCancellations
;
294
296
NbOfBookings_T
_etb
;
297
299
Availability_T
_netClassAvailability
;
300
302
Availability_T
_segmentAvailability
;
303
305
Availability_T
_netRevenueAvailability
;
306
308
Yield_T
_yield
;
309
311
MeanValue_T
_mean
;
312
StdDevValue_T
_stdDev
;
313
315
GeneratedDemandVector_T
_generatedDemandVector
;
316
};
317
318
}
319
#endif // __STDAIR_BOM_BOOKINGCLASS_HPP
Generated on Sun Aug 12 2012 18:33:54 for StdAir by
1.8.1.2