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: 00149 void serialisationImplementationExport() const; 00150 void serialisationImplementationImport(); 00151 00152 00153 protected: 00154 // ////////// Constructors and destructors ///////// 00158 Inventory (const Key_T&); 00162 ~Inventory(); 00163 00164 private: 00168 Inventory(); 00172 Inventory (const Inventory&); 00173 00174 00175 protected: 00176 // ////////// Attributes ///////// 00180 Key_T _key; 00181 00185 BomAbstract* _parent; 00186 00190 const AirlineFeature* _airlineFeature; 00191 00195 HolderMap_T _holderMap; 00196 }; 00197 00198 } 00199 #endif // __STDAIR_BOM_INVENTORY_HPP 00200