Class representing a segment/path. More...
#include <airtsp/bom/SegmentPathPeriod.hpp>
Public Types | |
typedef SegmentPathPeriodKey | Key_T |
Public Member Functions | |
const Key_T & | getKey () const |
stdair::BomAbstract *const | getParent () const |
const stdair::PeriodStruct & | getDeparturePeriod () const |
const DateOffsetList_T & | getBoardingDateOffsetList () const |
const stdair::NbOfSegments_T | getNbOfSegments () const |
const stdair::NbOfAirlines_T & | getNbOfAirlines () const |
const stdair::Duration_T & | getElapsedTime () const |
const stdair::Duration_T & | getBoardingTime () const |
const stdair::HolderMap_T & | getHolderMap () const |
stdair::SegmentPeriod * | getLastSegmentPeriod () const |
stdair::SegmentPeriod * | getFirstSegmentPeriod () const |
const stdair::AirportCode_T & | getDestination () const |
Key_T | connectWithAnotherSegment (const SegmentPathPeriod &) const |
bool | checkCircle (const stdair::AirportCode_T &) const |
bool | isAirlineFlown (const stdair::AirlineCode_T &) const |
bool | isDepartureDateValid (const stdair::Date_T &) const |
void | toStream (std::ostream &ioOut) const |
void | fromStream (std::istream &ioIn) |
std::string | toString () const |
const std::string | describeKey () const |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int iFileVersion) |
Protected Member Functions | |
SegmentPathPeriod (const Key_T &) | |
~SegmentPathPeriod () | |
Protected Attributes | |
Key_T | _key |
stdair::BomAbstract * | _parent |
stdair::HolderMap_T | _holderMap |
Friends | |
template<typename BOM > | |
class | stdair::FacBom |
class | stdair::FacBomManager |
class | boost::serialization::access |
Class representing a segment/path.
It corresponds to an actual travel solution from the origin to the destination, that is, a path that a traveller can take with actual scheduled flights.
Definition at line 39 of file SegmentPathPeriod.hpp.
Definition allowing to retrieve the associated BOM key type.
Definition at line 52 of file SegmentPathPeriod.hpp.
|
protected |
Main constructor.
Definition at line 43 of file SegmentPathPeriod.cpp.
|
protected |
Destructor.
Definition at line 48 of file SegmentPathPeriod.cpp.
|
inline |
Get the primary key (destination airport).
Definition at line 60 of file SegmentPathPeriod.hpp.
References _key.
|
inline |
Get the parent (i.e., OriginDestinationSet) object.
Definition at line 67 of file SegmentPathPeriod.hpp.
References _parent.
|
inline |
Get the departure period (part of the primary key).
Definition at line 72 of file SegmentPathPeriod.hpp.
References _key, and AIRTSP::SegmentPathPeriodKey::getPeriod().
Referenced by connectWithAnotherSegment(), and isDepartureDateValid().
|
inline |
Get the boarding date offset list (part of the primary key).
Definition at line 77 of file SegmentPathPeriod.hpp.
References _key, and AIRTSP::SegmentPathPeriodKey::getBoardingDateOffsetList().
Referenced by connectWithAnotherSegment().
|
inline |
Get the number of segments (part of the primary key).
Definition at line 82 of file SegmentPathPeriod.hpp.
References _key, and AIRTSP::SegmentPathPeriodKey::getNbOfSegments().
Referenced by connectWithAnotherSegment().
|
inline |
Get the number of airlines (part of the primary key).
Definition at line 87 of file SegmentPathPeriod.hpp.
References _key, and AIRTSP::SegmentPathPeriodKey::getNbOfAirlines().
|
inline |
Get the elapsed time (part of the primary key).
Definition at line 92 of file SegmentPathPeriod.hpp.
References _key, and AIRTSP::SegmentPathPeriodKey::getElapsedTime().
Referenced by connectWithAnotherSegment().
|
inline |
Get the boarding time (part of the primary key).
Definition at line 97 of file SegmentPathPeriod.hpp.
References _key, and AIRTSP::SegmentPathPeriodKey::getBoardingTime().
Referenced by connectWithAnotherSegment().
|
inline |
Get the map of children holders (SegmentPeriod objects).
Definition at line 104 of file SegmentPathPeriod.hpp.
References _holderMap.
stdair::SegmentPeriod * AIRTSP::SegmentPathPeriod::getLastSegmentPeriod | ( | ) | const |
Get the last SegmentPeriod object of the list.
Return a NULL pointer if the list is empty.
Definition at line 91 of file SegmentPathPeriod.cpp.
Referenced by connectWithAnotherSegment(), and getDestination().
stdair::SegmentPeriod * AIRTSP::SegmentPathPeriod::getFirstSegmentPeriod | ( | ) | const |
Get the first SegmentPeriod object of the list.
Return a NULL pointer if the list is empty.
Definition at line 109 of file SegmentPathPeriod.cpp.
Referenced by connectWithAnotherSegment().
const stdair::AirportCode_T & AIRTSP::SegmentPathPeriod::getDestination | ( | ) | const |
Get the destination of the segment path (i.e., the destination of the last segment.
Definition at line 127 of file SegmentPathPeriod.cpp.
References getLastSegmentPeriod().
SegmentPathPeriodKey AIRTSP::SegmentPathPeriod::connectWithAnotherSegment | ( | const SegmentPathPeriod & | iSingleSegmentPath | ) | const |
Check whether the (i-1)-length segment path period can be merged with the single segment path period in order to create an i-length segment path period. The function will return a valid or non-valid segment path period key.
The two segment path period above can be fused (and will produce a valid new segment path period key) if:
Definition at line 163 of file SegmentPathPeriod.cpp.
References checkCircle(), getBoardingDateOffsetList(), getBoardingTime(), getDeparturePeriod(), getElapsedTime(), getFirstSegmentPeriod(), getLastSegmentPeriod(), getNbOfSegments(), AIRTSP::SegmentPathPeriodKey::setBoardingDateOffsetList(), AIRTSP::SegmentPathPeriodKey::setBoardingTime(), AIRTSP::SegmentPathPeriodKey::setElapsedTime(), and AIRTSP::SegmentPathPeriodKey::setPeriod().
bool AIRTSP::SegmentPathPeriod::checkCircle | ( | const stdair::AirportCode_T & | ) | const |
Check whether the given destination airport is also the departure point of one of the other segment members. If yes, a circle exists.
Definition at line 289 of file SegmentPathPeriod.cpp.
Referenced by connectWithAnotherSegment().
bool AIRTSP::SegmentPathPeriod::isAirlineFlown | ( | const stdair::AirlineCode_T & | iAirlineCode | ) | const |
State whether or not the given airline is flown by (at least) one of the segments of the internal list.
Definition at line 135 of file SegmentPathPeriod.cpp.
bool AIRTSP::SegmentPathPeriod::isDepartureDateValid | ( | const stdair::Date_T & | iDepartureDate | ) | const |
Check whether the given departure date is included in the departure period of the segment path.
Definition at line 308 of file SegmentPathPeriod.cpp.
References getDeparturePeriod().
|
inline |
Dump a Business Object into an output stream.
ostream& | the output stream. |
Definition at line 176 of file SegmentPathPeriod.hpp.
References toString().
|
inline |
Read a Business Object from an input stream.
istream& | the input stream. |
Definition at line 185 of file SegmentPathPeriod.hpp.
std::string AIRTSP::SegmentPathPeriod::toString | ( | ) | const |
Get the serialised version of the Business Object.
Definition at line 52 of file SegmentPathPeriod.cpp.
References _key, and AIRTSP::SegmentPathPeriodKey::toString().
Referenced by toStream().
|
inline |
Get a string describing the key.
Definition at line 196 of file SegmentPathPeriod.hpp.
References _key, and AIRTSP::SegmentPathPeriodKey::toString().
void AIRTSP::SegmentPathPeriod::serialize | ( | Archive & | ar, |
const unsigned int | iFileVersion | ||
) |
|
friend |
Friend classes.
Definition at line 43 of file SegmentPathPeriod.hpp.
|
friend |
Definition at line 44 of file SegmentPathPeriod.hpp.
|
friend |
Definition at line 45 of file SegmentPathPeriod.hpp.
|
protected |
Primary key (segment/path characteristics: scheduled period, number of segments, number of airlines, elapsed time, boarding time).
Definition at line 249 of file SegmentPathPeriod.hpp.
Referenced by describeKey(), getBoardingDateOffsetList(), getBoardingTime(), getDeparturePeriod(), getElapsedTime(), getKey(), getNbOfAirlines(), getNbOfSegments(), serialize(), and toString().
|
protected |
Pointer on the parent (OriginDestinationSet) object.
Definition at line 254 of file SegmentPathPeriod.hpp.
Referenced by getParent().
|
protected |
Map holding the children (SegmentPeriod objects).
Definition at line 262 of file SegmentPathPeriod.hpp.
Referenced by getHolderMap().