StdAir Logo  0.45.1
C++ Standard Airline IT Object Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TimePeriod.hpp
Go to the documentation of this file.
00001 #ifndef __STDAIR_BOM_FARETIMEPERIOD_HPP
00002 #define __STDAIR_BOM_FARETIMEPERIOD_HPP
00003 
00004 // //////////////////////////////////////////////////////////////////////
00005 // Import section
00006 // //////////////////////////////////////////////////////////////////////
00007 // STDAIR
00008 #include <stdair/bom/BomAbstract.hpp>
00009 #include <stdair/bom/TimePeriodKey.hpp>
00010 #include <stdair/bom/TimePeriodTypes.hpp>
00011 
00012 // Forward declaration
00013 namespace stdair {
00014 
00018   class TimePeriod : public BomAbstract {
00019     template <typename BOM> friend class FacBom;
00020     friend class FacBomManager;
00021 
00022   public:
00023     // //////////// Type definitions //////////////
00027     typedef TimePeriodKey Key_T;
00028   
00029   public:
00030     // /////////// Display support methods /////////
00031     // /////////// Display support methods /////////
00037     void toStream (std::ostream& ioOut) const {
00038       ioOut << toString();
00039     }
00040     
00046     void fromStream (std::istream& ioIn) {
00047     }
00048 
00052     std::string toString() const;
00053     
00057     const std::string describeKey() const {
00058       return _key.toString();
00059     }
00060 
00061   public:
00062     // ////////// Getters ////////////
00066     const Key_T& getKey() const {
00067       return _key;
00068     }
00069 
00073     BomAbstract* const getParent() const {
00074       return _parent;
00075     }
00076 
00080     const HolderMap_T& getHolderMap() const {
00081       return _holderMap;
00082     }
00083     
00087     const Time_T& getTimeRangeStart() const {
00088       return _key.getTimeRangeStart();
00089     }
00090     
00094     const Time_T& getTimeRangeEnd() const {
00095       return _key.getTimeRangeEnd();
00096     }
00097 
00098   public:
00099     // ////////////// Business methods ///////////////
00104     bool isDepartureTimeValid (const Time_T&) const;
00105 
00106   protected:
00107     // ////////// Constructors and destructors /////////
00111     TimePeriod (const Key_T&);  
00115     virtual ~TimePeriod();
00116 
00117   private:
00121     TimePeriod(); 
00125     TimePeriod (const TimePeriod&);
00126 
00127   protected:
00128     // ///////////// Attributes /////////////
00132     Key_T _key;
00133 
00137     BomAbstract* _parent;
00138 
00142     HolderMap_T _holderMap;
00143 
00144   };
00145 
00146 }
00147 #endif // __STDAIR_BOM_FARETIMEPERIOD_HPP
00148