StdAir Logo  1.00.18
C++ Standard Airline IT Object Library
Loading...
Searching...
No Matches
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
15
17namespace boost {
18 namespace serialization {
19 class access;
20 }
21}
22
23namespace stdair {
24
30 class Policy : public BomAbstract {
31 template <typename BOM> friend class FacBom;
32 friend class FacBomManager;
34
35 public:
36 // ////////// Type definitions ////////////
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
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
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
Handle on the StdAir library context.
double StdDevValue_T
NbOfRequests_T NbOfBookings_T
std::list< BookingClass * > BookingClassList_T
std::map< const std::type_info *, BomAbstract * > HolderMap_T
std::map< const Yield_T, double > YieldDemandMap_T
Forward declarations.
const NbOfBookings_T & getDemand() const
Definition Policy.hpp:65
const StdDevValue_T & getStdDev() const
Definition Policy.hpp:70
void addYieldDemand(const Yield_T &, const NbOfBookings_T &)
Definition Policy.cpp:70
const BookingClassList_T & getBookingClassList() const
Definition Policy.cpp:52
void setYield(const Yield_T &iYield)
Definition Policy.hpp:95
void resetDemandForecast()
Definition Policy.hpp:100
const HolderMap_T & getHolderMap() const
Definition Policy.hpp:57
Policy(const Key_T &)
Definition Policy.cpp:31
void toStream(std::ostream &ioOut) const
Definition Policy.hpp:116
BomAbstract *const getParent() const
Definition Policy.hpp:50
const std::string describeKey() const
Definition Policy.hpp:136
void setStdDev(const StdDevValue_T &iStdDev)
Definition Policy.hpp:90
virtual ~Policy()
Definition Policy.cpp:35
const Revenue_T getTotalRevenue() const
Definition Policy.cpp:57
std::string toString() const
Definition Policy.cpp:39
PolicyKey Key_T
Definition Policy.hpp:40
void serialize(Archive &ar, const unsigned int iFileVersion)
const Yield_T & getYield() const
Definition Policy.hpp:75
const Key_T & getKey() const
Definition Policy.hpp:45
friend class FacBom
Definition Policy.hpp:31
void fromStream(std::istream &ioIn)
Definition Policy.hpp:125
friend class boost::serialization::access
Definition Policy.hpp:33
friend class FacBomManager
Definition Policy.hpp:32
void setDemand(const NbOfBookings_T &iDemand)
Definition Policy.hpp:85
Key of a given policy, made of a policy code.
Definition PolicyKey.hpp:26