StdAir Logo  1.00.3
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 }
23 
24 namespace stdair {
25  // Forward declarations
26  class SegmentSnapshotTable;
27  class Policy;
28 
33  class SegmentCabin : public BomAbstract {
34  template <typename BOM> friend class FacBom;
35  template <typename BOM> friend class FacCloneBom;
36  friend class FacBomManager;
38 
39  public:
40  // ////////// Type definitions ////////////
45 
46 
47  public:
48  // /////////// Getters /////////////
52  const Key_T& getKey() const {
53  return _key;
54  }
55 
59  BomAbstract* const getParent() const {
60  return _parent;
61  }
62 
66  const HolderMap_T& getHolderMap() const {
67  return _holderMap;
68  }
69 
73  const CabinCode_T& getCabinCode() const {
74  return _key.getCabinCode();
75  }
76 
85  const MapKey_T getFullerKey() const;
86 
89  assert (_segmentSnapshotTable != NULL);
90  return *_segmentSnapshotTable;
91  }
92 
94  const CabinCapacity_T& getCapacity() const {
95  return _capacity;
96  }
97 
99  const BlockSpace_T& getBlockSpace() const {
100  return _blockSpace;
101  }
102 
104  const BlockSpace_T& getMIN() const {
105  return _min;
106  }
107 
109  const UPR_T& getUPR() const {
110  return _upr;
111  }
112 
115  return _bookingCounter;
116  }
117 
120  return _committedSpace;
121  }
122 
125  return _availabilityPool;
126  }
127 
130  return _currentBidPrice;
131  }
132 
135  return _bidPriceVector;
136  }
137 
139  const bool getFareFamilyStatus() const {
140  return _fareFamilyActivation;
141  }
142 
144  const PolicyList_T& getConvexHull() const {
145  return _convexHull;
146  }
147 
148  public:
149  // ///////// Setters //////////
152  _segmentSnapshotTable = &ioTable;
153  }
154 
156  void setCapacity (const CabinCapacity_T& iCapacity) {
157  _capacity = iCapacity;
158  }
159 
161  void setBlockSpace (const BlockSpace_T& iBlockSpace) {
162  _blockSpace = iBlockSpace;
163  }
164 
166  void setMIN (const BlockSpace_T& iMIN) {
167  _min = iMIN;
168  }
169 
171  void setUPR (const UPR_T& iUPR) {
172  _upr = iUPR;
173  }
174 
176  void setBookingCounter (const NbOfBookings_T& iBookingCounter) {
177  _bookingCounter = iBookingCounter;
178  }
179 
181  void setCommittedSpace (const CommittedSpace_T& iCommittedSpace) {
182  _committedSpace = iCommittedSpace;
183  }
184 
186  void setAvailabilityPool (const Availability_T& iAvailabilityPool) {
187  _availabilityPool = iAvailabilityPool;
188  }
189 
191  void setBidPriceVector (const BidPriceVector_T& iBPV) {
192  _bidPriceVector = iBPV;
193  }
194 
197  _fareFamilyActivation = true;
198  }
199 
200  public:
201  // /////////// Business methods //////////
204 
206  void resetConvexHull () { _convexHull.clear(); }
207 
212  void addPolicy (Policy&);
213 
214  public:
215  // /////////// Display support methods /////////
221  void toStream (std::ostream& ioOut) const {
222  ioOut << toString();
223  }
224 
230  void fromStream (std::istream& ioIn) {
231  }
232 
236  std::string toString() const;
237 
241  const std::string describeKey() const {
242  return _key.toString();
243  }
244 
248  const std::string describeConvexHull() const;
249 
250 
251  public:
252  // /////////// (Boost) Serialisation support methods /////////
256  template<class Archive>
257  void serialize (Archive& ar, const unsigned int iFileVersion);
258 
259  private:
267  void serialisationImplementationExport() const;
268  void serialisationImplementationImport();
269 
270 
271  protected:
272  // ////////// Constructors and destructors /////////
276  SegmentCabin (const Key_T&);
277 
281  virtual ~SegmentCabin();
282 
283  private:
287  SegmentCabin();
288 
292  SegmentCabin (const SegmentCabin&);
293 
294 
295  protected:
296  // ////////// Attributes /////////
300  Key_T _key;
301 
306 
311 
316 
319 
322 
325 
328 
331 
334 
337 
340 
343 
346 
349 
350  };
351 
352 }
353 #endif // __STDAIR_BOM_SEGMENTCABIN_HPP
354 
const std::string describeConvexHull() const
PolicyList_T _convexHull
CommittedSpace_T _committedSpace
const Availability_T & getAvailabilityPool() const
std::string CabinCode_T
SegmentSnapshotTable * _segmentSnapshotTable
Utility class for linking StdAir-based objects.
double Availability_T
std::vector< BidPrice_T > BidPriceVector_T
Handle on the StdAir library context.
const Key_T & getKey() const
void setCapacity(const CabinCapacity_T &iCapacity)
std::map< const std::type_info *, BomAbstract * > HolderMap_T
Definition: BomAbstract.hpp:63
const NbOfBookings_T & getBookingCounter() const
Base class for the Business Object Model (BOM) layer.
Definition: BomAbstract.hpp:24
void setBidPriceVector(const BidPriceVector_T &iBPV)
NbOfRequests_T NbOfBookings_T
const CabinCode_T & getCabinCode() const
std::string MapKey_T
Definition: key_types.hpp:15
const bool getFareFamilyStatus() const
const MapKey_T getFullerKey() const
BlockSpace_T _blockSpace
std::string toString() const
Key of a given segment-cabin, made of a cabin code (only).
const std::string toString() const
Availability_T _availabilityPool
const PolicyList_T & getConvexHull() const
Base class for Factory layer.
Definition: FacBom.hpp:22
void updateFromReservation(const NbOfBookings_T &)
void setCommittedSpace(const CommittedSpace_T &iCommittedSpace)
const CabinCapacity_T & getCapacity() const
void setBookingCounter(const NbOfBookings_T &iBookingCounter)
BomAbstract *const getParent() const
const BlockSpace_T & getBlockSpace() const
void setUPR(const UPR_T &iUPR)
const BidPriceVector_T & getBidPriceVector() const
BomAbstract * _parent
std::list< Policy * > PolicyList_T
Definition: PolicyTypes.hpp:17
NbOfBookings_T _bookingCounter
const CabinCode_T & getCabinCode() const
void serialize(Archive &ar, const unsigned int iFileVersion)
const UPR_T & getUPR() const
void fromStream(std::istream &ioIn)
void setMIN(const BlockSpace_T &iMIN)
const BlockSpace_T & getMIN() const
void setAvailabilityPool(const Availability_T &iAvailabilityPool)
Forward declarations.
void setBlockSpace(const BlockSpace_T &iBlockSpace)
BidPrice_T _currentBidPrice
const SegmentSnapshotTable & getSegmentSnapshotTable() const
Class representing the actual attributes for an airline segment-cabin.
const BidPrice_T & getCurrentBidPrice() const
void addPolicy(Policy &)
CabinCapacity_T _capacity
SegmentCabinKey Key_T
void toStream(std::ostream &ioOut) const
const std::string describeKey() const
const CommittedSpace_T & getCommittedSpace() const
Class representing the actual attributes for an airline segment data tables.
Base class for Factory layer.
Definition: FacCloneBom.hpp:22
friend class boost::serialization::access
void setSegmentSnapshotTable(SegmentSnapshotTable &ioTable)
const HolderMap_T & getHolderMap() const
BidPriceVector_T _bidPriceVector