StdAir Logo  1.00.10
C++ Standard Airline IT Object Library
SegmentDate.hpp
Go to the documentation of this file.
1 #ifndef __STDAIR_BOM_SEGMENTDATE_HPP
2 #define __STDAIR_BOM_SEGMENTDATE_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <iosfwd>
9 #include <string>
10 // StdAir
15 
17 namespace boost {
18  namespace serialization {
19  class access;
20  }
21  namespace archive {
22  namespace detail {
23  template <class T>
24  struct heap_allocation;
25  }
26  }
27 }
28 
29 namespace stdair {
30 
32  struct SegmentCabinKey;
33  class SegmentCabin;
34 
35  // Define the routing leg keys list type.
36  typedef std::list<std::string> RoutingLegKeyList_T;
37 
42  class SegmentDate : public BomAbstract {
43  template <typename BOM> friend class FacBom;
44  template <typename BOM> friend class FacCloneBom;
45  friend class FacBomManager;
47  template <class T> friend struct boost::archive::detail::heap_allocation;
48 
49  public:
50  // ////////// Type definitions ////////////
55 
56 
57  public:
58  // /////////// Getters /////////////
62  const Key_T& getKey() const {
63  return _key;
64  }
65 
69  BomAbstract* const getParent() const {
70  return _parent;
71  }
72 
77  return _key.getBoardingPoint();
78  }
79 
83  const AirportCode_T& getOffPoint() const {
84  return _key.getOffPoint();
85  }
86 
90  const HolderMap_T& getHolderMap() const {
91  return _holderMap;
92  }
93 
97  const Date_T& getBoardingDate() const {
98  return _boardingDate;
99  }
100 
104  const Duration_T& getBoardingTime() const {
105  return _boardingTime;
106  }
107 
111  const Date_T& getOffDate() const {
112  return _offDate;
113  }
114 
118  const Duration_T& getOffTime() const {
119  return _offTime;
120  }
121 
125  const Duration_T& getElapsedTime() const {
126  return _elapsedTime;
127  }
128 
132  const Distance_T& getDistance() const {
133  return _distance;
134  }
135 
139  const DateOffset_T getDateOffset() const {
140  return _offDate - _boardingDate;
141  }
142 
151  const Duration_T getTimeOffset() const;
152 
157  return _operatingSegmentDate;
158  }
159 
165  }
166 
171  return _routingLegKeyList;
172  }
173 
174  public:
175  // ///////// Setters //////////
179  void setBoardingDate (const Date_T& iBoardingDate) {
180  _boardingDate = iBoardingDate;
181  }
182 
186  void setBoardingTime (const Duration_T& iBoardingTime) {
187  _boardingTime = iBoardingTime;
188  }
189 
193  void setOffDate (const Date_T& iOffDate) {
194  _offDate = iOffDate;
195  }
196 
200  void setOffTime (const Duration_T& iOffTime) {
201  _offTime = iOffTime;
202  }
203 
207  void setElapsedTime (const Duration_T& iElapsedTime) {
208  _elapsedTime = iElapsedTime;
209  }
210 
214  void setDistance (const Distance_T& iDistance) {
215  _distance = iDistance;
216  }
217 
221  void addLegKey (const std::string& iLegKey) {
222  _routingLegKeyList.push_back(iLegKey);
223  }
224 
225  private:
229  void linkWithOperating (SegmentDate& iSegmentDate) {
230  _operatingSegmentDate = &iSegmentDate;
231  }
232 
233  public:
234  // /////////// Display support methods /////////
240  void toStream (std::ostream& ioOut) const {
241  ioOut << toString();
242  }
243 
249  void fromStream (std::istream& ioIn) {
250  }
251 
255  std::string toString() const;
256 
260  const std::string describeKey() const {
261  return _key.toString();
262  }
263 
264 
265  public:
266  // /////////// (Boost) Serialisation support methods /////////
270  template<class Archive>
271  void serialize (Archive& ar, const unsigned int iFileVersion);
272 
273  private:
281  void serialisationImplementationExport() const;
282  void serialisationImplementationImport();
283 
284 
285  protected:
286  // ////////// Constructors and destructors /////////
290  SegmentDate (const Key_T&);
291 
295  virtual ~SegmentDate();
296 
297  private:
301  SegmentDate();
302 
306  SegmentDate (const SegmentDate&);
307 
308 
309  protected:
310  // ////////// Attributes /////////
315 
320 
325 
333 
341 
346 
351 
356 
361 
366 
371 
376  };
377 
378 }
379 #endif // __STDAIR_BOM_SEGMENTDATE_HPP
380 
stdair::FacCloneBom
Base class for Factory layer.
Definition: FacCloneBom.hpp:22
stdair::SegmentDateKey
Key of a given segment-date, made of an origin and a destination airports.
Definition: SegmentDateKey.hpp:24
stdair::SegmentDate::getOffDate
const Date_T & getOffDate() const
Definition: SegmentDate.hpp:111
stdair::FacBom
Base class for Factory layer.
Definition: FacBom.hpp:22
stdair::SegmentDate::serialize
void serialize(Archive &ar, const unsigned int iFileVersion)
Definition: CmdBomSerialiser.cpp:208
stdair::SegmentDate::_marketingSegmentDateList
SegmentDateList_T _marketingSegmentDateList
Definition: SegmentDate.hpp:340
stdair::SegmentDate::Key_T
SegmentDateKey Key_T
Definition: SegmentDate.hpp:54
stdair::SegmentDate::_holderMap
HolderMap_T _holderMap
Definition: SegmentDate.hpp:324
stdair::SegmentDate::getMarketingSegmentDateList
const SegmentDateList_T & getMarketingSegmentDateList() const
Definition: SegmentDate.hpp:163
stdair::SegmentDate::setBoardingTime
void setBoardingTime(const Duration_T &iBoardingTime)
Definition: SegmentDate.hpp:186
stdair::SegmentDate::fromStream
void fromStream(std::istream &ioIn)
Definition: SegmentDate.hpp:249
stdair::SegmentDate::_boardingTime
Duration_T _boardingTime
Definition: SegmentDate.hpp:350
stdair::SegmentDateKey::toString
const std::string toString() const
Definition: SegmentDateKey.cpp:49
stdair_inventory_types.hpp
stdair::SegmentDate::setDistance
void setDistance(const Distance_T &iDistance)
Definition: SegmentDate.hpp:214
stdair::RoutingLegKeyList_T
std::list< std::string > RoutingLegKeyList_T
Definition: SegmentDate.hpp:33
stdair::SegmentDate::setBoardingDate
void setBoardingDate(const Date_T &iBoardingDate)
Definition: SegmentDate.hpp:179
stdair::SegmentDate::getOperatingSegmentDate
SegmentDate * getOperatingSegmentDate() const
Definition: SegmentDate.hpp:156
stdair::SegmentDate::getDistance
const Distance_T & getDistance() const
Definition: SegmentDate.hpp:132
stdair::SegmentDate::_parent
BomAbstract * _parent
Definition: SegmentDate.hpp:319
stdair::SegmentDate::getDateOffset
const DateOffset_T getDateOffset() const
Definition: SegmentDate.hpp:139
stdair::SegmentDate::addLegKey
void addLegKey(const std::string &iLegKey)
Definition: SegmentDate.hpp:221
stdair::SegmentDate::_offDate
Date_T _offDate
Definition: SegmentDate.hpp:355
stdair::SegmentDate::_operatingSegmentDate
SegmentDate * _operatingSegmentDate
Definition: SegmentDate.hpp:332
stdair::AirportCode_T
LocationCode_T AirportCode_T
Definition: stdair_basic_types.hpp:22
stdair::SegmentDate::setElapsedTime
void setElapsedTime(const Duration_T &iElapsedTime)
Definition: SegmentDate.hpp:207
stdair::SegmentDate::_offTime
Duration_T _offTime
Definition: SegmentDate.hpp:360
stdair
Handle on the StdAir library context.
Definition: BasChronometer.cpp:9
stdair::SegmentDate::setOffTime
void setOffTime(const Duration_T &iOffTime)
Definition: SegmentDate.hpp:200
stdair::HolderMap_T
std::map< const std::type_info *, BomAbstract * > HolderMap_T
Definition: BomAbstract.hpp:63
stdair::SegmentDate::_distance
Distance_T _distance
Definition: SegmentDate.hpp:370
stdair::SegmentDate::getElapsedTime
const Duration_T & getElapsedTime() const
Definition: SegmentDate.hpp:125
stdair::BomAbstract
Base class for the Business Object Model (BOM) layer.
Definition: BomAbstract.hpp:24
stdair::SegmentDate::describeKey
const std::string describeKey() const
Definition: SegmentDate.hpp:260
stdair::Distance_T
unsigned long int Distance_T
Definition: stdair_basic_types.hpp:19
stdair::SegmentDate::getKey
const Key_T & getKey() const
Definition: SegmentDate.hpp:62
stdair::SegmentDateList_T
std::list< SegmentDate * > SegmentDateList_T
Definition: SegmentDateTypes.hpp:17
stdair::SegmentDate::toString
std::string toString() const
Definition: SegmentDate.cpp:48
stdair::SegmentDateKey::getOffPoint
const AirportCode_T & getOffPoint() const
Definition: SegmentDateKey.hpp:56
BomAbstract.hpp
stdair::SegmentDate::getLegKeyList
const RoutingLegKeyList_T & getLegKeyList() const
Definition: SegmentDate.hpp:170
SegmentDateKey.hpp
stdair::SegmentDate::getTimeOffset
const Duration_T getTimeOffset() const
Definition: SegmentDate.cpp:55
stdair::DateOffset_T
boost::gregorian::date_duration DateOffset_T
Definition: stdair_date_time_types.hpp:35
stdair::SegmentDate::_boardingDate
Date_T _boardingDate
Definition: SegmentDate.hpp:345
boost
Forward declarations.
Definition: AirlineClassList.hpp:16
stdair::SegmentDate::_elapsedTime
Duration_T _elapsedTime
Definition: SegmentDate.hpp:365
stdair::SegmentDate::_key
Key_T _key
Definition: SegmentDate.hpp:314
stdair::SegmentDate::getOffPoint
const AirportCode_T & getOffPoint() const
Definition: SegmentDate.hpp:83
stdair::SegmentDate::_routingLegKeyList
RoutingLegKeyList_T _routingLegKeyList
Definition: SegmentDate.hpp:375
stdair::SegmentDate::getHolderMap
const HolderMap_T & getHolderMap() const
Definition: SegmentDate.hpp:90
stdair::SegmentDate::toStream
void toStream(std::ostream &ioOut) const
Definition: SegmentDate.hpp:240
stdair::SegmentDate::getParent
BomAbstract *const getParent() const
Definition: SegmentDate.hpp:69
stdair::SegmentDate::getOffTime
const Duration_T & getOffTime() const
Definition: SegmentDate.hpp:118
stdair::SegmentDate::~SegmentDate
virtual ~SegmentDate()
Definition: SegmentDate.cpp:44
stdair::SegmentDate::setOffDate
void setOffDate(const Date_T &iOffDate)
Definition: SegmentDate.hpp:193
stdair::Duration_T
boost::posix_time::time_duration Duration_T
Definition: stdair_date_time_types.hpp:17
SegmentDateTypes.hpp
stdair::SegmentDate::getBoardingDate
const Date_T & getBoardingDate() const
Definition: SegmentDate.hpp:97
stdair::SegmentDate::getBoardingTime
const Duration_T & getBoardingTime() const
Definition: SegmentDate.hpp:104
stdair::SegmentDateKey::getBoardingPoint
const AirportCode_T & getBoardingPoint() const
Definition: SegmentDateKey.hpp:51
stdair::FacBomManager
Utility class for linking StdAir-based objects.
Definition: FacBomManager.hpp:30
stdair::SegmentDate
Class representing the actual attributes for an airline segment-date.
Definition: SegmentDate.hpp:42
stdair::SegmentDate::access
friend class boost::serialization::access
Definition: SegmentDate.hpp:46
boost::archive::detail::heap_allocation
Definition: FlightDate.hpp:24
stdair::Date_T
boost::gregorian::date Date_T
Definition: stdair_date_time_types.hpp:20
stdair::SegmentDate::getBoardingPoint
const AirportCode_T & getBoardingPoint() const
Definition: SegmentDate.hpp:76