StdAir Logo  0.43.0
C++ Standard Airline IT Library
Inventory.hpp
Go to the documentation of this file.
00001 #ifndef __STDAIR_BOM_INVENTORY_HPP
00002 #define __STDAIR_BOM_INVENTORY_HPP
00003 
00004 // //////////////////////////////////////////////////////////////////////
00005 // Import section
00006 // //////////////////////////////////////////////////////////////////////
00007 // STL
00008 #include <iosfwd>
00009 #include <string>
00010 // StdAir
00011 #include <stdair/stdair_inventory_types.hpp>
00012 #include <stdair/bom/BomAbstract.hpp>
00013 #include <stdair/bom/InventoryKey.hpp>
00014 #include <stdair/bom/InventoryTypes.hpp>
00015 
00017 namespace boost {
00018   namespace serialization {
00019     class access;
00020   }
00021 }
00022 
00023 namespace stdair {
00024   
00026   class AirlineFeature;
00027   struct FlightDateKey;
00028   class FlightDate;
00029 
00033   class Inventory : public BomAbstract {
00034     template <typename BOM> friend class FacBom;
00035     friend class FacBomManager;
00036     friend class boost::serialization::access;
00037 
00038   public :
00039     // ////////// Type definitions ////////////
00043     typedef InventoryKey Key_T;
00044 
00045 
00046   public:
00047     // ////////// Getters ////////////
00049     const Key_T& getKey() const {
00050       return _key;
00051     }
00052     
00054     const AirlineCode_T& getAirlineCode() const {
00055       return _key.getAirlineCode();
00056     }
00057     
00059     BomAbstract* const getParent() const {
00060       return _parent;
00061     }
00062 
00064     const HolderMap_T& getHolderMap() const {
00065       return _holderMap;
00066     }
00067     
00078     FlightDate* getFlightDate (const std::string& iFlightDateKeyStr) const;
00079 
00090     FlightDate* getFlightDate (const FlightDateKey&) const;
00091 
00092 
00093   public:
00094     // /////////// Setters ////////////
00096     void setAirlineFeature (const AirlineFeature* ioAirlineFeaturePtr) {
00097       _airlineFeature = ioAirlineFeaturePtr;
00098     }
00099 
00100 
00101   public:
00102     // /////////// Display support methods /////////
00108     void toStream (std::ostream& ioOut) const {
00109       ioOut << toString();
00110     }
00111 
00117     void fromStream (std::istream& ioIn) {
00118     }
00119 
00123     std::string toString() const;
00124     
00128     const std::string describeKey() const {
00129       return _key.toString();
00130     }
00131 
00132 
00133   public:
00134     // /////////// (Boost) Serialisation support methods /////////
00138     template<class Archive>
00139     void serialize (Archive& ar, const unsigned int iFileVersion);
00140 
00141   private:
00146     void serialisationImplementation();
00147 
00148 
00149   protected:
00150     // ////////// Constructors and destructors /////////
00154     Inventory (const Key_T&);
00158     ~Inventory();
00159 
00160   private:
00164     Inventory();
00168     Inventory (const Inventory&);
00169 
00170     
00171   protected:
00172     // ////////// Attributes /////////
00176     Key_T _key;
00177 
00181     BomAbstract* _parent;
00182 
00186     const AirlineFeature* _airlineFeature;
00187 
00191     HolderMap_T _holderMap;
00192   };
00193 
00194 }
00195 #endif // __STDAIR_BOM_INVENTORY_HPP
00196