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

Interface for the STDAIR Services. More...

#include <stdair/STDAIR_Service.hpp>

Public Member Functions

 STDAIR_Service ()
 Default constructor. More...
 
 STDAIR_Service (const BasLogParams &)
 Constructor. More...
 
 STDAIR_Service (const BasLogParams &, const BasDBParams &)
 Constructor. More...
 
 ~STDAIR_Service ()
 Destructor. More...
 
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. More...
 
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
 
BomRootgetBomRoot () const
 Get a reference on the BomRoot object. More...
 
BomRootgetPersistentBomRoot () const
 Get a reference on the BomRoot object. More...
 
BasLogParams getLogParams () const
 
const BasDBParamsgetDBParams () const
 
const ServiceInitialisationTypegetServiceInitialisationType () const
 
void importINIConfig (const ConfigINIFile &)
 Import the configuration INI input file (format cfg). More...
 
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. More...
 

Detailed Description

Interface for the STDAIR Services.

Definition at line 44 of file STDAIR_Service.hpp.

Constructor & Destructor Documentation

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.

Parameters
[in]constBasLogParams& 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.

Parameters
[in]constBasLogParams& Parameters for the output log stream.
[in]constBasDBParams& 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.

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 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:

  • 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 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.

Parameters
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:

  • 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 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:

  • 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 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:

  • 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 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.

Parameters
constAirlineCode& Airline for which the flight-dates should be displayed. If set to "all" (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.

Definition at line 242 of file STDAIR_Service.cpp.

References stdair::BomJSONExport::jsonExportFlightDateList().

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.

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 262 of file STDAIR_Service.cpp.

References stdair::BomJSONExport::jsonExportFlightDateObjects(), and stdair::BomRetriever::retrieveFlightDateFromKeySet().

std::string stdair::STDAIR_Service::jsonExportEventObject ( const EventStruct iEventStruct) const
std::string stdair::STDAIR_Service::jsonExportConfiguration ( ) const

Dump, in the returned string and in JSON format, the configuration.

Returns
std::string Output string in which the configuration tree is JSON-ified.

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

Parameters
constJSONString& JSON-formatted string.
Returns
bool State whether the extracting has been successful.

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.

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 428 of file STDAIR_Service.cpp.

References stdair::BomDisplay::list().

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 446 of file STDAIR_Service.cpp.

References stdair::BomDisplay::listAirportPairDateRange().

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

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

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

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.

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

Definition at line 525 of file STDAIR_Service.cpp.

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

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

Parameters
constBomRoot& Reference on the BomRoot to display.
Returns
std::string Output string in which the BOM tree is logged/dumped.

Definition at line 541 of file STDAIR_Service.cpp.

References stdair::BomDisplay::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 555 of file STDAIR_Service.cpp.

References stdair::BomDisplay::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.

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

Definition at line 587 of file STDAIR_Service.cpp.

References stdair::BomDisplay::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 598 of file STDAIR_Service.cpp.

References stdair::BomDisplay::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).

Returns
BomRoot& Reference on the BomRoot.

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

Returns
BomRoot& Reference on the BomRoot.

Definition at line 138 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 148 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 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.

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

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

Parameters
constConfigINIFile& INI input file.

Definition at line 375 of file STDAIR_Service.cpp.

References stdair::BomINIImport::importINIConfig().

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

Parameters
conststd::string& Value to add in the configuration tree.
conststd::string& Path to create (or to look for).

Definition at line 391 of file STDAIR_Service.cpp.

References stdair::ConfigHolderStruct::addValue().

template<typename ValueType >
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.

Parameters
ValueType&Value to add in the configuration tree.
conststd::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().


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