Interface for the STDAIR Services. More...
#include <stdair/STDAIR_Service.hpp>
Interface for the STDAIR Services.
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.
[in] | const | BasLogParams& 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.
[in] | const | BasLogParams& Parameters for the output log stream. |
[in] | const | BasDBParams& 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.
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.:
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:
Most of the data is dummy because RMOL uses only the cabin capacity from that part of the BOM tree.
const | CabinCapacity_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:
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:
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:
As of now (March 2011), the CRS-related booking request is made of the following parameters:
const | bool isForCRS Whether the sample booking request is for CRS. |
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.
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.
const | EventType_T& Event type for which the number is calculated. |
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.
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.
const | EventType_T& Event type for which the number is calculated. |
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.
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.
const | AirlineCode_T& Airline code of the flight to dump. |
const | FlightNumber_T& Flight number of the flight to dump. |
const | Date_T& Departure date of the flight to dump. |
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.
const | AirlineCode& Airline for which the flight-dates should be displayed. If set to "all" (the default), all the inventories will be displayed. |
const | FlightNumber_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. |
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)
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.
const | stdair::AirlineCode_T& Airline code of the flight to check. |
const | stdair::FlightNumber_T& Flight number of the flight to check. |
const | stdair::Date_T& Departure date of the flight to check. |
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.
const | stdair::AirportCode_T& Origin airport of the fare rule to check. |
const | stdair::AirportCode_T& Destination airport of the fare rule to check. |
const | stdair::Date_T& Departure date of the fare rule to check. |
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.
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.
const | AirlineCode_T& Airline code of the flight to display. |
const | FlightNumber_T& Flight number of the flight to display. |
const | Date_T& Departure date of the flight to display. |
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.
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.
const | AirportCode_T& Origin airport of the fare-rules to display |
const | AirportCode_T& Destination airport of the fare-rules to display. |
const | Date_T& Departure date of the fare-rules to display. |
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).
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).
Definition at line 134 of file STDAIR_Service.cpp.
BasLogParams stdair::STDAIR_Service::getLogParams | ( | ) | const |
Get the log parameters.
Definition at line 142 of file STDAIR_Service.cpp.
const BasDBParams & stdair::STDAIR_Service::getDBParams | ( | ) | const |
Get 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.
Definition at line 156 of file STDAIR_Service.cpp.