$treeview $search $mathjax
StdAir Logo  1.00.2
$projectbrief
$projectbrief
$searchbox

stdair/bom/BomRoot.hpp

Go to the documentation of this file.
00001 #ifndef __STDAIR_BOM_BOMROOT_HPP
00002 #define __STDAIR_BOM_BOMROOT_HPP
00003 
00004 // //////////////////////////////////////////////////////////////////////
00005 // Import section
00006 // //////////////////////////////////////////////////////////////////////
00007 // STL
00008 #include <iosfwd>
00009 #include <string>
00010 // StdAir
00011 #include <stdair/bom/BomAbstract.hpp>
00012 #include <stdair/bom/BomRootKey.hpp>
00013 #include <stdair/bom/FRAT5CurveHolderStruct.hpp>
00014 #include <stdair/bom/FFDisutilityCurveHolderStruct.hpp>
00015 
00017 namespace boost {
00018   namespace serialization {
00019     class access;
00020   }
00021 }
00022 
00023 namespace stdair {
00024 
00026   struct InventoryKey;
00027   class Inventory;
00028 
00032   class BomRoot : public BomAbstract {
00033     template <typename BOM> friend class FacBom;    
00034     template <typename BOM> friend class FacCloneBom;
00035     friend class FacBomManager;
00036     friend class boost::serialization::access;
00037     
00038   public:
00042     typedef BomRootKey Key_T;
00043 
00044 
00045   public:
00046     // ////////// Getters ////////////
00048     const Key_T& getKey() const {
00049       return _key;
00050     }
00051 
00053     const HolderMap_T& getHolderMap() const {
00054       return _holderMap;
00055     }
00056     
00058     const FRAT5Curve_T& getFRAT5Curve (const std::string& iKey) const {
00059       return _frat5CurveHolder.getFRAT5Curve (iKey);
00060     }
00061 
00063     const FFDisutilityCurve_T& getFFDisutilityCurve (const std::string& iKey) const{
00064       return _ffDisutilityCurveHolder.getFFDisutilityCurve (iKey);
00065     }    
00066 
00077     Inventory* getInventory (const std::string& iInventoryKeyStr) const;
00078 
00089     Inventory* getInventory (const InventoryKey&) const;
00090 
00091     // ///////////// Business Methods //////////
00093     void addFRAT5Curve (const std::string& iKey, const FRAT5Curve_T& iCurve) {
00094       _frat5CurveHolder.addCurve (iKey, iCurve);
00095     }
00096     
00098     void addFFDisutilityCurve (const std::string& iKey,
00099                                const FFDisutilityCurve_T& iCurve) {
00100       _ffDisutilityCurveHolder.addCurve (iKey, iCurve);
00101     }
00102 
00103 
00104   public:
00105     // /////////// Display support methods /////////
00111     void toStream (std::ostream& ioOut) const {
00112       ioOut << toString();
00113     }
00114 
00120     void fromStream (std::istream& ioIn) {
00121     }
00122 
00126     std::string toString() const;
00127     
00131     const std::string describeKey() const {
00132       return _key.toString();
00133     }
00134     
00135 
00136   public:
00137     // /////////// (Boost) Serialisation support methods /////////
00148     template<class Archive>
00149     void serialize (Archive& ar, const unsigned int iFileVersion);
00150 
00151   private:
00159     void serialisationImplementationExport() const;
00160     void serialisationImplementationImport();
00161 
00162 
00163   protected:
00164     // ////////// Constructors and destructors /////////
00168     BomRoot();
00169 
00173     BomRoot (const BomRoot&);
00174 
00178     BomRoot (const Key_T& iKey);
00179 
00183     ~BomRoot();
00184 
00185 
00186   protected:
00187     // /////////////// Attributes ////////////////
00191     Key_T _key;
00192 
00196     HolderMap_T _holderMap;
00197 
00201     FRAT5CurveHolderStruct _frat5CurveHolder;
00202 
00206     FFDisutilityCurveHolderStruct _ffDisutilityCurveHolder;
00207   };
00208 
00209 }
00210 #endif // __STDAIR_BOM_BOMROOT_HPP