StdAir Logo  1.00.18
C++ Standard Airline IT Object Library
Loading...
Searching...
No Matches
Bucket.hpp
Go to the documentation of this file.
1#ifndef __STDAIR_BOM_BUCKET_HPP
2#define __STDAIR_BOM_BUCKET_HPP
3
4// //////////////////////////////////////////////////////////////////////
5// Import section
6// //////////////////////////////////////////////////////////////////////
7// STL
8#include <iosfwd>
9#include <string>
10// StdAir
15
17namespace boost {
18 namespace serialization {
19 class access;
20 }
21}
22
23namespace stdair {
24
29 class Bucket : public BomAbstract {
30 template <typename BOM> friend class FacBom;
31 template <typename BOM> friend class FacCloneBom;
32 friend class FacBomManager;
34
35 public:
36 // //////////////// Type definitions //////////////////
41
42 public:
43 // /////////// Getters ////////////
47 const Key_T& getKey() const {
48 return _key;
49 }
50
54 BomAbstract* const getParent() const {
55 return _parent;
56 }
57
59 const HolderMap_T& getHolderMap() const {
60 return _holderMap;
61 }
62
64 const SeatIndex_T& getSeatIndex() const {
65 return _key.getSeatIndex();
66 }
67
71 }
72
75 return _availability;
76 }
77
79 const NbOfSeats_T& getSoldSeats() const {
80 return _soldSeats;
81 }
82
83
84 // /////////// Setters ////////////
86 void setYieldRangeUpperValue (const Yield_T& iYield) {
87 _yieldRangeUpperValue = iYield;
88 }
89
91 void setAvailability (const CabinCapacity_T& iAvl) {
92 _availability = iAvl;
93 }
94
96 void setSoldSeats (const NbOfSeats_T& iSoldSeats) {
97 _soldSeats = iSoldSeats;
98 }
99
100
101 public:
102 // /////////// Display support methods /////////
108 void toStream (std::ostream& ioOut) const {
109 ioOut << toString();
110 }
111
117 void fromStream (std::istream& ioIn) {
118 }
119
123 std::string toString() const;
124
128 const std::string describeKey() const {
129 return _key.toString();
130 }
131
132
133 public:
134 // /////////// (Boost) Serialisation support methods /////////
138 template<class Archive>
139 void serialize (Archive& ar, const unsigned int iFileVersion);
140
141 private:
146 void serialisationImplementationExport() const;
147 void serialisationImplementationImport();
148
149
150 protected:
151 // ////////// Constructors and destructors /////////
155 Bucket (const Key_T&);
156
160 virtual ~Bucket();
161
162 private:
166 Bucket();
167
171 Bucket (const Bucket&);
172
173
174 protected:
175 // //////////////////// Children ///////////////////
180
185
190
191
192 protected:
193 // //////////////////// Attributes ///////////////////
198
203
208 };
209
210}
211#endif // __STDAIR_BOM_BUCKET_HPP
212
Handle on the StdAir library context.
unsigned int SeatIndex_T
std::map< const std::type_info *, BomAbstract * > HolderMap_T
Forward declarations.
Class representing the actual attributes for an airline booking class.
Definition Bucket.hpp:29
BomAbstract *const getParent() const
Definition Bucket.hpp:54
std::string toString() const
Definition Bucket.cpp:42
const std::string describeKey() const
Definition Bucket.hpp:128
void fromStream(std::istream &ioIn)
Definition Bucket.hpp:117
HolderMap_T _holderMap
Definition Bucket.hpp:189
const Yield_T & getYieldRangeUpperValue() const
Definition Bucket.hpp:69
const SeatIndex_T & getSeatIndex() const
Definition Bucket.hpp:64
BucketKey Key_T
Definition Bucket.hpp:40
void setSoldSeats(const NbOfSeats_T &iSoldSeats)
Definition Bucket.hpp:96
const HolderMap_T & getHolderMap() const
Definition Bucket.hpp:59
BomAbstract * _parent
Definition Bucket.hpp:184
void setYieldRangeUpperValue(const Yield_T &iYield)
Definition Bucket.hpp:86
const CabinCapacity_T & getAvailability() const
Definition Bucket.hpp:74
const NbOfSeats_T & getSoldSeats() const
Definition Bucket.hpp:79
const Key_T & getKey() const
Definition Bucket.hpp:47
void toStream(std::ostream &ioOut) const
Definition Bucket.hpp:108
CabinCapacity_T _availability
Definition Bucket.hpp:202
Yield_T _yieldRangeUpperValue
Definition Bucket.hpp:197
friend class FacBom
Definition Bucket.hpp:30
virtual ~Bucket()
Definition Bucket.cpp:38
void setAvailability(const CabinCapacity_T &iAvl)
Definition Bucket.hpp:91
friend class FacCloneBom
Definition Bucket.hpp:31
friend class boost::serialization::access
Definition Bucket.hpp:33
friend class FacBomManager
Definition Bucket.hpp:32
void serialize(Archive &ar, const unsigned int iFileVersion)
Definition Bucket.cpp:64
NbOfSeats_T _soldSeats
Definition Bucket.hpp:207
Bucket(const Key_T &)
Definition Bucket.cpp:34
Key of booking-class.
Definition BucketKey.hpp:26