SimFQT Logo  1.00.0
C++ Simulated Fare Quote System Library
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
SIMFQT::SIMFQT_Service Class Reference

Interface for the SIMFQT Services. More...

#include <simfqt/SIMFQT_Service.hpp>

List of all members.

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

Detailed Description

Interface for the SIMFQT Services.

Definition at line 32 of file SIMFQT_Service.hpp.


Constructor & Destructor Documentation

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.

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

Parameters:
conststdair::BasLogParams& Parameters for the output log stream.
conststdair::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).

Parameters:
stdair::STDAIR_ServicePtr_TReference 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.


Member Function Documentation

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.

Parameters:
constFareFilePath& 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.

  • One BOM tree is based on two actual inventories (one for BA, another for AF). Each inventory contains one flight. One of those flights has two legs (and therefore three segments).
  • The other BOM tree is fake, as a hook for RMOL to work.

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.

Note:
Do nothing for now.

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

Returns:
stdair::BookingRequestStruct The created BookingRequest structure.

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:

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

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

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.

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

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.

Parameters:
conststdair::AirportCode_T& Origin airport of the fare-rules to display
conststdair::AirportCode_T& Destination airport of the fare- rules to display.
conststdair::Date_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 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.

Returns:
std::string Output string in which the airport pairs and departure dates are logged/dumped.

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.

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 458 of file SIMFQT_Service.cpp.


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