StdAir Logo  1.00.3
C++ Standard Airline IT Object Library
BomRoot.hpp
Go to the documentation of this file.
1 #ifndef __STDAIR_BOM_BOMROOT_HPP
2 #define __STDAIR_BOM_BOMROOT_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 
26  struct InventoryKey;
27  class Inventory;
28 
32  class BomRoot : public BomAbstract {
33  template <typename BOM> friend class FacBom;
34  template <typename BOM> friend class FacCloneBom;
35  friend class FacBomManager;
37 
38  public:
42  typedef BomRootKey Key_T;
43 
44 
45  public:
46  // ////////// Getters ////////////
48  const Key_T& getKey() const {
49  return _key;
50  }
51 
53  const HolderMap_T& getHolderMap() const {
54  return _holderMap;
55  }
56 
58  const FRAT5Curve_T& getFRAT5Curve (const std::string& iKey) const {
59  return _frat5CurveHolder.getFRAT5Curve (iKey);
60  }
61 
63  const FFDisutilityCurve_T& getFFDisutilityCurve (const std::string& iKey) const{
65  }
66 
77  Inventory* getInventory (const std::string& iInventoryKeyStr) const;
78 
89  Inventory* getInventory (const InventoryKey&) const;
90 
91  // ///////////// Business Methods //////////
93  void addFRAT5Curve (const std::string& iKey, const FRAT5Curve_T& iCurve) {
94  _frat5CurveHolder.addCurve (iKey, iCurve);
95  }
96 
98  void addFFDisutilityCurve (const std::string& iKey,
99  const FFDisutilityCurve_T& iCurve) {
100  _ffDisutilityCurveHolder.addCurve (iKey, iCurve);
101  }
102 
103 
104  public:
105  // /////////// Display support methods /////////
111  void toStream (std::ostream& ioOut) const {
112  ioOut << toString();
113  }
114 
120  void fromStream (std::istream& ioIn) {
121  }
122 
126  std::string toString() const;
127 
131  const std::string describeKey() const {
132  return _key.toString();
133  }
134 
135 
136  public:
137  // /////////// (Boost) Serialisation support methods /////////
148  template<class Archive>
149  void serialize (Archive& ar, const unsigned int iFileVersion);
150 
151  private:
159  void serialisationImplementationExport() const;
160  void serialisationImplementationImport();
161 
162 
163  protected:
164  // ////////// Constructors and destructors /////////
168  BomRoot();
169 
173  BomRoot (const BomRoot&);
174 
178  BomRoot (const Key_T& iKey);
179 
183  ~BomRoot();
184 
185 
186  protected:
187  // /////////////// Attributes ////////////////
191  Key_T _key;
192 
197 
202 
207  };
208 
209 }
210 #endif // __STDAIR_BOM_BOMROOT_HPP
void addCurve(const std::string &, const FFDisutilityCurve_T &)
std::map< const DTD_T, FRAT5_T > FRAT5Curve_T
std::map< const DTD_T, double > FFDisutilityCurve_T
void fromStream(std::istream &ioIn)
Definition: BomRoot.hpp:120
void addFRAT5Curve(const std::string &iKey, const FRAT5Curve_T &iCurve)
Definition: BomRoot.hpp:93
Utility class for linking StdAir-based objects.
const FFDisutilityCurve_T & getFFDisutilityCurve(const std::string &iKey) const
Definition: BomRoot.hpp:63
Handle on the StdAir library context.
std::map< const std::type_info *, BomAbstract * > HolderMap_T
Definition: BomAbstract.hpp:63
FFDisutilityCurveHolderStruct _ffDisutilityCurveHolder
Definition: BomRoot.hpp:206
Base class for the Business Object Model (BOM) layer.
Definition: BomAbstract.hpp:24
HolderMap_T _holderMap
Definition: BomRoot.hpp:196
const Key_T & getKey() const
Definition: BomRoot.hpp:48
std::string toString() const
Definition: BomRoot.cpp:36
Key of the BOM structure root.
Definition: BomRootKey.hpp:25
Key of a given inventory, made of the airline code.
void addFFDisutilityCurve(const std::string &iKey, const FFDisutilityCurve_T &iCurve)
Definition: BomRoot.hpp:98
Base class for Factory layer.
Definition: FacBom.hpp:22
const HolderMap_T & getHolderMap() const
Definition: BomRoot.hpp:53
const FFDisutilityCurve_T & getFFDisutilityCurve(const std::string &) const
void addCurve(const std::string &, const FRAT5Curve_T &)
const FRAT5Curve_T & getFRAT5Curve(const std::string &iKey) const
Definition: BomRoot.hpp:58
FRAT5CurveHolderStruct _frat5CurveHolder
Definition: BomRoot.hpp:201
Class representing the actual attributes for an airline inventory.
Definition: Inventory.hpp:34
Forward declarations.
Inventory * getInventory(const std::string &iInventoryKeyStr) const
Definition: BomRoot.cpp:43
Class representing the actual attributes for the Bom root.
Definition: BomRoot.hpp:32
const std::string toString() const
Definition: BomRootKey.cpp:46
BomRootKey Key_T
Definition: BomRoot.hpp:42
friend class boost::serialization::access
Definition: BomRoot.hpp:36
const std::string describeKey() const
Definition: BomRoot.hpp:131
Base class for Factory layer.
Definition: FacCloneBom.hpp:22
const FRAT5Curve_T & getFRAT5Curve(const std::string &) const
void toStream(std::ostream &ioOut) const
Definition: BomRoot.hpp:111
void serialize(Archive &ar, const unsigned int iFileVersion)