AirTSP Logo  1.01.11
C++ Simulated Airline Travel Solution Provider (TSP) Library
Loading...
Searching...
No Matches
SegmentPathPeriod.hpp
Go to the documentation of this file.
1#ifndef __AIRTSP_BOM_SEGMENTPATHPERIOD_HPP
2#define __AIRTSP_BOM_SEGMENTPATHPERIOD_HPP
3
4// //////////////////////////////////////////////////////////////////////
5// Import section
6// //////////////////////////////////////////////////////////////////////
7// STL
8#include <iosfwd>
9#include <string>
10// StdAir
11#include <stdair/bom/BomAbstract.hpp>
12// AirTSP
15
17namespace boost {
18 namespace serialization {
19 class access;
20 }
21}
22
24namespace stdair {
25 template <typename BOM> class FacBom;
26 class FacBomManager;
27 class SegmentPeriod;
28}
29
30namespace AIRTSP {
31
39 class SegmentPathPeriod : public stdair::BomAbstract {
43 template <typename BOM> friend class stdair::FacBom;
46
47 public:
48 // ////////// Type definitions ////////////
53
54
55 public:
56 // /////////// Getters /////////////
60 const Key_T& getKey() const {
61 return _key;
62 }
63
67 stdair::BomAbstract* const getParent() const {
68 return _parent;
69 }
70
72 const stdair::PeriodStruct& getDeparturePeriod() const {
73 return _key.getPeriod();
74 }
75
78 return _key.getBoardingDateOffsetList();
79 }
80
82 const stdair::NbOfSegments_T getNbOfSegments() const {
83 return _key.getNbOfSegments();
84 }
85
87 const stdair::NbOfAirlines_T& getNbOfAirlines() const {
88 return _key.getNbOfAirlines();
89 }
90
92 const stdair::Duration_T& getElapsedTime() const {
93 return _key.getElapsedTime();
94 }
95
97 const stdair::Duration_T& getBoardingTime() const {
98 return _key.getBoardingTime();
99 }
100
104 const stdair::HolderMap_T& getHolderMap() const {
105 return _holderMap;
106 }
107
113 stdair::SegmentPeriod* getLastSegmentPeriod() const;
114
120 stdair::SegmentPeriod* getFirstSegmentPeriod() const;
121
126 const stdair::AirportCode_T& getDestination() const;
127
128
129 public:
130 // ////////////// Business methods ////////////////
149
155 bool checkCircle (const stdair::AirportCode_T&) const;
156
161 bool isAirlineFlown (const stdair::AirlineCode_T&) const;
162
167 bool isDepartureDateValid (const stdair::Date_T&) const;
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:
214 void serialisationImplementationExport() const;
215 void serialisationImplementationImport();
216
217
218 protected:
219 // ////////// Constructors and destructors /////////
223 SegmentPathPeriod (const Key_T&);
224
229
230 private:
235
240
241
242 protected:
243 // ////////// Attributes /////////
250
254 stdair::BomAbstract* _parent;
255
262 stdair::HolderMap_T _holderMap;
263 };
264
265}
266#endif // __AIRTSP_BOM_SEGMENTPATHPERIOD_HPP
267
Class representing a segment/path.
bool checkCircle(const stdair::AirportCode_T &) const
const stdair::PeriodStruct & getDeparturePeriod() const
const DateOffsetList_T & getBoardingDateOffsetList() const
stdair::BomAbstract *const getParent() const
const stdair::AirportCode_T & getDestination() const
stdair::SegmentPeriod * getLastSegmentPeriod() const
const stdair::HolderMap_T & getHolderMap() const
stdair::SegmentPeriod * getFirstSegmentPeriod() const
const stdair::NbOfAirlines_T & getNbOfAirlines() const
const stdair::Duration_T & getElapsedTime() const
void serialize(Archive &ar, const unsigned int iFileVersion)
const Key_T & getKey() const
Key_T connectWithAnotherSegment(const SegmentPathPeriod &) const
bool isDepartureDateValid(const stdair::Date_T &) const
const stdair::NbOfSegments_T getNbOfSegments() const
bool isAirlineFlown(const stdair::AirlineCode_T &) const
const stdair::Duration_T & getBoardingTime() const
void toStream(std::ostream &ioOut) const
void fromStream(std::istream &ioIn)
friend class boost::serialization::access
friend class stdair::FacBomManager
stdair::BomAbstract * _parent
const std::string describeKey() const
std::vector< stdair::DateOffset_T > DateOffsetList_T
Forward declarations.
Forward declarations.
Structure representing the key of a segment/path.