AirSched Logo  0.1.4
C++ Simulated Airline Schedule Manager Library
AIRSCHED::SegmentPathPeriod Class Reference

Class representing a segment/path. More...

#include <airsched/bom/SegmentPathPeriod.hpp>

Inheritance diagram for AIRSCHED::SegmentPathPeriod:

List of all members.

Public Types

typedef SegmentPathPeriodKey Key_T

Public Member Functions

const Key_TgetKey () const
stdair::BomAbstract *const getParent () const
const stdair::PeriodStruct & getDeparturePeriod () const
const DateOffsetList_TgetBoardingDateOffsetList () 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

class stdair::FacBom
class stdair::FacBomManager
class boost::serialization::access

Detailed Description

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.


Member Typedef Documentation

Definition allowing to retrieve the associated BOM key type.

Definition at line 52 of file SegmentPathPeriod.hpp.


Constructor & Destructor Documentation

AIRSCHED::SegmentPathPeriod::SegmentPathPeriod ( const Key_T iKey) [protected]

Main constructor.

Definition at line 43 of file SegmentPathPeriod.cpp.

AIRSCHED::SegmentPathPeriod::~SegmentPathPeriod ( ) [protected]

Destructor.

Definition at line 48 of file SegmentPathPeriod.cpp.


Member Function Documentation

const Key_T& AIRSCHED::SegmentPathPeriod::getKey ( ) const [inline]

Get the primary key (destination airport).

Definition at line 60 of file SegmentPathPeriod.hpp.

References _key.

stdair::BomAbstract* const AIRSCHED::SegmentPathPeriod::getParent ( ) const [inline]

Get the parent (i.e., OriginDestinationSet) object.

Definition at line 67 of file SegmentPathPeriod.hpp.

References _parent.

const stdair::PeriodStruct& AIRSCHED::SegmentPathPeriod::getDeparturePeriod ( ) const [inline]

Get the departure period (part of the primary key).

Definition at line 72 of file SegmentPathPeriod.hpp.

References _key, and AIRSCHED::SegmentPathPeriodKey::getPeriod().

Referenced by connectWithAnotherSegment(), and isDepartureDateValid().

const DateOffsetList_T& AIRSCHED::SegmentPathPeriod::getBoardingDateOffsetList ( ) const [inline]

Get the boarding date offset list (part of the primary key).

Definition at line 77 of file SegmentPathPeriod.hpp.

References _key, and AIRSCHED::SegmentPathPeriodKey::getBoardingDateOffsetList().

Referenced by connectWithAnotherSegment().

const stdair::NbOfSegments_T AIRSCHED::SegmentPathPeriod::getNbOfSegments ( ) const [inline]

Get the number of segments (part of the primary key).

Definition at line 82 of file SegmentPathPeriod.hpp.

References _key, and AIRSCHED::SegmentPathPeriodKey::getNbOfSegments().

Referenced by connectWithAnotherSegment().

const stdair::NbOfAirlines_T& AIRSCHED::SegmentPathPeriod::getNbOfAirlines ( ) const [inline]

Get the number of airlines (part of the primary key).

Definition at line 87 of file SegmentPathPeriod.hpp.

References _key, and AIRSCHED::SegmentPathPeriodKey::getNbOfAirlines().

const stdair::Duration_T& AIRSCHED::SegmentPathPeriod::getElapsedTime ( ) const [inline]

Get the elapsed time (part of the primary key).

Definition at line 92 of file SegmentPathPeriod.hpp.

References _key, and AIRSCHED::SegmentPathPeriodKey::getElapsedTime().

Referenced by connectWithAnotherSegment().

const stdair::Duration_T& AIRSCHED::SegmentPathPeriod::getBoardingTime ( ) const [inline]

Get the boarding time (part of the primary key).

Definition at line 97 of file SegmentPathPeriod.hpp.

References _key, and AIRSCHED::SegmentPathPeriodKey::getBoardingTime().

Referenced by connectWithAnotherSegment().

const stdair::HolderMap_T& AIRSCHED::SegmentPathPeriod::getHolderMap ( ) const [inline]

Get the map of children holders (SegmentPeriod objects).

Definition at line 104 of file SegmentPathPeriod.hpp.

References _holderMap.

stdair::SegmentPeriod * AIRSCHED::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 * AIRSCHED::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 & AIRSCHED::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 AIRSCHED::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:

  1. A passenger can connect from the last segment of the first segment path and the first segment of the next segment path. These two segments should not create another segment.
  2. There is no circle within the new segment path.
  3. The intersection of the two periods is non-empty.

Definition at line 163 of file SegmentPathPeriod.cpp.

References checkCircle(), getBoardingDateOffsetList(), getBoardingTime(), getDeparturePeriod(), getElapsedTime(), getFirstSegmentPeriod(), getLastSegmentPeriod(), getNbOfSegments(), AIRSCHED::SegmentPathPeriodKey::setBoardingDateOffsetList(), AIRSCHED::SegmentPathPeriodKey::setBoardingTime(), AIRSCHED::SegmentPathPeriodKey::setElapsedTime(), and AIRSCHED::SegmentPathPeriodKey::setPeriod().

bool AIRSCHED::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 AIRSCHED::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 AIRSCHED::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().

void AIRSCHED::SegmentPathPeriod::toStream ( std::ostream &  ioOut) const [inline]

Dump a Business Object into an output stream.

Parameters:
ostream&the output stream.

Definition at line 176 of file SegmentPathPeriod.hpp.

References toString().

void AIRSCHED::SegmentPathPeriod::fromStream ( std::istream &  ioIn) [inline]

Read a Business Object from an input stream.

Parameters:
istream&the input stream.

Definition at line 185 of file SegmentPathPeriod.hpp.

std::string AIRSCHED::SegmentPathPeriod::toString ( ) const

Get the serialised version of the Business Object.

Definition at line 52 of file SegmentPathPeriod.cpp.

References _key, and AIRSCHED::SegmentPathPeriodKey::toString().

Referenced by toStream().

const std::string AIRSCHED::SegmentPathPeriod::describeKey ( ) const [inline]

Get a string describing the key.

Definition at line 196 of file SegmentPathPeriod.hpp.

References _key, and AIRSCHED::SegmentPathPeriodKey::toString().

template<class Archive >
void AIRSCHED::SegmentPathPeriod::serialize ( Archive &  ar,
const unsigned int  iFileVersion 
)

Serialisation.

Definition at line 74 of file SegmentPathPeriod.cpp.

References _key.


Friends And Related Function Documentation

friend class stdair::FacBom [friend]

Friend classes.

Definition at line 43 of file SegmentPathPeriod.hpp.

friend class stdair::FacBomManager [friend]

Definition at line 44 of file SegmentPathPeriod.hpp.

friend class boost::serialization::access [friend]

Definition at line 45 of file SegmentPathPeriod.hpp.


Member Data Documentation

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().

stdair::BomAbstract* AIRSCHED::SegmentPathPeriod::_parent [protected]

Pointer on the parent (OriginDestinationSet) object.

Definition at line 254 of file SegmentPathPeriod.hpp.

Referenced by getParent().

stdair::HolderMap_T AIRSCHED::SegmentPathPeriod::_holderMap [protected]

Map holding the children (SegmentPeriod objects).

Note:
The SegmentPeriod objects themselves have for parent the FlightPeriod class (not the SegmentPathPeriod class).

Definition at line 262 of file SegmentPathPeriod.hpp.

Referenced by getHolderMap().


The documentation for this class was generated from the following files: