AirTSP Logo  1.01.2
C++ Simulated Airline Travel Solution Provider (TSP) Library
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 
17 namespace boost {
18  namespace serialization {
19  class access;
20  }
21 }
22 
24 namespace stdair {
25  template <typename BOM> class FacBom;
26  class FacBomManager;
27  class SegmentPeriod;
28 }
29 
30 namespace AIRTSP {
31 
39  class SegmentPathPeriod : public stdair::BomAbstract {
43  template <typename BOM> friend class stdair::FacBom;
44  friend class stdair::FacBomManager;
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 
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 ////////////////
148  Key_T connectWithAnotherSegment (const SegmentPathPeriod&) const;
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 /////////
249  Key_T _key;
250 
254  stdair::BomAbstract* _parent;
255 
262  stdair::HolderMap_T _holderMap;
263  };
264 
265 }
266 #endif // __AIRTSP_BOM_SEGMENTPATHPERIOD_HPP
267 
stdair::SegmentPeriod * getFirstSegmentPeriod() const
stdair::BomAbstract *const getParent() const
const DateOffsetList_T & getBoardingDateOffsetList() const
SegmentPathPeriodKey Key_T
friend class stdair::FacBomManager
Forward declarations.
bool isAirlineFlown(const stdair::AirlineCode_T &) const
const stdair::Duration_T & getBoardingTime() const
std::string toString() const
void toStream(std::ostream &ioOut) const
const DateOffsetList_T & getBoardingDateOffsetList() const
stdair::BomAbstract * _parent
void fromStream(std::istream &ioIn)
const std::string describeKey() const
stdair::SegmentPeriod * getLastSegmentPeriod() const
Class representing a segment/path.
stdair::HolderMap_T _holderMap
void serialize(Archive &ar, const unsigned int iFileVersion)
const stdair::PeriodStruct & getPeriod() const
Forward declarations.
const std::string toString() const
Key_T connectWithAnotherSegment(const SegmentPathPeriod &) const
friend class boost::serialization::access
bool checkCircle(const stdair::AirportCode_T &) const
const stdair::Duration_T & getElapsedTime() const
const stdair::Duration_T & getElapsedTime() const
const stdair::NbOfSegments_T getNbOfSegments() const
const stdair::HolderMap_T & getHolderMap() const
const stdair::NbOfSegments_T getNbOfSegments() const
const stdair::NbOfAirlines_T & getNbOfAirlines() const
const stdair::AirportCode_T & getDestination() const
const Key_T & getKey() const
const stdair::Duration_T & getBoardingTime() const
const stdair::PeriodStruct & getDeparturePeriod() const
const stdair::NbOfAirlines_T & getNbOfAirlines() const
std::vector< stdair::DateOffset_T > DateOffsetList_T
Structure representing the key of a segment/path.
bool isDepartureDateValid(const stdair::Date_T &) const