StdAir Logo  0.45.1
C++ Standard Airline IT Object Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SegmentCabin.hpp
Go to the documentation of this file.
1 #ifndef __STDAIR_BOM_SEGMENTCABIN_HPP
2 #define __STDAIR_BOM_SEGMENTCABIN_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <iosfwd>
9 #include <string>
10 // StdAir
15 
17 namespace boost {
18  namespace serialization {
19  class access;
20  }
21 }
22 
23 namespace stdair {
24  // Forward declarations
25  class GuillotineBlock;
26 
31  class SegmentCabin : public BomAbstract {
32  template <typename BOM> friend class FacBom;
33  friend class FacBomManager;
35 
36  public:
37  // ////////// Type definitions ////////////
42 
43 
44  public:
45  // /////////// Getters /////////////
49  const Key_T& getKey() const {
50  return _key;
51  }
52 
56  BomAbstract* const getParent() const {
57  return _parent;
58  }
59 
63  const HolderMap_T& getHolderMap() const {
64  return _holderMap;
65  }
66 
70  const CabinCode_T& getCabinCode() const {
71  return _key.getCabinCode();
72  }
73 
82  const MapKey_T getFullerKey() const;
83 
86  assert (_guillotineBlock != NULL);
87  return *_guillotineBlock;
88  }
89 
91  const CabinCapacity_T& getCapacity() const {
92  return _capacity;
93  }
94 
96  const BlockSpace_T& getBlockSpace() const {
97  return _blockSpace;
98  }
99 
101  const BlockSpace_T& getMIN() const {
102  return _min;
103  }
104 
106  const UPR_T& getUPR() const {
107  return _upr;
108  }
109 
112  return _bookingCounter;
113  }
114 
117  return _committedSpace;
118  }
119 
122  return _availabilityPool;
123  }
124 
127  return _currentBidPrice;
128  }
129 
132  return _bidPriceVector;
133  }
134 
136  const bool getFareFamilyStatus() const {
137  return _fareFamilyActivation;
138  }
139 
140  public:
141  // ///////// Setters //////////
143  void setGuillotineBlock (GuillotineBlock& ioGuillotine) {
144  _guillotineBlock = &ioGuillotine;
145  }
146 
148  void setCapacity (const CabinCapacity_T& iCapacity) {
149  _capacity = iCapacity;
150  }
151 
153  void setBlockSpace (const BlockSpace_T& iBlockSpace) {
154  _blockSpace = iBlockSpace;
155  }
156 
158  void setMIN (const BlockSpace_T& iMIN) {
159  _min = iMIN;
160  }
161 
163  void setUPR (const UPR_T& iUPR) {
164  _upr = iUPR;
165  }
166 
168  void setBookingCounter (const NbOfBookings_T& iBookingCounter) {
169  _bookingCounter = iBookingCounter;
170  }
171 
173  void setCommittedSpace (const CommittedSpace_T& iCommittedSpace) {
174  _committedSpace = iCommittedSpace;
175  }
176 
178  void setAvailabilityPool (const Availability_T& iAvailabilityPool) {
179  _availabilityPool = iAvailabilityPool;
180  }
181 
183  void setBidPriceVector (const BidPriceVector_T& iBPV) {
184  _bidPriceVector = iBPV;
185  }
186 
189  _fareFamilyActivation = true;
190  }
191 
192  public:
193  // /////////// Business methods //////////
196 
197 
198  public:
199  // /////////// Display support methods /////////
205  void toStream (std::ostream& ioOut) const {
206  ioOut << toString();
207  }
208 
214  void fromStream (std::istream& ioIn) {
215  }
216 
220  std::string toString() const;
221 
225  const std::string describeKey() const {
226  return _key.toString();
227  }
228 
229 
230  public:
231  // /////////// (Boost) Serialisation support methods /////////
235  template<class Archive>
236  void serialize (Archive& ar, const unsigned int iFileVersion);
237 
238  private:
246  void serialisationImplementationExport() const;
247  void serialisationImplementationImport();
248 
249 
250  protected:
251  // ////////// Constructors and destructors /////////
255  SegmentCabin (const Key_T&);
256 
260  virtual ~SegmentCabin();
261 
262  private:
266  SegmentCabin();
267 
271  SegmentCabin (const SegmentCabin&);
272 
273 
274  protected:
275  // ////////// Attributes /////////
280 
285 
290 
295 
298 
301 
304 
307 
310 
313 
316 
319 
322 
325  };
326 
327 }
328 #endif // __STDAIR_BOM_SEGMENTCABIN_HPP
329