StdAir Logo  0.45.1
C++ Standard Airline IT Object Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 }
22 
23 namespace stdair {
24 
26  struct SegmentCabinKey;
27  class SegmentCabin;
28 
33  class SegmentDate : public BomAbstract {
34  template <typename BOM> friend class FacBom;
35  friend class FacBomManager;
37 
38  public:
39  // ////////// Type definitions ////////////
44 
45 
46  public:
47  // /////////// Getters /////////////
49  const Key_T& getKey() const {
50  return _key;
51  }
52 
54  BomAbstract* const getParent() const {
55  return _parent;
56  }
57 
60  return _key.getBoardingPoint();
61  }
62 
64  const AirportCode_T& getOffPoint() const {
65  return _key.getOffPoint();
66  }
67 
69  const HolderMap_T& getHolderMap() const {
70  return _holderMap;
71  }
72 
74  const Date_T& getBoardingDate() const {
75  return _boardingDate;
76  }
77 
79  const Duration_T& getBoardingTime() const {
80  return _boardingTime;
81  }
82 
84  const Date_T& getOffDate() const {
85  return _offDate;
86  }
87 
89  const Duration_T& getOffTime() const {
90  return _offTime;
91  }
92 
94  const Duration_T& getElapsedTime() const {
95  return _elapsedTime;
96  }
97 
99  const Distance_T& getDistance() const {
100  return _distance;
101  }
102 
104  const DateOffset_T getDateOffset() const {
105  return _offDate - _boardingDate;
106  }
107 
116  const Duration_T getTimeOffset() const;
117 
122  return _operatingSegmentDate;
123  }
124 
130  }
131 
132  public:
133  // ///////// Setters //////////
135  void setBoardingDate (const Date_T& iBoardingDate) {
136  _boardingDate = iBoardingDate;
137  }
138 
140  void setBoardingTime (const Duration_T& iBoardingTime) {
141  _boardingTime = iBoardingTime;
142  }
143 
145  void setOffDate (const Date_T& iOffDate) {
146  _offDate = iOffDate;
147  }
148 
150  void setOffTime (const Duration_T& iOffTime) {
151  _offTime = iOffTime;
152  }
153 
155  void setElapsedTime (const Duration_T& iElapsedTime) {
156  _elapsedTime = iElapsedTime;
157  }
158 
160  void setDistance (const Distance_T& iDistance) {
161  _distance = iDistance;
162  }
163 
165  void linkWithOperating (SegmentDate& iSegmentDate) {
166  _operatingSegmentDate = &iSegmentDate;
167  }
168 
169  public:
170  // /////////// Display support methods /////////
176  void toStream (std::ostream& ioOut) const {
177  ioOut << toString();
178  }
179 
185  void fromStream (std::istream& ioIn) {
186  }
187 
191  std::string toString() const;
192 
196  const std::string describeKey() const {
197  return _key.toString();
198  }
199 
200 
201  public:
202  // /////////// (Boost) Serialisation support methods /////////
206  template<class Archive>
207  void serialize (Archive& ar, const unsigned int iFileVersion);
208 
209  private:
217  void serialisationImplementationExport() const;
218  void serialisationImplementationImport();
219 
220 
221  protected:
222  // ////////// Constructors and destructors /////////
226  SegmentDate (const Key_T&);
227 
231  virtual ~SegmentDate();
232 
233  private:
237  SegmentDate();
238 
242  SegmentDate (const SegmentDate&);
243 
244 
245  protected:
246  // ////////// Attributes /////////
251 
256 
261 
269 
277 
282 
287 
292 
297 
302 
307  };
308 
309 }
310 #endif // __STDAIR_BOM_SEGMENTDATE_HPP
311