AirSched Logo  0.1.4
C++ Simulated Airline Schedule Manager Library
OriginDestinationSet.hpp
Go to the documentation of this file.
00001 #ifndef __AIRSCHED_BOM_ORIGINDESTINATIONSET_HPP
00002 #define __AIRSCHED_BOM_ORIGINDESTINATIONSET_HPP
00003 
00004 // //////////////////////////////////////////////////////////////////////
00005 // Import section
00006 // //////////////////////////////////////////////////////////////////////
00007 // STL
00008 #include <iosfwd>
00009 #include <string>
00010 // StdAir
00011 #include <stdair/bom/BomAbstract.hpp>
00012 // AirSched
00013 #include <airsched/bom/OriginDestinationSetKey.hpp>
00014 #include <airsched/bom/OriginDestinationSetTypes.hpp>
00015 
00017 namespace boost {
00018   namespace serialization {
00019     class access;
00020   }
00021 }
00022 
00024 namespace stdair {
00025   template <typename BOM> class FacBom;
00026   class FacBomManager;
00027 }
00028 
00029 namespace AIRSCHED {
00030 
00044   class OriginDestinationSet : public stdair::BomAbstract {
00048     template <typename BOM> friend class stdair::FacBom;
00049     friend  class stdair::FacBomManager;
00050     friend class boost::serialization::access;
00051 
00052   public:
00053     // ////////// Type definitions ////////////
00057     typedef OriginDestinationSetKey Key_T;
00058 
00059 
00060   public:
00061     // /////////// Getters /////////////
00065     const Key_T& getKey() const {
00066       return _key;
00067     }
00068 
00072     const stdair::AirportCode_T& getDestination() const {
00073       return _key.getOffPoint();
00074     }
00075 
00079     stdair::BomAbstract* const getParent() const {
00080       return _parent;
00081     }
00082 
00086     const stdair::HolderMap_T& getHolderMap() const {
00087       return _holderMap;
00088     }
00089 
00090 
00091   public:
00092     // /////////// Display support methods /////////
00098     void toStream (std::ostream& ioOut) const {
00099       ioOut << toString();
00100     }
00101 
00107     void fromStream (std::istream& ioIn) {
00108     }
00109 
00113     std::string toString() const;
00114     
00118     const std::string describeKey() const {
00119       return _key.toString();
00120     }
00121     
00122 
00123   public:
00124     // /////////// (Boost) Serialisation support methods /////////
00128     template<class Archive>
00129     void serialize (Archive& ar, const unsigned int iFileVersion);
00130 
00131   private:
00136     void serialisationImplementationExport() const;
00137     void serialisationImplementationImport();
00138 
00139 
00140   protected:
00141     // ////////// Constructors and destructors /////////
00145     OriginDestinationSet (const Key_T&);
00146 
00150     ~OriginDestinationSet();
00151 
00152   private:
00156     OriginDestinationSet();
00157 
00161     OriginDestinationSet (const OriginDestinationSet&);
00162 
00163   protected:
00164     // ////////// Attributes /////////
00168     Key_T _key;
00169 
00173     stdair::BomAbstract* _parent;
00174 
00178     stdair::HolderMap_T _holderMap;
00179   };
00180 
00181 }
00182 #endif // __AIRSCHED_BOM_ORIGINDESTINATIONSET_HPP
00183