Interface for the STDAIR Services. More...
#include <stdair/STDAIR_Service.hpp>
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 | buildDummyLegSegmentAccesses (BomRoot &) |
void | buildSampleTravelSolutionForPricing (TravelSolutionList_T &) |
void | buildSampleTravelSolutions (TravelSolutionList_T &) |
BookingRequestStruct | buildSampleBookingRequest (const bool isForCRS=false) |
void | clonePersistentBom () |
Clone the persistent Bom. | |
std::string | jsonExportFlightDateList (const AirlineCode_T &iAirlineCode="all", const FlightNumber_T &iFlightNumber=0) const |
std::string | jsonExportFlightDateObjects (const AirlineCode_T &, const FlightNumber_T &, const Date_T &iDepartureDate) const |
std::string | jsonExportEventObject (const EventStruct &) const |
std::string | jsonExportConfiguration () const |
bool | jsonImportConfiguration (const JSONString &) 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 | configDisplay () const |
std::string | csvDisplay () const |
std::string | csvDisplay (const BomRoot &) 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 |
BomRoot & | getBomRoot () const |
Get a reference on the BomRoot object. | |
BomRoot & | getPersistentBomRoot () const |
Get a reference on the BomRoot object. | |
BasLogParams | getLogParams () const |
const BasDBParams & | getDBParams () const |
const ServiceInitialisationType & | getServiceInitialisationType () const |
void | importINIConfig (const ConfigINIFile &) |
Import the configuration INI input file (format cfg). | |
void | importConfigValue (const std::string &iValue, const std::string &iPath) |
template<typename ValueType > | |
bool | exportConfigValue (ValueType &ioValue, const std::string &iPath) |
void | updateAirlineFeatures () |
Update the airline features objects thanks to the configuration holder. |
Interface for the STDAIR Services.
Definition at line 44 of file STDAIR_Service.hpp.
stdair::STDAIR_Service::STDAIR_Service | ( | ) |
Default constructor.
Definition at line 45 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 61 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 75 of file STDAIR_Service.cpp.
stdair::STDAIR_Service::~STDAIR_Service | ( | ) |
Destructor.
Definition at line 93 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 172 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 187 of file STDAIR_Service.cpp.
void stdair::STDAIR_Service::buildDummyLegSegmentAccesses | ( | BomRoot & | iBomRoot | ) |
Build the direct accesses between the dummy segment cabins and the dummy leg cabins within the dummy flight dates (the dummy fare family flight date and the classic dummy flight date).
As for now (May 2012), that method is called only by RMOL. It is a substitute for the code doing it automatically located in AirInv. See the AIRINV::InventoryManager::createDirectAccesses command.
BomRoot& | Top of the BOM tree, to which the sample should be attached. |
Definition at line 204 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 215 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 222 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 229 of file STDAIR_Service.cpp.
void stdair::STDAIR_Service::clonePersistentBom | ( | ) |
Clone the persistent Bom.
Definition at line 635 of file STDAIR_Service.cpp.
References stdair::FacSupervisor::cleanCloneBomLayer(), and stdair::FacSupervisor::instance().
std::string stdair::STDAIR_Service::jsonExportFlightDateList | ( | const AirlineCode_T & | iAirlineCode = "all" , |
const FlightNumber_T & | iFlightNumber = 0 |
||
) | const |
Recursively dump, in the returned string and in JSON format, the flight-date list corresponding to the parameters given as input.
const | AirlineCode& Airline for which the flight-dates should be displayed. If set to "all" (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 242 of file STDAIR_Service.cpp.
std::string stdair::STDAIR_Service::jsonExportFlightDateObjects | ( | const AirlineCode_T & | iAirlineCode, |
const FlightNumber_T & | iFlightNumber, | ||
const Date_T & | iDepartureDate | ||
) | const |
Recursively dump, in the returned string and in JSON format, the detailed flight-date (leg, segments, cabins, classes, ...) 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 262 of file STDAIR_Service.cpp.
References stdair::BomRetriever::retrieveFlightDateFromKeySet().
std::string stdair::STDAIR_Service::jsonExportEventObject | ( | const EventStruct & | iEventStruct | ) | const |
Recursively dump, in the returned string and in JSON format, the event object.
Definition at line 312 of file STDAIR_Service.cpp.
References stdair::EventType::BKG_REQ, stdair::EventType::BRK_PT, stdair::EventType::CX, stdair::EventStruct::getEventType(), stdair::BomJSONExport::jsonExportBookingRequestObject(), stdair::BomJSONExport::jsonExportBreakPointObject(), stdair::EventType::OPT_NOT_4_FD, stdair::EventType::OPT_NOT_4_NET, stdair::EventType::RM, stdair::EventType::SKD_CHG, and stdair::EventType::SNAPSHOT.
std::string stdair::STDAIR_Service::jsonExportConfiguration | ( | ) | const |
Dump, in the returned string and in JSON format, the configuration.
Definition at line 359 of file STDAIR_Service.cpp.
References stdair::ConfigHolderStruct::jsonExport().
bool stdair::STDAIR_Service::jsonImportConfiguration | ( | const JSONString & | iJSONString | ) | const |
Extract the configuration ptree from the given JSON-formatted string and add it to the configuration holder
const | JSONString& JSON-formatted string. |
Definition at line 342 of file STDAIR_Service.cpp.
References stdair::BomJSONImport::jsonImportConfig().
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 428 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 446 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 463 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 485 of file STDAIR_Service.cpp.
References stdair::BomRetriever::retrieveDatePeriodListFromKeySet().
std::string stdair::STDAIR_Service::configDisplay | ( | ) | const |
Display (dump in the returned string) the configuration.
Definition at line 508 of file STDAIR_Service.cpp.
References stdair::ConfigHolderStruct::describe().
std::string stdair::STDAIR_Service::csvDisplay | ( | ) | const |
Recursively display (dump in the returned string) the objects of the persistent BOM tree.
Definition at line 525 of file STDAIR_Service.cpp.
Referenced by csvDisplay().
std::string stdair::STDAIR_Service::csvDisplay | ( | const BomRoot & | iBomRoot | ) | const |
Recursively display (dump in the returned string) the objects of the BOM tree.
Definition at line 541 of file STDAIR_Service.cpp.
References 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 555 of file STDAIR_Service.cpp.
References csvDisplay(), and stdair::BomRetriever::retrieveFlightDateFromKeySet().
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 587 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 598 of file STDAIR_Service.cpp.
References csvDisplay(), and stdair::BomRetriever::retrieveDatePeriodListFromKeySet().
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 128 of file STDAIR_Service.cpp.
BomRoot & stdair::STDAIR_Service::getPersistentBomRoot | ( | ) | 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 138 of file STDAIR_Service.cpp.
BasLogParams stdair::STDAIR_Service::getLogParams | ( | ) | const |
Get the log parameters.
Definition at line 148 of file STDAIR_Service.cpp.
const BasDBParams & stdair::STDAIR_Service::getDBParams | ( | ) | const |
Get the database parameters.
Definition at line 153 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 163 of file STDAIR_Service.cpp.
void stdair::STDAIR_Service::importINIConfig | ( | const ConfigINIFile & | iConfigINIFile | ) |
Import the configuration INI input file (format cfg).
const | ConfigINIFile& INI input file. |
Definition at line 375 of file STDAIR_Service.cpp.
void stdair::STDAIR_Service::importConfigValue | ( | const std::string & | iValue, |
const std::string & | iPath | ||
) |
Create the given specified path in the configuration tree and add the corresponding given value (or replace the value if the path already exists).
const | std::string& Value to add in the configuration tree. |
const | std::string& Path to create (or to look for). |
Definition at line 391 of file STDAIR_Service.cpp.
References stdair::ConfigHolderStruct::addValue().
bool stdair::STDAIR_Service::exportConfigValue | ( | ValueType & | ioValue, |
const std::string & | iPath | ||
) |
Look for the specified path in the configuration tree and, if existing, try to extract the corresponding value. The type of the value to extract is a template parameter.
ValueType& | Value to add in the configuration tree. |
const | std::string& Path to look for. |
Definition at line 552 of file STDAIR_Service.hpp.
References stdair::ConfigHolderStruct::exportValue().
void stdair::STDAIR_Service::updateAirlineFeatures | ( | ) |
Update the airline features objects thanks to the configuration holder.
Definition at line 408 of file STDAIR_Service.cpp.
References stdair::ConfigHolderStruct::updateAirlineFeatures().