StdAir Logo  0.45.1
C++ Standard Airline IT Object Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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  friend class FacBomManager;
33 
34  public:
35  // //////////////// Type definitions //////////////////
39  typedef BucketKey Key_T;
40 
41  public:
42  // /////////// Getters ////////////
46  const Key_T& getKey() const {
47  return _key;
48  }
49 
53  BomAbstract* const getParent() const {
54  return _parent;
55  }
56 
58  const HolderMap_T& getHolderMap() const {
59  return _holderMap;
60  }
61 
63  const SeatIndex_T& getSeatIndex() const {
64  return _key.getSeatIndex();
65  }
66 
69  return _yieldRangeUpperValue;
70  }
71 
74  return _availability;
75  }
76 
78  const NbOfSeats_T& getSoldSeats() const {
79  return _soldSeats;
80  }
81 
82 
83  // /////////// Setters ////////////
85  void setYieldRangeUpperValue (const Yield_T& iYield) {
86  _yieldRangeUpperValue = iYield;
87  }
88 
90  void setAvailability (const CabinCapacity_T& iAvl) {
91  _availability = iAvl;
92  }
93 
95  void setSoldSeats (const NbOfSeats_T& iSoldSeats) {
96  _soldSeats = iSoldSeats;
97  }
98 
99 
100  public:
101  // /////////// Display support methods /////////
107  void toStream (std::ostream& ioOut) const {
108  ioOut << toString();
109  }
110 
116  void fromStream (std::istream& ioIn) {
117  }
118 
122  std::string toString() const;
123 
127  const std::string describeKey() const {
128  return _key.toString();
129  }
130 
131 
132  public:
133  // /////////// (Boost) Serialisation support methods /////////
137  template<class Archive>
138  void serialize (Archive& ar, const unsigned int iFileVersion);
139 
140  private:
145  void serialisationImplementationExport() const;
146  void serialisationImplementationImport();
147 
148 
149  protected:
150  // ////////// Constructors and destructors /////////
154  Bucket (const Key_T&);
155 
159  virtual ~Bucket();
160 
161  private:
165  Bucket();
166 
170  Bucket (const Bucket&);
171 
172 
173  protected:
174  // //////////////////// Children ///////////////////
179 
184 
189 
190 
191  protected:
192  // //////////////////// Attributes ///////////////////
197 
202 
207  };
208 
209 }
210 #endif // __STDAIR_BOM_BUCKET_HPP
211