$treeview $search $mathjax
00001 #ifndef __STDAIR_BOM_SEGMENTPERIOD_HPP 00002 #define __STDAIR_BOM_SEGMENTPERIOD_HPP 00003 00004 // ////////////////////////////////////////////////////////////////////// 00005 // Import section 00006 // ////////////////////////////////////////////////////////////////////// 00007 // STDAIR 00008 #include <stdair/bom/BomAbstract.hpp> 00009 #include <stdair/bom/SegmentPeriodKey.hpp> 00010 #include <stdair/bom/SegmentPeriodTypes.hpp> 00011 00012 namespace stdair { 00013 00015 class SegmentPeriod : public BomAbstract { 00016 template <typename BOM> friend class FacBom; 00017 template <typename BOM> friend class FacCloneBom; 00018 friend class FacBomManager; 00019 00020 public: 00021 // Type definitions. 00023 typedef SegmentPeriodKey Key_T; 00024 00025 public: 00026 // /////////// Getters ///////////// 00028 const Key_T& getKey() const { return _key; } 00029 00031 BomAbstract* const getParent() const { return _parent; } 00032 00034 const AirportCode_T& getBoardingPoint () const { 00035 return _key.getBoardingPoint(); 00036 } 00037 00039 const AirportCode_T& getOffPoint () const { return _key.getOffPoint(); } 00040 00042 const Duration_T& getBoardingTime () const { return _boardingTime; } 00043 00045 const Duration_T& getOffTime () const { return _offTime; } 00046 00048 const DateOffset_T& getBoardingDateOffset () const { 00049 return _boardingDateOffset; 00050 } 00051 00053 const DateOffset_T& getOffDateOffset () const { return _offDateOffset; } 00054 00056 const Duration_T& getElapsedTime() const { return _elapsedTime; } 00057 00059 const CabinBookingClassMap_T& getCabinBookingClassMap () const { 00060 return _cabinBookingClassMap; 00061 } 00062 00064 const HolderMap_T& getHolderMap() const { return _holderMap; } 00065 00066 public: 00067 // ///////// Setters ////////// 00069 void setBoardingTime (const Duration_T& iBoardingTime) { 00070 _boardingTime = iBoardingTime; 00071 } 00072 00074 void setOffTime (const Duration_T& iOffTime) { _offTime = iOffTime; } 00075 00077 void setBoardingDateOffset (const DateOffset_T& iDateOffset) { 00078 _boardingDateOffset = iDateOffset; 00079 } 00080 00082 void setOffDateOffset (const DateOffset_T& iDateOffset) { 00083 _offDateOffset = iDateOffset; 00084 } 00085 00087 void setElapsedTime (const Duration_T& iElapsedTime) { 00088 _elapsedTime = iElapsedTime; 00089 } 00090 00093 void addCabinBookingClassList (const CabinCode_T&, 00094 const ClassList_String_T&); 00095 00096 public: 00097 // /////////// Display support methods ///////// 00100 void toStream (std::ostream& ioOut) const { ioOut << toString(); } 00101 00104 void fromStream (std::istream& ioIn) { } 00105 00107 std::string toString() const; 00108 00110 const std::string describeKey() const { return _key.toString(); } 00111 00112 protected: 00113 // ////////// Constructors and destructors ///////// 00117 SegmentPeriod (const Key_T&); 00121 virtual ~SegmentPeriod(); 00122 00123 private: 00127 SegmentPeriod(); 00131 SegmentPeriod (const SegmentPeriod&); 00132 00133 protected: 00134 // Attributes 00135 Key_T _key; 00136 BomAbstract* _parent; 00137 Duration_T _boardingTime; 00138 Duration_T _offTime; 00139 DateOffset_T _boardingDateOffset; 00140 DateOffset_T _offDateOffset; 00141 Duration_T _elapsedTime; 00142 CabinBookingClassMap_T _cabinBookingClassMap; 00143 HolderMap_T _holderMap; 00144 }; 00145 00146 } 00147 #endif // __STDAIR_BOM_SEGMENTPERIOD_HPP 00148