StdAir Logo  0.45.0
C++ Standard Airline IT Object 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 serialisationImplementationExport() const;
00135     void serialisationImplementationImport();
00136 
00137 
00138   protected:
00139     // ////////// Constructors and destructors /////////
00143     BomRoot();
00144 
00148     BomRoot (const BomRoot&);
00149 
00153     BomRoot (const Key_T& iKey);
00154 
00158     ~BomRoot();
00159 
00160 
00161   protected:
00162     // /////////////// Attributes ////////////////
00166     Key_T _key;
00167 
00171     HolderMap_T _holderMap;
00172   };
00173 
00174 }
00175 #endif // __STDAIR_BOM_BOMROOT_HPP