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
Policy.hpp
Go to the documentation of this file.
1
#ifndef __STDAIR_BOM_POLICY_HPP
2
#define __STDAIR_BOM_POLICY_HPP
3
4
// //////////////////////////////////////////////////////////////////////
5
// Import section
6
// //////////////////////////////////////////////////////////////////////
7
// STL
8
#include <cmath>
9
// StdAir
10
#include <
stdair/stdair_basic_types.hpp
>
11
#include <
stdair/stdair_rm_types.hpp
>
12
#include <
stdair/bom/BomAbstract.hpp
>
13
#include <
stdair/bom/BookingClassTypes.hpp
>
14
#include <
stdair/bom/PolicyKey.hpp
>
15
17
namespace
boost {
18
namespace
serialization {
19
class
access;
20
}
21
}
22
23
namespace
stdair {
24
30
class
Policy
:
public
BomAbstract
{
31
template
<
typename
BOM>
friend
class
FacBom
;
32
friend
class
FacBomManager
;
33
friend
class
boost::serialization::access
;
34
35
public
:
36
// ////////// Type definitions ////////////
40
typedef
PolicyKey
Key_T
;
41
42
public
:
43
// /////////////////// Getters ////////////////////////
45
const
Key_T
&
getKey
()
const
{
46
return
_key;
47
}
48
50
BomAbstract
*
const
getParent
()
const
{
51
return
_parent;
52
}
53
57
const
HolderMap_T
&
getHolderMap
()
const
{
58
return
_holderMap;
59
}
60
62
const
BookingClassList_T
&
getBookingClassList
()
const
;
63
65
const
NbOfBookings_T
&
getDemand
()
const
{
66
return
_demand;
67
}
68
70
const
StdDevValue_T
&
getStdDev
()
const
{
71
return
_stdDev;
72
}
73
75
const
Yield_T
&
getYield
()
const
{
76
return
_yield;
77
}
78
80
const
Revenue_T
getTotalRevenue
()
const
;
81
82
public
:
83
// ///////////////////// Setters /////////////////////
85
void
setDemand
(
const
NbOfBookings_T
& iDemand) {
86
_demand = iDemand;
87
}
88
90
void
setStdDev
(
const
StdDevValue_T
& iStdDev) {
91
_stdDev = iStdDev;
92
}
93
95
void
setYield
(
const
Yield_T
& iYield) {
96
_yield = iYield;
97
}
98
100
void
resetDemandForecast
() {
101
_demand = 0.0;
102
_stdDev = 0.0;
103
_yieldDemandMap.clear();
104
}
105
107
void
addYieldDemand
(
const
Yield_T
&,
const
NbOfBookings_T
&);
108
109
public
:
110
// /////////// Display support methods /////////
116
void
toStream
(std::ostream& ioOut)
const
{
117
ioOut <<
toString
();
118
}
119
125
void
fromStream
(std::istream& ioIn) {
126
}
127
131
std::string
toString
()
const
;
132
136
const
std::string
describeKey
()
const
{
137
return
_key.
toString
();
138
}
139
140
141
public
:
142
// /////////// (Boost) Serialisation support methods /////////
146
template
<
class
Archive>
147
void
serialize
(Archive& ar,
const
unsigned
int
iFileVersion);
148
149
private
:
157
void
serialisationImplementationExport()
const
;
158
void
serialisationImplementationImport();
159
160
161
protected
:
162
// /////////// Constructors and destructor. ////////////
166
Policy
(
const
Key_T
&);
167
171
virtual
~Policy
();
172
173
private
:
177
Policy
();
178
182
Policy
(
const
Policy
&);
183
184
185
private
:
186
// //////////// Attributes ////////////
190
Key_T
_key;
191
195
BomAbstract
* _parent;
196
200
HolderMap_T
_holderMap;
201
205
NbOfBookings_T
_demand;
206
210
StdDevValue_T
_stdDev;
211
215
Yield_T
_yield;
216
220
YieldDemandMap_T
_yieldDemandMap;
221
222
};
223
}
224
#endif // __STDAIR_BOM_POLICY_HPP
Generated on Sat Dec 22 2012 16:51:53 for StdAir by
1.8.1.1