StdAir Logo  1.00.3
C++ Standard Airline IT Object Library
TimePeriod.hpp
Go to the documentation of this file.
1 #ifndef __STDAIR_BOM_FARETIMEPERIOD_HPP
2 #define __STDAIR_BOM_FARETIMEPERIOD_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STDAIR
11 
12 // Forward declaration
13 namespace stdair {
14 
18  class TimePeriod : public BomAbstract {
19  template <typename BOM> friend class FacBom;
20  template <typename BOM> friend class FacCloneBom;
21  friend class FacBomManager;
22 
23  public:
24  // //////////// Type definitions //////////////
29 
30  public:
31  // /////////// Display support methods /////////
32  // /////////// Display support methods /////////
38  void toStream (std::ostream& ioOut) const {
39  ioOut << toString();
40  }
41 
47  void fromStream (std::istream& ioIn) {
48  }
49 
53  std::string toString() const;
54 
58  const std::string describeKey() const {
59  return _key.toString();
60  }
61 
62  public:
63  // ////////// Getters ////////////
67  const Key_T& getKey() const {
68  return _key;
69  }
70 
74  BomAbstract* const getParent() const {
75  return _parent;
76  }
77 
81  const HolderMap_T& getHolderMap() const {
82  return _holderMap;
83  }
84 
88  const Time_T& getTimeRangeStart() const {
89  return _key.getTimeRangeStart();
90  }
91 
95  const Time_T& getTimeRangeEnd() const {
96  return _key.getTimeRangeEnd();
97  }
98 
99  public:
100  // ////////////// Business methods ///////////////
105  bool isDepartureTimeValid (const Time_T&) const;
106 
107  protected:
108  // ////////// Constructors and destructors /////////
112  TimePeriod (const Key_T&);
116  virtual ~TimePeriod();
117 
118  private:
122  TimePeriod();
126  TimePeriod (const TimePeriod&);
127 
128  protected:
129  // ///////////// Attributes /////////////
133  Key_T _key;
134 
139 
144 
145  };
146 
147 }
148 #endif // __STDAIR_BOM_FARETIMEPERIOD_HPP
149 
const Time_T & getTimeRangeStart() const
Definition: TimePeriod.hpp:88
Utility class for linking StdAir-based objects.
HolderMap_T _holderMap
Definition: TimePeriod.hpp:143
std::string toString() const
Definition: TimePeriod.cpp:36
Handle on the StdAir library context.
std::map< const std::type_info *, BomAbstract * > HolderMap_T
Definition: BomAbstract.hpp:63
Base class for the Business Object Model (BOM) layer.
Definition: BomAbstract.hpp:24
void fromStream(std::istream &ioIn)
Definition: TimePeriod.hpp:47
boost::posix_time::time_duration Time_T
void toStream(std::ostream &ioOut) const
Definition: TimePeriod.hpp:38
virtual ~TimePeriod()
Definition: TimePeriod.cpp:32
const Time_T & getTimeRangeEnd() const
Definition: TimePeriod.hpp:95
const std::string toString() const
const HolderMap_T & getHolderMap() const
Definition: TimePeriod.hpp:81
Base class for Factory layer.
Definition: FacBom.hpp:22
BomAbstract *const getParent() const
Definition: TimePeriod.hpp:74
const Key_T & getKey() const
Definition: TimePeriod.hpp:67
BomAbstract * _parent
Definition: TimePeriod.hpp:138
Key of time-period.
const Time_T & getTimeRangeStart() const
bool isDepartureTimeValid(const Time_T &) const
Definition: TimePeriod.cpp:44
Base class for Factory layer.
Definition: FacCloneBom.hpp:22
const std::string describeKey() const
Definition: TimePeriod.hpp:58
const Time_T & getTimeRangeEnd() const
TimePeriodKey Key_T
Definition: TimePeriod.hpp:28
Class representing the actual attributes for a fare time-period.
Definition: TimePeriod.hpp:18