StdAir Logo  1.00.3
C++ Standard Airline IT Object Library
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
13 #include <stdair/bom/BucketKey.hpp>
15 
17 namespace boost {
18  namespace serialization {
19  class access;
20  }
21 }
22 
23 namespace 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 //////////////////
40  typedef BucketKey Key_T;
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 
70  return _yieldRangeUpperValue;
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 ///////////////////
179  Key_T _key;
180 
185 
190 
191 
192  protected:
193  // //////////////////// Attributes ///////////////////
198 
203 
208  };
209 
210 }
211 #endif // __STDAIR_BOM_BUCKET_HPP
212 
CabinCapacity_T _availability
Definition: Bucket.hpp:202
virtual ~Bucket()
Definition: Bucket.cpp:38
const std::string describeKey() const
Definition: Bucket.hpp:128
const CabinCapacity_T & getAvailability() const
Definition: Bucket.hpp:74
NbOfSeats_T _soldSeats
Definition: Bucket.hpp:207
Utility class for linking StdAir-based objects.
BomAbstract *const getParent() const
Definition: Bucket.hpp:54
Handle on the StdAir library context.
std::map< const std::type_info *, BomAbstract * > HolderMap_T
Definition: BomAbstract.hpp:63
Base class for the Business Object Model (BOM) layer.
Definition: BomAbstract.hpp:24
void setSoldSeats(const NbOfSeats_T &iSoldSeats)
Definition: Bucket.hpp:96
const Key_T & getKey() const
Definition: Bucket.hpp:47
Class representing the actual attributes for an airline booking class.
Definition: Bucket.hpp:29
void serialize(Archive &ar, const unsigned int iFileVersion)
Definition: Bucket.cpp:64
const std::string toString() const
Definition: BucketKey.cpp:45
double NbOfSeats_T
Base class for Factory layer.
Definition: FacBom.hpp:22
Key of booking-class.
Definition: BucketKey.hpp:26
BomAbstract * _parent
Definition: Bucket.hpp:184
BucketKey Key_T
Definition: Bucket.hpp:40
friend class boost::serialization::access
Definition: Bucket.hpp:33
const NbOfSeats_T & getSoldSeats() const
Definition: Bucket.hpp:79
void fromStream(std::istream &ioIn)
Definition: Bucket.hpp:117
Forward declarations.
unsigned int SeatIndex_T
const SeatIndex_T & getSeatIndex() const
Definition: Bucket.hpp:64
std::string toString() const
Definition: Bucket.cpp:42
void setYieldRangeUpperValue(const Yield_T &iYield)
Definition: Bucket.hpp:86
const HolderMap_T & getHolderMap() const
Definition: Bucket.hpp:59
void toStream(std::ostream &ioOut) const
Definition: Bucket.hpp:108
void setAvailability(const CabinCapacity_T &iAvl)
Definition: Bucket.hpp:91
Yield_T _yieldRangeUpperValue
Definition: Bucket.hpp:197
const SeatIndex_T & getSeatIndex() const
Definition: BucketKey.hpp:54
Base class for Factory layer.
Definition: FacCloneBom.hpp:22
const Yield_T & getYieldRangeUpperValue() const
Definition: Bucket.hpp:69
HolderMap_T _holderMap
Definition: Bucket.hpp:189