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

stdair/bom/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/basic/BasConst_Inventory.hpp>
00013 #include <stdair/bom/BomAbstract.hpp>
00014 #include <stdair/bom/AirlineFeature.hpp>
00015 #include <stdair/bom/InventoryKey.hpp>
00016 #include <stdair/bom/InventoryTypes.hpp>
00017 
00019 namespace boost {
00020   namespace serialization {
00021     class access;
00022   }
00023 }
00024 
00025 namespace stdair {
00026   
00028   struct FlightDateKey;
00029   class FlightDate;
00030 
00034   class Inventory : public BomAbstract {
00035     template <typename BOM> friend class FacBom;  
00036     template <typename BOM> friend class FacCloneBom;
00037     friend class FacBomManager;
00038     friend class boost::serialization::access;
00039 
00040   public :
00041     // ////////// Type definitions ////////////
00045     typedef InventoryKey Key_T;
00046 
00047 
00048   public:
00049     // ////////// Getters ////////////
00051     const Key_T& getKey() const {
00052       return _key;
00053     }
00054     
00056     const AirlineCode_T& getAirlineCode() const {
00057       return _key.getAirlineCode();
00058     }
00059 
00061     ForecastingMethod::EN_ForecastingMethod getForecastingMethod() const;
00062 
00064     UnconstrainingMethod::EN_UnconstrainingMethod getUnconstrainingMethod() const;
00065     
00067     PreOptimisationMethod::EN_PreOptimisationMethod getPreOptimisationMethod() const;
00068     
00070     OptimisationMethod::EN_OptimisationMethod getOptimisationMethod() const;
00071     
00073     PartnershipTechnique::EN_PartnershipTechnique getPartnershipTechnique() const;
00074     
00076     BomAbstract* const getParent() const {
00077       return _parent;
00078     }
00079 
00081     const HolderMap_T& getHolderMap() const {
00082       return _holderMap;
00083     }
00084     
00095     FlightDate* getFlightDate (const std::string& iFlightDateKeyStr) const;
00096 
00107     FlightDate* getFlightDate (const FlightDateKey&) const;
00108 
00112     AirlineFeature* getAirlineFeature () const {
00113       return _airlineFeature;
00114     }
00115 
00116 
00117   private:
00118     // /////////// Setters ////////////
00120     void setAirlineFeature (AirlineFeature& iAirlineFeature) {
00121       _airlineFeature = &iAirlineFeature;
00122     }
00123 
00124 
00125   public:
00126     // /////////// Display support methods /////////
00132     void toStream (std::ostream& ioOut) const {
00133       ioOut << toString();
00134     }
00135 
00141     void fromStream (std::istream& ioIn) {
00142     }
00143 
00147     std::string toString() const;
00148     
00152     const std::string describeKey() const {
00153       return _key.toString();
00154     }
00155 
00156 
00157   public:
00158     // /////////// (Boost) Serialisation support methods /////////
00162     template<class Archive>
00163     void serialize (Archive& ar, const unsigned int iFileVersion);
00164 
00165   private:
00173     void serialisationImplementationExport() const;
00174     void serialisationImplementationImport();
00175 
00176 
00177   protected:
00178     // ////////// Constructors and destructors /////////
00182     Inventory (const Key_T&);
00186     ~Inventory();
00187 
00188   private:
00192     Inventory();
00196     Inventory (const Inventory&);
00197 
00198     
00199   protected:
00200     // ////////// Attributes /////////
00204     Key_T _key;
00205 
00209     BomAbstract* _parent;
00210 
00214     AirlineFeature* _airlineFeature;
00215 
00219     HolderMap_T _holderMap;
00220   };
00221 
00222 }
00223 #endif // __STDAIR_BOM_INVENTORY_HPP
00224