StdAir Logo  1.00.16
C++ Standard Airline IT Object Library
Loading...
Searching...
No Matches
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
17namespace 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
29namespace 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
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
140 return _offDate - _boardingDate;
141 }
142
151 const Duration_T getTimeOffset() const;
152
159
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
Handle on the StdAir library context.
boost::gregorian::date Date_T
boost::gregorian::date_duration DateOffset_T
unsigned long int Distance_T
std::list< SegmentDate * > SegmentDateList_T
std::list< std::string > RoutingLegKeyList_T
std::map< const std::type_info *, BomAbstract * > HolderMap_T
boost::posix_time::time_duration Duration_T
LocationCode_T AirportCode_T
Forward declarations.
Class representing the actual attributes for an airline segment-cabin.
Key of a given segment-cabin, made of a cabin code (only).
Class representing the actual attributes for an airline segment-date.
BomAbstract *const getParent() const
const SegmentDateList_T & getMarketingSegmentDateList() const
const Key_T & getKey() const
SegmentDate * _operatingSegmentDate
const Distance_T & getDistance() const
void setOffDate(const Date_T &iOffDate)
void setBoardingTime(const Duration_T &iBoardingTime)
const std::string describeKey() const
void serialize(Archive &ar, const unsigned int iFileVersion)
void addLegKey(const std::string &iLegKey)
BomAbstract * _parent
void toStream(std::ostream &ioOut) const
const Duration_T & getElapsedTime() const
const Date_T & getOffDate() const
void setBoardingDate(const Date_T &iBoardingDate)
const AirportCode_T & getOffPoint() const
const RoutingLegKeyList_T & getLegKeyList() const
void setOffTime(const Duration_T &iOffTime)
const Duration_T & getBoardingTime() const
const Duration_T & getOffTime() const
const HolderMap_T & getHolderMap() const
SegmentDate(const Key_T &)
void setElapsedTime(const Duration_T &iElapsedTime)
const Duration_T getTimeOffset() const
SegmentDateList_T _marketingSegmentDateList
const AirportCode_T & getBoardingPoint() const
const Date_T & getBoardingDate() const
SegmentDate * getOperatingSegmentDate() const
friend class FacBom
void setDistance(const Distance_T &iDistance)
const DateOffset_T getDateOffset() const
friend class FacCloneBom
friend class boost::serialization::access
friend class FacBomManager
RoutingLegKeyList_T _routingLegKeyList
std::string toString() const
SegmentDateKey Key_T
void fromStream(std::istream &ioIn)
Key of a given segment-date, made of an origin and a destination airports.