AirTSP Logo  1.01.0
C++ Simulated Airline Travel Solution Provider Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SegmentPathPeriodKey.hpp
Go to the documentation of this file.
1 #ifndef __AIRTSP_BOM_SEGMENTPATHPERIODKEY_HPP
2 #define __AIRTSP_BOM_SEGMENTPATHPERIODKEY_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <iosfwd>
9 #include <string>
10 // StdAir
11 #include <stdair/stdair_basic_types.hpp>
12 #include <stdair/stdair_date_time_types.hpp>
13 #include <stdair/bom/KeyAbstract.hpp>
14 #include <stdair/bom/PeriodStruct.hpp>
15 // AirTSP
17 
19 namespace boost {
20  namespace serialization {
21  class access;
22  }
23 }
24 
25 namespace AIRTSP {
26 
33  struct SegmentPathPeriodKey : public stdair::KeyAbstract {
35 
36  // /////////// Constructors and destructors ///////////
37  public:
41  SegmentPathPeriodKey (const stdair::PeriodStruct&,
42  const stdair::Duration_T& iBoardingTime,
43  const stdair::Duration_T& iElapsed,
44  const DateOffsetList_T&,
45  const stdair::NbOfAirlines_T&);
46 
51 
56 
61 
62 
63  public:
64  // /////////// Getters //////////
68  const stdair::PeriodStruct& getPeriod() const {
69  return _period;
70  }
71 
76  return _boardingDateOffsetList;
77  }
78 
82  const stdair::NbOfSegments_T getNbOfSegments() const {
83  return _boardingDateOffsetList.size();
84  }
85 
89  const stdair::NbOfAirlines_T& getNbOfAirlines() const {
90  return _nbOfAirlines;
91  }
92 
96  const stdair::Duration_T& getElapsedTime() const {
97  return _elapsed;
98  }
99 
103  const stdair::Duration_T& getBoardingTime() const {
104  return _boardingTime;
105  }
106 
107 
108  public:
109  // /////////// Setters //////////
111  void setPeriod (const stdair::PeriodStruct& iPeriod) {
112  _period = iPeriod;
113  }
114 
116  _boardingDateOffsetList = iList;
117  }
118 
120  void setNbOfAirlines (const stdair::NbOfAirlines_T& iNbOfAirlines) {
121  _nbOfAirlines = iNbOfAirlines;
122  }
123 
125  void setElapsedTime (const stdair::Duration_T& iElapsed) {
126  _elapsed = iElapsed;
127  }
128 
130  void setBoardingTime (const stdair::Duration_T& iBoardingTime) {
131  _boardingTime = iBoardingTime;
132  }
133 
134 
135  public:
136  // /////////// Business methods ////////////
138  const bool isValid () const {
139  return _period.isValid ();
140  }
141 
142 
143  public:
144  // /////////// Display support methods /////////
150  void toStream (std::ostream& ioOut) const;
151 
157  void fromStream (std::istream& ioIn);
158 
168  const std::string toString() const;
169 
170 
171  public:
172  // /////////// (Boost) Serialisation support methods /////////
176  template<class Archive>
177  void serialize (Archive& ar, const unsigned int iFileVersion);
178 
179  private:
184  void serialisationImplementationExport() const;
185  void serialisationImplementationImport();
186 
187 
188  private:
189  // ///////////////// Attributes ///////////////
193  stdair::PeriodStruct _period;
194 
198  stdair::Duration_T _boardingTime;
199 
203  stdair::Duration_T _elapsed;
204 
209  DateOffsetList_T _boardingDateOffsetList;
210 
214  stdair::NbOfAirlines_T _nbOfAirlines;
215  };
216 
217 }
218 #endif // __AIRTSP_BOM_SEGMENTPATHPERIODKEY_HPP