Interface for the SIMFQT Services. More...
#include <simfqt/SIMFQT_Service.hpp>
Public Member Functions | |
SIMFQT_Service (const stdair::BasLogParams &) | |
SIMFQT_Service (const stdair::BasLogParams &, const stdair::BasDBParams &) | |
SIMFQT_Service (stdair::STDAIR_ServicePtr_T ioSTDAIR_ServicePtr) | |
void | parseAndLoad (const FareFilePath &iFareFilename) |
~SIMFQT_Service () | |
void | buildSampleBom () |
void | clonePersistentBom () |
void | buildComplementaryLinks (stdair::BomRoot &) |
stdair::BookingRequestStruct | buildBookingRequest (const bool isForCRS=false) |
void | buildSampleTravelSolutions (stdair::TravelSolutionList_T &) |
void | quotePrices (const stdair::BookingRequestStruct &, stdair::TravelSolutionList_T &) |
std::string | csvDisplay () const |
std::string | csvDisplay (const stdair::TravelSolutionList_T &) const |
std::string | csvDisplay (const stdair::AirportCode_T &ioOrigin, const stdair::AirportCode_T &ioDestination, const stdair::Date_T &ioDepartureDate) const |
std::string | list () const |
bool | check (const stdair::AirportCode_T &ioOrigin, const stdair::AirportCode_T &ioDestination, const stdair::Date_T &ioDepartureDate) const |
Interface for the SIMFQT Services.
Definition at line 32 of file SIMFQT_Service.hpp.
SIMFQT::SIMFQT_Service::SIMFQT_Service | ( | const stdair::BasLogParams & | iLogParams | ) |
Constructor.
The initSimfqtService() 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.
const | stdair::BasLogParams& Parameters for the output log stream. |
Definition at line 36 of file SIMFQT_Service.cpp.
SIMFQT::SIMFQT_Service::SIMFQT_Service | ( | const stdair::BasLogParams & | iLogParams, |
const stdair::BasDBParams & | iDBParams | ||
) |
Constructor.
The initSimfqtService() 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.
const | stdair::BasLogParams& Parameters for the output log stream. |
const | stdair::BasDBParams& Parameters for the database access. |
Definition at line 56 of file SIMFQT_Service.cpp.
SIMFQT::SIMFQT_Service::SIMFQT_Service | ( | stdair::STDAIR_ServicePtr_T | ioSTDAIR_ServicePtr | ) |
Constructor.
The initSimfqtService() method is called; see the corresponding documentation for more details.
Moreover, as no reference on any output stream is given, it is assumed that the StdAir log service has already been initialised with the proper log output stream by some other methods in the calling chain (for instance, when the SIMFQT_Service is itself being initialised by another library service such as SIMCRS_Service).
stdair::STDAIR_ServicePtr_T | Reference on the STDAIR service. |
Definition at line 78 of file SIMFQT_Service.cpp.
SIMFQT::SIMFQT_Service::~SIMFQT_Service | ( | ) |
Destructor.
Definition at line 94 of file SIMFQT_Service.cpp.
void SIMFQT::SIMFQT_Service::parseAndLoad | ( | const FareFilePath & | iFareFilename | ) |
Parse the fare dump and load it into memory.
The CSV file, describing the fare rule for the simulator, is parsed and instantiated in memory accordingly.
const | FareFilePath& Filename of the input fare file. |
Definition at line 171 of file SIMFQT_Service.cpp.
References buildComplementaryLinks(), clonePersistentBom(), and SIMFQT::FareParser::fareRuleGeneration().
Referenced by main().
void SIMFQT::SIMFQT_Service::buildSampleBom | ( | ) |
Build a sample BOM tree, and attach it to the BomRoot instance.
As for now, two sample BOM trees can be built.
Definition at line 223 of file SIMFQT_Service.cpp.
References buildComplementaryLinks(), and clonePersistentBom().
Referenced by main().
void SIMFQT::SIMFQT_Service::clonePersistentBom | ( | ) |
Clone the persistent BOM object.
Definition at line 279 of file SIMFQT_Service.cpp.
References buildComplementaryLinks().
Referenced by buildSampleBom(), and parseAndLoad().
void SIMFQT::SIMFQT_Service::buildComplementaryLinks | ( | stdair::BomRoot & | ioBomRoot | ) |
Build all the complementary links in the given bom root object.
Definition at line 315 of file SIMFQT_Service.cpp.
Referenced by buildSampleBom(), clonePersistentBom(), and parseAndLoad().
stdair::BookingRequestStruct SIMFQT::SIMFQT_Service::buildBookingRequest | ( | const bool | isForCRS = false | ) |
Build a BookingRequest structure (for test purposes).
Definition at line 320 of file SIMFQT_Service.cpp.
Referenced by main().
void SIMFQT::SIMFQT_Service::buildSampleTravelSolutions | ( | stdair::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 344 of file SIMFQT_Service.cpp.
Referenced by main().
void SIMFQT::SIMFQT_Service::quotePrices | ( | const stdair::BookingRequestStruct & | iBookingRequest, |
stdair::TravelSolutionList_T & | ioTravelSolutionList | ||
) |
Calculate the prices for a given list of travel solutions.
A stdair::Fare_T attribute is calculated for every travel solution of the list.
stdair::BookingRequestStruct& | Booking request. |
stdair::TravelSolutionList_T& | List of travel solution. |
Definition at line 480 of file SIMFQT_Service.cpp.
Referenced by main().
std::string SIMFQT::SIMFQT_Service::csvDisplay | ( | ) | const |
Recursively display (dump in the returned string) the objects of the BOM tree.
Definition at line 365 of file SIMFQT_Service.cpp.
Referenced by main().
std::string SIMFQT::SIMFQT_Service::csvDisplay | ( | const stdair::TravelSolutionList_T & | ioTravelSolutionList | ) | const |
Display (dump in the returned string) the full list of travel solution structures.
Definition at line 392 of file SIMFQT_Service.cpp.
std::string SIMFQT::SIMFQT_Service::csvDisplay | ( | const stdair::AirportCode_T & | ioOrigin, |
const stdair::AirportCode_T & | ioDestination, | ||
const stdair::Date_T & | ioDepartureDate | ||
) | const |
Recursively display (dump in the returned string) the fare-rules corresponding to the parameters given as input.
const | stdair::AirportCode_T& Origin airport of the fare-rules to display |
const | stdair::AirportCode_T& Destination airport of the fare- rules to display. |
const | stdair::Date_T& Departure date of the fare-rules to display. |
Definition at line 414 of file SIMFQT_Service.cpp.
std::string SIMFQT::SIMFQT_Service::list | ( | ) | const |
Display (dump in the returned string) the airport pairs and the corresponding departure dates of the fare rules stored in the BOM tree.
Definition at line 437 of file SIMFQT_Service.cpp.
bool SIMFQT::SIMFQT_Service::check | ( | const stdair::AirportCode_T & | ioOrigin, |
const stdair::AirportCode_T & | ioDestination, | ||
const stdair::Date_T & | ioDepartureDate | ||
) | 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 458 of file SIMFQT_Service.cpp.