StdAir Logo  1.00.13
C++ Standard Airline IT Object Library
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
16 
18 namespace boost {
19  namespace serialization {
20  class access;
21  }
22  namespace archive {
23  namespace detail {
24  template <class T>
25  struct heap_allocation;
26  }
27  }
28 }
29 
30 namespace stdair {
31  // Forward declarations
32  class SegmentSnapshotTable;
33  class Policy;
34 
39  class SegmentCabin : public BomAbstract {
40  template <typename BOM> friend class FacBom;
41  template <typename BOM> friend class FacCloneBom;
42  friend class FacBomManager;
44  template <class T> friend struct boost::archive::detail::heap_allocation;
45 
46  public:
47  // ////////// Type definitions ////////////
52 
53 
54  public:
55  // /////////// Getters /////////////
59  const Key_T& getKey() const {
60  return _key;
61  }
62 
66  BomAbstract* const getParent() const {
67  return _parent;
68  }
69 
73  const HolderMap_T& getHolderMap() const {
74  return _holderMap;
75  }
76 
80  const CabinCode_T& getCabinCode() const {
81  return _key.getCabinCode();
82  }
83 
92  const MapKey_T getFullerKey() const;
93 
96  assert (_segmentSnapshotTable != NULL);
97  return *_segmentSnapshotTable;
98  }
99 
101  const CabinCapacity_T& getCapacity() const {
102  return _capacity;
103  }
104 
106  const BlockSpace_T& getBlockSpace() const {
107  return _blockSpace;
108  }
109 
111  const BlockSpace_T& getMIN() const {
112  return _min;
113  }
114 
116  const UPR_T& getUPR() const {
117  return _upr;
118  }
119 
122  return _bookingCounter;
123  }
124 
127  return _committedSpace;
128  }
129 
132  return _availabilityPool;
133  }
134 
137  return _currentBidPrice;
138  }
139 
142  return _bidPriceVector;
143  }
144 
146  const bool getFareFamilyStatus() const {
147  return _fareFamilyActivation;
148  }
149 
151  const PolicyList_T& getConvexHull() const {
152  return _convexHull;
153  }
154 
155  public:
156  // ///////// Setters //////////
159  _segmentSnapshotTable = &ioTable;
160  }
161 
163  void setCapacity (const CabinCapacity_T& iCapacity) {
164  _capacity = iCapacity;
165  }
166 
168  void setBlockSpace (const BlockSpace_T& iBlockSpace) {
169  _blockSpace = iBlockSpace;
170  }
171 
173  void setMIN (const BlockSpace_T& iMIN) {
174  _min = iMIN;
175  }
176 
178  void setUPR (const UPR_T& iUPR) {
179  _upr = iUPR;
180  }
181 
183  void setBookingCounter (const NbOfBookings_T& iBookingCounter) {
184  _bookingCounter = iBookingCounter;
185  }
186 
188  void setCommittedSpace (const CommittedSpace_T& iCommittedSpace) {
189  _committedSpace = iCommittedSpace;
190  }
191 
193  void setAvailabilityPool (const Availability_T& iAvailabilityPool) {
194  _availabilityPool = iAvailabilityPool;
195  }
196 
198  void setBidPriceVector (const BidPriceVector_T& iBPV) {
199  _bidPriceVector = iBPV;
200  }
201 
204  _fareFamilyActivation = true;
205  }
206 
207  public:
208  // /////////// Business methods //////////
211 
213  void resetConvexHull () { _convexHull.clear(); }
214 
219  void addPolicy (Policy&);
220 
221  public:
222  // /////////// Display support methods /////////
228  void toStream (std::ostream& ioOut) const {
229  ioOut << toString();
230  }
231 
237  void fromStream (std::istream& ioIn) {
238  }
239 
243  std::string toString() const;
244 
248  const std::string describeKey() const {
249  return _key.toString();
250  }
251 
255  const std::string describeConvexHull() const;
256 
257 
258  public:
259  // /////////// (Boost) Serialisation support methods /////////
263  template<class Archive>
264  void serialize (Archive& ar, const unsigned int iFileVersion);
265 
266  private:
274  void serialisationImplementationExport() const;
275  void serialisationImplementationImport();
276 
277 
278  protected:
279  // ////////// Constructors and destructors /////////
283  SegmentCabin (const Key_T&);
284 
288  virtual ~SegmentCabin();
289 
290  private:
294  SegmentCabin();
295 
299  SegmentCabin (const SegmentCabin&);
300 
301 
302  protected:
303  // ////////// Attributes /////////
308 
313 
318 
323 
326 
329 
332 
335 
338 
341 
344 
347 
350 
353 
356 
357  };
358 
359 }
360 #endif // __STDAIR_BOM_SEGMENTCABIN_HPP
361 
Handle on the StdAir library context.
std::list< Policy * > PolicyList_T
Definition: PolicyTypes.hpp:17
std::string MapKey_T
Definition: key_types.hpp:15
NbOfRequests_T NbOfBookings_T
std::map< const std::type_info *, BomAbstract * > HolderMap_T
Definition: BomAbstract.hpp:63
double Availability_T
std::vector< BidPrice_T > BidPriceVector_T
std::string CabinCode_T
Forward declarations.
Base class for the Business Object Model (BOM) layer.
Definition: BomAbstract.hpp:24
Class representing the actual attributes for an airline segment-cabin.
const BidPriceVector_T & getBidPriceVector() const
const std::string describeKey() const
const CommittedSpace_T & getCommittedSpace() const
PolicyList_T _convexHull
NbOfBookings_T _bookingCounter
BidPriceVector_T _bidPriceVector
const BidPrice_T & getCurrentBidPrice() const
void setUPR(const UPR_T &iUPR)
const BlockSpace_T & getMIN() const
const CabinCapacity_T & getCapacity() const
const Key_T & getKey() const
SegmentSnapshotTable * _segmentSnapshotTable
Availability_T _availabilityPool
std::string toString() const
void fromStream(std::istream &ioIn)
SegmentCabinKey Key_T
void setCommittedSpace(const CommittedSpace_T &iCommittedSpace)
const SegmentSnapshotTable & getSegmentSnapshotTable() const
const BlockSpace_T & getBlockSpace() const
BidPrice_T _currentBidPrice
const UPR_T & getUPR() const
void setBidPriceVector(const BidPriceVector_T &iBPV)
const MapKey_T getFullerKey() const
const std::string describeConvexHull() const
const CabinCode_T & getCabinCode() const
void setAvailabilityPool(const Availability_T &iAvailabilityPool)
CommittedSpace_T _committedSpace
void updateFromReservation(const NbOfBookings_T &)
void setBookingCounter(const NbOfBookings_T &iBookingCounter)
void setMIN(const BlockSpace_T &iMIN)
const PolicyList_T & getConvexHull() const
void addPolicy(Policy &)
void toStream(std::ostream &ioOut) const
BomAbstract * _parent
const bool getFareFamilyStatus() const
friend class boost::serialization::access
const NbOfBookings_T & getBookingCounter() const
void setBlockSpace(const BlockSpace_T &iBlockSpace)
void serialize(Archive &ar, const unsigned int iFileVersion)
void setCapacity(const CabinCapacity_T &iCapacity)
BomAbstract *const getParent() const
CabinCapacity_T _capacity
BlockSpace_T _blockSpace
const Availability_T & getAvailabilityPool() const
void setSegmentSnapshotTable(SegmentSnapshotTable &ioTable)
const HolderMap_T & getHolderMap() const
Key of a given segment-cabin, made of a cabin code (only).
const std::string toString() const
const CabinCode_T & getCabinCode() const
Class representing the actual attributes for an airline segment data tables.
Base class for Factory layer.
Definition: FacBom.hpp:22
Utility class for linking StdAir-based objects.
Base class for Factory layer.
Definition: FacCloneBom.hpp:22