StdAir Logo  0.45.0
C++ Standard Airline IT Object Library
stdair::STDAIR_Service Class Reference

Interface for the STDAIR Services. More...

#include <stdair/STDAIR_Service.hpp>

List of all members.

Public Member Functions

 STDAIR_Service ()
 Default constructor.
 STDAIR_Service (const BasLogParams &)
 Constructor.
 STDAIR_Service (const BasLogParams &, const BasDBParams &)
 Constructor.
 ~STDAIR_Service ()
 Destructor.
void buildSampleBom ()
void buildDummyInventory (const CabinCapacity_T &iCabinCapacity)
void buildSampleTravelSolutionForPricing (TravelSolutionList_T &)
void buildSampleTravelSolutions (TravelSolutionList_T &)
BookingRequestStruct buildSampleBookingRequest (const bool isForCRS=false)
const Count_TgetExpectedTotalNumberOfEventsToBeGenerated () const
const Count_TgetExpectedTotalNumberOfEventsToBeGenerated (const EventType::EN_EventType &) const
const Count_TgetActualTotalNumberOfEventsToBeGenerated () const
const Count_TgetActualTotalNumberOfEventsToBeGenerated (const EventType::EN_EventType &) const
ProgressStatusSet popEvent (EventStruct &) const
bool isQueueDone () const
void reset () const
std::string jsonExport (const AirlineCode_T &, const FlightNumber_T &, const Date_T &iDepartureDate) const
std::string list (const AirlineCode_T &iAirlineCode="all", const FlightNumber_T &iFlightNumber=0) const
std::string listAirportPairDateRange () const
bool check (const AirlineCode_T &, const FlightNumber_T &, const Date_T &iDepartureDate) const
bool check (const AirportCode_T &, const AirportCode_T &, const Date_T &iDepartureDate) const
std::string csvDisplay () const
std::string csvDisplay (const AirlineCode_T &, const FlightNumber_T &, const Date_T &iDepartureDate) const
std::string csvDisplay (const TravelSolutionList_T &) const
std::string csvDisplay (const AirportCode_T &, const AirportCode_T &, const Date_T &iDepartureDate) const
BomRootgetBomRoot () const
 Get a reference on the BomRoot object.
EventQueuegetEventQueue () const
 Get a reference on the EventQueue object.
BasLogParams getLogParams () const
const BasDBParamsgetDBParams () const
const ServiceInitialisationTypegetServiceInitialisationType () const

Detailed Description

Interface for the STDAIR Services.


Constructor & Destructor Documentation

stdair::STDAIR_Service::STDAIR_Service ( )

Default constructor.

Definition at line 43 of file STDAIR_Service.cpp.

stdair::STDAIR_Service::STDAIR_Service ( const BasLogParams iLogParams)

Constructor.

The init() method is called; see the corresponding documentation for more details.

Moreover, a reference on an output stream is given, so that log outputs can be directed onto that stream.

Parameters:
[in]constBasLogParams& Parameters for the output log stream.

Definition at line 59 of file STDAIR_Service.cpp.

stdair::STDAIR_Service::STDAIR_Service ( const BasLogParams iLogParams,
const BasDBParams iDBParams 
)

Constructor.

The init() method is called; see the corresponding documentation for more details.

A reference on an output stream is given, so that log outputs can be directed onto that stream.

Moreover, database connection parameters are given, so that database events can use the corresponding access.

Parameters:
[in]constBasLogParams& Parameters for the output log stream.
[in]constBasDBParams& Parameters for the database session.

Definition at line 73 of file STDAIR_Service.cpp.

stdair::STDAIR_Service::~STDAIR_Service ( )

Destructor.

Definition at line 91 of file STDAIR_Service.cpp.


Member Function Documentation

void stdair::STDAIR_Service::buildSampleBom ( )

Build a sample BOM tree, and attach it to the BomRoot instance.

As for now, a single sample BOM tree is built, with objects for all the simulator-related components, i.e.:

  • schedule (e.g., AirSched),
  • inventory (e.g., AirInv),
  • revenue management (e.g., RMOL),
  • pricing (e.g., SimFQT),
  • revenue accounting (e.g., AirRAC),
  • demand generation (e.g., TraDemGen),
  • customer choice (e.g., TravelCCM),
  • event manager (e.g., SEvMgr)

Most of the inventories just contain one flight. One of those flights has two legs (and therefore three segments).

Definition at line 164 of file STDAIR_Service.cpp.

void stdair::STDAIR_Service::buildDummyInventory ( const CabinCapacity_T iCabinCapacity)

Build a dummy inventory, containing a dummy flight-date with a single leg-cabin and some virtual booking classes. That structure is the bare minimum required to perform an optimisation on a leg-cabin.

As for now, that method is called only by RMOL. Indeed, the revenue management component (RMOL) needs very basic set up in order to perform optimisation at leg-level. Hence, there are:

  • a dedicated inventory ('XX'),
  • the corresponding flight-date (#9999, departing 01/01/1900),
  • a leg-date (departing and arriving from/to 'XXX' airport),
  • a leg-cabin ('X').

Most of the data is dummy because RMOL uses only the cabin capacity from that part of the BOM tree.

Parameters:
constCabinCapacity_T& Cabin capacity for revenue management optimisation.

Definition at line 178 of file STDAIR_Service.cpp.

void stdair::STDAIR_Service::buildSampleTravelSolutionForPricing ( TravelSolutionList_T ioTravelSolutionList)

Build a sample list of travel solutions.

As of now (March 2011), that list is made of the following travel solutions:

  • BA9
  • LHR-SYD
  • 2011-06-10
Parameters:
TravelSolutionList_T&Sample list of travel solution structures. It should be given empty. It is altered with the returned sample.

Definition at line 192 of file STDAIR_Service.cpp.

void stdair::STDAIR_Service::buildSampleTravelSolutions ( TravelSolutionList_T ioTravelSolutionList)

Build a sample list of travel solutions.

As of now (March 2011), that list is made of the following travel solutions:

  • BA9
  • LHR-SYD
  • 2011-06-10
  • Q
  • WTP: 900
  • Change fee: 20; Non refundable; Saturday night stay
Parameters:
TravelSolutionList_T&Sample list of travel solution structures. It should be given empty. It is altered with the returned sample.

Definition at line 199 of file STDAIR_Service.cpp.

BookingRequestStruct stdair::STDAIR_Service::buildSampleBookingRequest ( const bool  isForCRS = false)

Build a sample booking request structure.

As of now (March 2011), the sample booking request is made of the following parameters:

  • Return trip (inbound): LHR-SYD (POS: LHR, Channel: DN),
  • Departing 10-JUN-2011 around 8:00, staying 7 days
  • Requested on 15-MAY-2011 at 10:00
  • Economy cabin, 3 persons, FF member
  • WTP: 1000.0 EUR
  • Dis-utility: 100.0 EUR/hour

As of now (March 2011), the CRS-related booking request is made of the following parameters:

  • Return trip (inbound): SIN-BKK (POS: SIN, Channel: IN),
  • Departing 30-JAN-2010 around 10:00, staying 7 days
  • Requested on 22-JAN-2010 at 10:00
  • Economy cabin, 3 persons, FF member
  • WTP: 1000.0 EUR
  • Dis-utility: 100.0 EUR/hour
Parameters:
constbool isForCRS Whether the sample booking request is for CRS.
Returns:
BookingRequestStruct& Sample booking request structure.

Definition at line 206 of file STDAIR_Service.cpp.

const Count_T & stdair::STDAIR_Service::getExpectedTotalNumberOfEventsToBeGenerated ( ) const

Get the expected number of events to be generated.

The getExpectedTotalNbOfEvents() method is called on the underlying EventQueue object, which keeps track of that number.

Note:
That number usually corresponds to an expectation (i.e., the mean value of a random distribution), and may not be accurate. The actual number will be known after calling the generateFirstEvents() method for each event type (e.g., booking request, optimisation notification, etc).
Returns:
const Count_T& Expected number of events to be generated.

Definition at line 442 of file STDAIR_Service.cpp.

References stdair::EventQueue::getExpectedTotalNbOfEvents().

const Count_T & stdair::STDAIR_Service::getExpectedTotalNumberOfEventsToBeGenerated ( const EventType::EN_EventType iType) const

Get the expected number of events to be generated for the given event type.

The getExpectedTotalNbOfEvents() method is called on the underlying EventQueue object, which keeps track of that number.

Note:
That number usually corresponds to an expectation (i.e., the mean value of a random distribution), and may not be accurate. The actual number will be known after calling the generateFirstEvents() method for each event type (e.g., booking request, optimisation notification, etc).
Parameters:
constEventType_T& Event type for which the number is calculated.
Returns:
const Count_T& Expected number of events to be generated.

Definition at line 461 of file STDAIR_Service.cpp.

References stdair::EventQueue::getExpectedTotalNbOfEvents().

const Count_T & stdair::STDAIR_Service::getActualTotalNumberOfEventsToBeGenerated ( ) const

Get the actual number of events to be generated for all the demand streams.

The getActualTotalNbOfEvents() method is called on the underlying EventQueue object, which keeps track of that number.

Note:
That number is being known after calling the generateFirstEvents() method.
Returns:
const Count_T& Expected number of events to be generated.

Definition at line 480 of file STDAIR_Service.cpp.

References stdair::EventQueue::getActualTotalNbOfEvents().

const Count_T & stdair::STDAIR_Service::getActualTotalNumberOfEventsToBeGenerated ( const EventType::EN_EventType iType) const

Get the actual number of events to be generated for the given event type.

The getActualTotalNbOfEvents() method is called on the underlying EventQueue object, which keeps track of that number.

Note:
That number is being known after calling the generateFirstEvents() method.
Parameters:
constEventType_T& Event type for which the number is calculated.
Returns:
const Count_T& Expected number of events to be generated.

Definition at line 499 of file STDAIR_Service.cpp.

References stdair::EventQueue::getActualTotalNbOfEvents().

ProgressStatusSet stdair::STDAIR_Service::popEvent ( EventStruct ioEventStruct) const

Pop the next coming (in time) event, and remove it from the event queue.

  • The next coming (in time) event corresponds to the event having the earliest date-time stamp. In other words, it is the first/front element of the event queue.
  • That (first) event/element is then removed from the event queue
  • The progress status is updated for the corresponding event type.
Returns:
EventStruct A copy of the event structure, which comes first in time from within the event queue.

Definition at line 517 of file STDAIR_Service.cpp.

References stdair::EventQueue::popEvent().

bool stdair::STDAIR_Service::isQueueDone ( ) const

States whether the event queue has reached the end.

For now, that method states whether or not the event queue is empty.

Definition at line 531 of file STDAIR_Service.cpp.

References stdair::EventQueue::isQueueDone().

void stdair::STDAIR_Service::reset ( ) const

Reset the context of the demand streams for another demand generation without having to reparse the demand input file.

Definition at line 548 of file STDAIR_Service.cpp.

References stdair::EventQueue::reset().

std::string stdair::STDAIR_Service::jsonExport ( const AirlineCode_T iAirlineCode,
const FlightNumber_T iFlightNumber,
const Date_T iDepartureDate 
) const

Recursively dump, in the returned string and in JSON format, the flight-date corresponding to the parameters given as input.

Parameters:
constAirlineCode_T& Airline code of the flight to dump.
constFlightNumber_T& Flight number of the flight to dump.
constDate_T& Departure date of the flight to dump.
Returns:
std::string Output string in which the BOM tree is JSON-ified.

Definition at line 218 of file STDAIR_Service.cpp.

References stdair::BomRetriever::retrieveFlightDateFromKeySet().

std::string stdair::STDAIR_Service::list ( const AirlineCode_T iAirlineCode = "all",
const FlightNumber_T iFlightNumber = 0 
) const

Display the list of flight-dates (contained within the BOM tree) corresponding to the parameters given as input.

Parameters:
constAirlineCode& Airline for which the flight-dates should be displayed. If set to "all" (the default), all the inventories will be displayed.
constFlightNumber_T& Flight number for which all the departure dates should be displayed. If set to 0 (the default), all the flight numbers will be displayed.
Returns:
std::string Output string in which the BOM tree is logged/dumped.

Definition at line 265 of file STDAIR_Service.cpp.

std::string stdair::STDAIR_Service::listAirportPairDateRange ( ) const

Display the list of aiports pairs and date ranges (contained within the BOM tree)

Parameters:
std::ostream&Output stream in which the airport pairs and date ranges are logged/dumped.

Definition at line 283 of file STDAIR_Service.cpp.

bool stdair::STDAIR_Service::check ( const AirlineCode_T iAirlineCode,
const FlightNumber_T iFlightNumber,
const Date_T iDepartureDate 
) const

Check whether the given flight-date is a valid one.

Parameters:
conststdair::AirlineCode_T& Airline code of the flight to check.
conststdair::FlightNumber_T& Flight number of the flight to check.
conststdair::Date_T& Departure date of the flight to check.
Returns:
bool Whether or not the given flight date is valid.

Definition at line 300 of file STDAIR_Service.cpp.

References stdair::BomRetriever::retrieveFlightDateFromKeySet().

bool stdair::STDAIR_Service::check ( const AirportCode_T ioOrigin,
const AirportCode_T ioDestination,
const Date_T iDepartureDate 
) const

Check whether the given couple airportpair-date is a valid one.

Parameters:
conststdair::AirportCode_T& Origin airport of the fare rule to check.
conststdair::AirportCode_T& Destination airport of the fare rule to check.
conststdair::Date_T& Departure date of the fare rule to check.
Returns:
bool Whether or not the given airportpair-date couple is a valid one.

Definition at line 322 of file STDAIR_Service.cpp.

References stdair::BomRetriever::retrieveDatePeriodListFromKeySet().

std::string stdair::STDAIR_Service::csvDisplay ( ) const

Recursively display (dump in the returned string) the objects of the BOM tree.

Returns:
std::string Output string in which the BOM tree is logged/dumped.

Definition at line 345 of file STDAIR_Service.cpp.

Referenced by csvDisplay().

std::string stdair::STDAIR_Service::csvDisplay ( const AirlineCode_T iAirlineCode,
const FlightNumber_T iFlightNumber,
const Date_T iDepartureDate 
) const

Recursively display (dump in the returned string) the flight-date corresponding to the parameters given as input.

Parameters:
constAirlineCode_T& Airline code of the flight to display.
constFlightNumber_T& Flight number of the flight to display.
constDate_T& Departure date of the flight to display.
Returns:
std::string Output string in which the BOM tree is logged/dumped.

Definition at line 363 of file STDAIR_Service.cpp.

References stdair::BomRetriever::retrieveFlightDateFromKeySet(), and csvDisplay().

std::string stdair::STDAIR_Service::csvDisplay ( const TravelSolutionList_T iTravelSolutionList) const

Display (dump in the returned string) the full list of travel solution structures.

Returns:
std::string Output string in which the list of travel solutions is logged/dumped.

Definition at line 394 of file STDAIR_Service.cpp.

References csvDisplay().

std::string stdair::STDAIR_Service::csvDisplay ( const AirportCode_T iOrigin,
const AirportCode_T iDestination,
const Date_T iDepartureDate 
) const

Recursively display (dump in the returned string) the fare-rules corresponding to the parameters given as input.

Parameters:
constAirportCode_T& Origin airport of the fare-rules to display
constAirportCode_T& Destination airport of the fare-rules to display.
constDate_T& Departure date of the fare-rules to display.
Returns:
std::string Output string in which the BOM tree is logged/dumped.

Definition at line 405 of file STDAIR_Service.cpp.

References stdair::BomRetriever::retrieveDatePeriodListFromKeySet(), and csvDisplay().

BomRoot & stdair::STDAIR_Service::getBomRoot ( ) const

Get a reference on the BomRoot object.

If the service context has not been initialised, that method throws an exception (failing assertion).

Returns:
BomRoot& Reference on the BomRoot.

Definition at line 126 of file STDAIR_Service.cpp.

EventQueue & stdair::STDAIR_Service::getEventQueue ( ) const

Get a reference on the EventQueue object.

If the service context has not been initialised, that method throws an exception (failing assertion).

Returns:
EventQueue& Reference on the EventQueue.

Definition at line 134 of file STDAIR_Service.cpp.

BasLogParams stdair::STDAIR_Service::getLogParams ( ) const

Get the log parameters.

Returns:
BasLogParams Copy of the structure holding the log parameters.

Definition at line 142 of file STDAIR_Service.cpp.

const BasDBParams & stdair::STDAIR_Service::getDBParams ( ) const

Get the database parameters.

Returns:
const BasDBParams& Reference on the structure holding the database parameters.

Definition at line 147 of file STDAIR_Service.cpp.

const ServiceInitialisationType & stdair::STDAIR_Service::getServiceInitialisationType ( ) const

Get the type of initialisation (e.g., not yet, file parsing, sample BOM) which the component (owner of the current STDAIR_Service instance) has gone through.

Returns:
const ServiceInitialisationType& Reference on the type of initialisation (enumeration structure).

Definition at line 156 of file STDAIR_Service.cpp.


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