StdAir Logo  1.00.0
C++ Standard Airline IT Object Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LegDate.hpp
Go to the documentation of this file.
1 #ifndef __STDAIR_BOM_LEGDATE_HPP
2 #define __STDAIR_BOM_LEGDATE_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <iosfwd>
9 #include <string>
10 // StdAir
15 
16 namespace stdair {
17 
19  struct LegCabinKey;
20  class LegCabin;
21 
25  class LegDate : public BomAbstract {
26  template <typename BOM> friend class FacBom;
27  template <typename BOM> friend class FacCloneBom;
28  friend class FacBomManager;
29 
30  public:
31  // ////////// Type definitions ////////////
33  typedef LegDateKey Key_T;
34 
35 
36  public:
37  // /////////// Getters /////////////
39  const Key_T& getKey() const {
40  return _key;
41  }
42 
44  BomAbstract* const getParent() const {
45  return _parent;
46  }
47 
50  return _key.getBoardingPoint();
51  }
52 
60  const AirlineCode_T& getAirlineCode() const;
61 
65  const HolderMap_T& getHolderMap() const {
66  return _holderMap;
67  }
68 
79  LegCabin* getLegCabin (const std::string& iLegCabinKeyStr) const;
80 
91  LegCabin* getLegCabin (const LegCabinKey&) const;
92 
94  const AirportCode_T& getOffPoint() const {
95  return _offPoint;
96  }
97 
99  const Date_T& getBoardingDate() const {
100  return _boardingDate;
101  }
102 
104  const Duration_T& getBoardingTime() const {
105  return _boardingTime;
106  }
107 
109  const Date_T& getOffDate() const {
110  return _offDate;
111  }
112 
114  const Duration_T& getOffTime() const {
115  return _offTime;
116  }
117 
119  const Duration_T& getElapsedTime() const {
120  return _elapsedTime;
121  }
122 
124  const Distance_T& getDistance() const {
125  return _distance;
126  }
127 
129  const CabinCapacity_T& getCapacity() const {
130  return _capacity;
131  }
132 
134  const DateOffset_T getDateOffset() const {
135  return _offDate - _boardingDate;
136  }
137 
142  const Duration_T getTimeOffset() const;
143 
144 
145  public:
146  // ///////// Setters //////////
148  void setOffPoint (const AirportCode_T& iOffPoint) {
149  _offPoint = iOffPoint;
150  }
151 
153  void setBoardingDate (const Date_T& iBoardingDate) {
154  _boardingDate = iBoardingDate;
155  }
156 
158  void setBoardingTime (const Duration_T& iBoardingTime) {
159  _boardingTime = iBoardingTime;
160  }
161 
163  void setOffDate (const Date_T& iOffDate) {
164  _offDate = iOffDate;
165  }
166 
168  void setOffTime (const Duration_T& iOffTime) {
169  _offTime = iOffTime;
170  }
171 
173  void setElapsedTime (const Duration_T&);
174 
176  void setOperatingAirlineCode (const AirlineCode_T& iAirlineCode) {
177  _operatingAirlineCode = iAirlineCode;
178  }
179 
181  void setOperatingFlightNumber (const FlightNumber_T& iFlightNumber) {
182  _operatingFlightNumber = iFlightNumber;
183  }
184 
185  private:
187  void updateDistanceFromElapsedTime();
188 
189 
190  public:
191  // /////////// Display support methods /////////
194  void toStream (std::ostream& ioOut) const {
195  ioOut << toString();
196  }
197 
200  void fromStream (std::istream& ioIn) {
201  }
202 
204  std::string toString() const;
205 
207  const std::string describeKey() const {
208  return _key.toString();
209  }
210 
212  const std::string describeRoutingKey() const;
213 
214  protected:
215  // ////////// Constructors and destructors /////////
217  LegDate (const Key_T&);
219  virtual ~LegDate();
220 
221  private:
223  LegDate();
225  LegDate (const LegDate&);
226 
227 
228  protected:
229  // ////////// Attributes /////////
232 
235 
238 
241 
244 
247 
250 
253 
256 
259 
262 
265 
268  };
269 
270 }
271 #endif // __STDAIR_BOM_LEGDATE_HPP
272