StdAir Logo  0.43.0
C++ Standard Airline IT Library
SegmentPeriod.hpp
Go to the documentation of this file.
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     friend class FacBomManager;
00018 
00019   public:
00020     // Type definitions.
00022     typedef SegmentPeriodKey Key_T;
00023 
00024   public:
00025     // /////////// Getters /////////////
00027     const Key_T& getKey() const { return _key; }
00028 
00030     BomAbstract* const getParent() const { return _parent; }
00031     
00033     const AirportCode_T& getBoardingPoint () const {
00034       return _key.getBoardingPoint();
00035     }
00036 
00038     const AirportCode_T& getOffPoint () const { return _key.getOffPoint(); }
00039 
00041     const Duration_T& getBoardingTime () const { return _boardingTime; }
00042 
00044     const Duration_T& getOffTime () const { return _offTime; }
00045 
00047     const DateOffset_T& getBoardingDateOffset () const {
00048       return _boardingDateOffset;
00049     }
00050 
00052     const DateOffset_T& getOffDateOffset () const { return _offDateOffset; }
00053     
00055     const Duration_T& getElapsedTime() const { return _elapsedTime; }
00056 
00058     const CabinBookingClassMap_T& getCabinBookingClassMap () const {
00059       return _cabinBookingClassMap;
00060     }
00061 
00063     const HolderMap_T& getHolderMap() const { return _holderMap; }
00064 
00065   public:
00066     // ///////// Setters //////////
00068     void setBoardingTime (const Duration_T& iBoardingTime) {
00069       _boardingTime = iBoardingTime;
00070     }
00071 
00073     void setOffTime (const Duration_T& iOffTime) { _offTime = iOffTime; }
00074 
00076     void setBoardingDateOffset (const DateOffset_T& iDateOffset) {
00077       _boardingDateOffset = iDateOffset;
00078     }
00079 
00081     void setOffDateOffset (const DateOffset_T& iDateOffset) {
00082       _offDateOffset = iDateOffset;
00083     }
00084 
00086     void setElapsedTime (const Duration_T& iElapsedTime) {
00087       _elapsedTime = iElapsedTime;
00088     }
00089 
00092     void addCabinBookingClassList (const CabinCode_T&, 
00093                                    const ClassList_String_T&);
00094     
00095   public:
00096     // /////////// Display support methods /////////
00099     void toStream (std::ostream& ioOut) const { ioOut << toString(); }
00100 
00103     void fromStream (std::istream& ioIn) { }
00104 
00106     std::string toString() const;
00107     
00109     const std::string describeKey() const { return _key.toString(); }
00110     
00111   protected:
00113     SegmentPeriod (const Key_T&);
00114     SegmentPeriod (const SegmentPeriod&);
00116     ~SegmentPeriod();
00117 
00118   protected:
00119     // Attributes
00120     Key_T _key;
00121     BomAbstract* _parent;
00122     Duration_T _boardingTime;
00123     Duration_T _offTime;
00124     DateOffset_T _boardingDateOffset;
00125     DateOffset_T _offDateOffset;
00126     Duration_T _elapsedTime;
00127     CabinBookingClassMap_T _cabinBookingClassMap;
00128     HolderMap_T _holderMap;
00129   };
00130 
00131 }
00132 #endif // __STDAIR_BOM_SEGMENTPERIOD_HPP
00133