AirTSP Logo  1.01.6
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 ////////////////
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 
AIRTSP::SegmentPathPeriod::getNbOfSegments
const stdair::NbOfSegments_T getNbOfSegments() const
Definition: SegmentPathPeriod.hpp:82
AIRTSP::SegmentPathPeriod::_parent
stdair::BomAbstract * _parent
Definition: SegmentPathPeriod.hpp:254
AIRTSP::SegmentPathPeriod::access
friend class boost::serialization::access
Definition: SegmentPathPeriod.hpp:45
AIRTSP::SegmentPathPeriodKey::getNbOfAirlines
const stdair::NbOfAirlines_T & getNbOfAirlines() const
Definition: SegmentPathPeriodKey.hpp:89
AIRTSP::SegmentPathPeriod::getKey
const Key_T & getKey() const
Definition: SegmentPathPeriod.hpp:60
AIRTSP::SegmentPathPeriod::getLastSegmentPeriod
stdair::SegmentPeriod * getLastSegmentPeriod() const
Definition: SegmentPathPeriod.cpp:91
boost
Forward declarations.
Definition: OriginDestinationSet.hpp:17
AIRTSP::SegmentPathPeriodKey
Structure representing the key of a segment/path.
Definition: SegmentPathPeriodKey.hpp:33
AIRTSP::SegmentPathPeriod::getDestination
const stdair::AirportCode_T & getDestination() const
Definition: SegmentPathPeriod.cpp:127
AIRTSP::SegmentPathPeriod::isAirlineFlown
bool isAirlineFlown(const stdair::AirlineCode_T &) const
Definition: SegmentPathPeriod.cpp:135
AIRTSP::SegmentPathPeriodKey::toString
const std::string toString() const
Definition: SegmentPathPeriodKey.cpp:66
AIRTSP::SegmentPathPeriod::toString
std::string toString() const
Definition: SegmentPathPeriod.cpp:52
AIRTSP::SegmentPathPeriod
Class representing a segment/path.
Definition: SegmentPathPeriod.hpp:39
AIRTSP::SegmentPathPeriodKey::getBoardingTime
const stdair::Duration_T & getBoardingTime() const
Definition: SegmentPathPeriodKey.hpp:103
stdair
Forward declarations.
Definition: AIRTSP_Service.hpp:14
SegmentPathPeriodKey.hpp
SegmentPathPeriodTypes.hpp
AIRTSP
Definition: AIRTSP_Service.hpp:23
AIRTSP::SegmentPathPeriod::FacBomManager
friend class stdair::FacBomManager
Definition: SegmentPathPeriod.hpp:44
AIRTSP::SegmentPathPeriod::describeKey
const std::string describeKey() const
Definition: SegmentPathPeriod.hpp:196
AIRTSP::SegmentPathPeriod::Key_T
SegmentPathPeriodKey Key_T
Definition: SegmentPathPeriod.hpp:52
AIRTSP::SegmentPathPeriod::checkCircle
bool checkCircle(const stdair::AirportCode_T &) const
Definition: SegmentPathPeriod.cpp:289
AIRTSP::SegmentPathPeriod::getParent
stdair::BomAbstract *const getParent() const
Definition: SegmentPathPeriod.hpp:67
AIRTSP::SegmentPathPeriod::serialize
void serialize(Archive &ar, const unsigned int iFileVersion)
Definition: SegmentPathPeriod.cpp:74
AIRTSP::SegmentPathPeriod::getBoardingDateOffsetList
const DateOffsetList_T & getBoardingDateOffsetList() const
Definition: SegmentPathPeriod.hpp:77
AIRTSP::SegmentPathPeriod::getDeparturePeriod
const stdair::PeriodStruct & getDeparturePeriod() const
Definition: SegmentPathPeriod.hpp:72
AIRTSP::SegmentPathPeriod::fromStream
void fromStream(std::istream &ioIn)
Definition: SegmentPathPeriod.hpp:185
AIRTSP::SegmentPathPeriodKey::getPeriod
const stdair::PeriodStruct & getPeriod() const
Definition: SegmentPathPeriodKey.hpp:68
AIRTSP::SegmentPathPeriodKey::getElapsedTime
const stdair::Duration_T & getElapsedTime() const
Definition: SegmentPathPeriodKey.hpp:96
AIRTSP::SegmentPathPeriod::getFirstSegmentPeriod
stdair::SegmentPeriod * getFirstSegmentPeriod() const
Definition: SegmentPathPeriod.cpp:109
AIRTSP::SegmentPathPeriod::getHolderMap
const stdair::HolderMap_T & getHolderMap() const
Definition: SegmentPathPeriod.hpp:104
AIRTSP::DateOffsetList_T
std::vector< stdair::DateOffset_T > DateOffsetList_T
Definition: SegmentPathPeriodTypes.hpp:35
AIRTSP::SegmentPathPeriodKey::getNbOfSegments
const stdair::NbOfSegments_T getNbOfSegments() const
Definition: SegmentPathPeriodKey.hpp:82
AIRTSP::SegmentPathPeriod::~SegmentPathPeriod
~SegmentPathPeriod()
Definition: SegmentPathPeriod.cpp:48
stdair::FacBom
Definition: OriginDestinationSet.hpp:25
AIRTSP::SegmentPathPeriod::getBoardingTime
const stdair::Duration_T & getBoardingTime() const
Definition: SegmentPathPeriod.hpp:97
AIRTSP::SegmentPathPeriod::_holderMap
stdair::HolderMap_T _holderMap
Definition: SegmentPathPeriod.hpp:262
AIRTSP::SegmentPathPeriod::connectWithAnotherSegment
Key_T connectWithAnotherSegment(const SegmentPathPeriod &) const
Definition: SegmentPathPeriod.cpp:163
AIRTSP::SegmentPathPeriod::toStream
void toStream(std::ostream &ioOut) const
Definition: SegmentPathPeriod.hpp:176
AIRTSP::SegmentPathPeriod::_key
Key_T _key
Definition: SegmentPathPeriod.hpp:249
AIRTSP::SegmentPathPeriod::getNbOfAirlines
const stdair::NbOfAirlines_T & getNbOfAirlines() const
Definition: SegmentPathPeriod.hpp:87
AIRTSP::SegmentPathPeriodKey::getBoardingDateOffsetList
const DateOffsetList_T & getBoardingDateOffsetList() const
Definition: SegmentPathPeriodKey.hpp:75
AIRTSP::SegmentPathPeriod::getElapsedTime
const stdair::Duration_T & getElapsedTime() const
Definition: SegmentPathPeriod.hpp:92
AIRTSP::SegmentPathPeriod::isDepartureDateValid
bool isDepartureDateValid(const stdair::Date_T &) const
Definition: SegmentPathPeriod.cpp:308