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