StdAir Logo  1.00.3
C++ Standard Airline IT Object Library
Inventory.hpp
Go to the documentation of this file.
1 #ifndef __STDAIR_BOM_INVENTORY_HPP
2 #define __STDAIR_BOM_INVENTORY_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <iosfwd>
9 #include <string>
10 // StdAir
17 
19 namespace boost {
20  namespace serialization {
21  class access;
22  }
23 }
24 
25 namespace stdair {
26 
28  struct FlightDateKey;
29  class FlightDate;
30 
34  class Inventory : public BomAbstract {
35  template <typename BOM> friend class FacBom;
36  template <typename BOM> friend class FacCloneBom;
37  friend class FacBomManager;
39 
40  public :
41  // ////////// Type definitions ////////////
46 
47 
48  public:
49  // ////////// Getters ////////////
51  const Key_T& getKey() const {
52  return _key;
53  }
54 
56  const AirlineCode_T& getAirlineCode() const {
57  return _key.getAirlineCode();
58  }
59 
62 
65 
68 
71 
74 
76  BomAbstract* const getParent() const {
77  return _parent;
78  }
79 
81  const HolderMap_T& getHolderMap() const {
82  return _holderMap;
83  }
84 
95  FlightDate* getFlightDate (const std::string& iFlightDateKeyStr) const;
96 
107  FlightDate* getFlightDate (const FlightDateKey&) const;
108 
113  return _airlineFeature;
114  }
115 
116 
117  private:
118  // /////////// Setters ////////////
120  void setAirlineFeature (AirlineFeature& iAirlineFeature) {
121  _airlineFeature = &iAirlineFeature;
122  }
123 
124 
125  public:
126  // /////////// Display support methods /////////
132  void toStream (std::ostream& ioOut) const {
133  ioOut << toString();
134  }
135 
141  void fromStream (std::istream& ioIn) {
142  }
143 
147  std::string toString() const;
148 
152  const std::string describeKey() const {
153  return _key.toString();
154  }
155 
156 
157  public:
158  // /////////// (Boost) Serialisation support methods /////////
162  template<class Archive>
163  void serialize (Archive& ar, const unsigned int iFileVersion);
164 
165  private:
173  void serialisationImplementationExport() const;
174  void serialisationImplementationImport();
175 
176 
177  protected:
178  // ////////// Constructors and destructors /////////
182  Inventory (const Key_T&);
186  ~Inventory();
187 
188  private:
192  Inventory();
196  Inventory (const Inventory&);
197 
198 
199  protected:
200  // ////////// Attributes /////////
204  Key_T _key;
205 
210 
215 
220  };
221 
222 }
223 #endif // __STDAIR_BOM_INVENTORY_HPP
224 
OptimisationMethod::EN_OptimisationMethod getOptimisationMethod() const
Definition: Inventory.cpp:85
void toStream(std::ostream &ioOut) const
Definition: Inventory.hpp:132
Utility class for linking StdAir-based objects.
ForecastingMethod::EN_ForecastingMethod getForecastingMethod() const
Definition: Inventory.cpp:64
UnconstrainingMethod::EN_UnconstrainingMethod getUnconstrainingMethod() const
Definition: Inventory.cpp:71
Handle on the StdAir library context.
std::map< const std::type_info *, BomAbstract * > HolderMap_T
Definition: BomAbstract.hpp:63
Base class for the Business Object Model (BOM) layer.
Definition: BomAbstract.hpp:24
AirlineFeature * _airlineFeature
Definition: Inventory.hpp:214
const HolderMap_T & getHolderMap() const
Definition: Inventory.hpp:81
friend class boost::serialization::access
Definition: Inventory.hpp:38
std::string toString() const
Definition: Inventory.cpp:42
std::string AirlineCode_T
const Key_T & getKey() const
Definition: Inventory.hpp:51
const AirlineCode_T & getAirlineCode() const
Definition: Inventory.hpp:56
HolderMap_T _holderMap
Definition: Inventory.hpp:219
BomAbstract *const getParent() const
Definition: Inventory.hpp:76
Key of a given inventory, made of the airline code.
const std::string describeKey() const
Definition: Inventory.hpp:152
Base class for Factory layer.
Definition: FacBom.hpp:22
Key of a given flight-date, made of a flight number and a departure date.
BomAbstract * _parent
Definition: Inventory.hpp:209
PartnershipTechnique::EN_PartnershipTechnique getPartnershipTechnique() const
Definition: Inventory.cpp:92
Class representing the actual attributes for an airline inventory.
Definition: Inventory.hpp:34
Forward declarations.
FlightDate * getFlightDate(const std::string &iFlightDateKeyStr) const
Definition: Inventory.cpp:50
void fromStream(std::istream &ioIn)
Definition: Inventory.hpp:141
const AirlineCode_T & getAirlineCode() const
AirlineFeature * getAirlineFeature() const
Definition: Inventory.hpp:112
void serialize(Archive &ar, const unsigned int iFileVersion)
Class representing various configuration parameters (e.g., revenue management methods such EMSRb or M...
PreOptimisationMethod::EN_PreOptimisationMethod getPreOptimisationMethod() const
Definition: Inventory.cpp:78
Class representing the actual attributes for an airline flight-date.
Definition: FlightDate.hpp:35
Base class for Factory layer.
Definition: FacCloneBom.hpp:22
InventoryKey Key_T
Definition: Inventory.hpp:45
const std::string toString() const