StdAir Logo  0.43.0
C++ Standard Airline IT Library
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 
00015 namespace boost {
00016   namespace serialization {
00017     class access;
00018   }
00019 }
00020 
00021 namespace stdair {
00022 
00024   struct InventoryKey;
00025   class Inventory;
00026 
00030   class BomRoot : public BomAbstract {
00031     template <typename BOM> friend class FacBom;
00032     friend class FacBomManager;
00033     friend class boost::serialization::access;
00034     
00035   public:
00039     typedef BomRootKey Key_T;
00040 
00041 
00042   public:
00043     // ////////// Getters ////////////
00045     const Key_T& getKey() const {
00046       return _key;
00047     }
00048 
00050     const HolderMap_T& getHolderMap() const {
00051       return _holderMap;
00052     }
00053 
00064     Inventory* getInventory (const std::string& iInventoryKeyStr) const;
00065 
00076     Inventory* getInventory (const InventoryKey&) const;
00077 
00078 
00079   public:
00080     // /////////// Display support methods /////////
00086     void toStream (std::ostream& ioOut) const {
00087       ioOut << toString();
00088     }
00089 
00095     void fromStream (std::istream& ioIn) {
00096     }
00097 
00101     std::string toString() const;
00102     
00106     const std::string describeKey() const {
00107       return _key.toString();
00108     }
00109     
00110 
00111   public:
00112     // /////////// (Boost) Serialisation support methods /////////
00123     template<class Archive>
00124     void serialize (Archive& ar, const unsigned int iFileVersion);
00125 
00126   private:
00134     void serialisationImplementation();
00135 
00136 
00137   protected:
00138     // ////////// Constructors and destructors /////////
00142     BomRoot();
00143 
00147     BomRoot (const BomRoot&);
00148 
00152     BomRoot (const Key_T& iKey);
00153 
00157     ~BomRoot();
00158 
00159 
00160   protected:
00161     // /////////////// Attributes ////////////////
00165     Key_T _key;
00166 
00170     HolderMap_T _holderMap;
00171   };
00172 
00173 }
00174 #endif // __STDAIR_BOM_BOMROOT_HPP