AirInv Logo  1.00.0
C++ Simulated Airline Inventory Management System library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AIRINV::AIRINV_Service Class Reference

Interface for the AIRINV Services. More...

#include <airinv/AIRINV_Service.hpp>

List of all members.

Public Member Functions

 AIRINV_Service (const stdair::BasLogParams &, const stdair::BasDBParams &)
 AIRINV_Service (const stdair::BasLogParams &)
 AIRINV_Service (stdair::STDAIR_ServicePtr_T)
 AIRINV_Service (stdair::STDAIR_ServicePtr_T, SEVMGR::SEVMGR_ServicePtr_T)
void parseAndLoad (const AIRINV::InventoryFilePath &)
void parseAndLoad (const stdair::ScheduleFilePath &, const stdair::ODFilePath &, const stdair::FRAT5FilePath &, const stdair::FFDisutilityFilePath &, const AIRRAC::YieldFilePath &)
 ~AIRINV_Service ()
void buildSampleBom ()
void clonePersistentBom ()
void buildComplementaryLinks (stdair::BomRoot &)
stdair::RMEventList_T initRMEvents (const stdair::Date_T &iStartDate, const stdair::Date_T &iEndDate)
void calculateAvailability (stdair::TravelSolutionStruct &)
bool sell (const std::string &iSegmentDateKey, const stdair::ClassCode_T &, const stdair::PartySize_T &)
bool sell (const stdair::BookingClassID_T &, const stdair::PartySize_T &)
bool cancel (const std::string &iSegmentDateKey, const stdair::ClassCode_T &, const stdair::PartySize_T &)
bool cancel (const stdair::BookingClassID_T &, const stdair::PartySize_T &)
void takeSnapshots (const stdair::AirlineCode_T &, const stdair::DateTime_T &)
void optimise (const stdair::AirlineCode_T &, const stdair::KeyDescription_T &, const stdair::DateTime_T &)
std::string jsonHandler (const stdair::JSONString &) const
std::string jsonExportFlightDateList (const stdair::AirlineCode_T &iAirlineCode="all", const stdair::FlightNumber_T &iFlightNumber=0) const
std::string jsonExportFlightDateObjects (const stdair::AirlineCode_T &, const stdair::FlightNumber_T &, const stdair::Date_T &iDepartureDate) const
std::string list (const stdair::AirlineCode_T &iAirlineCode="all", const stdair::FlightNumber_T &iFlightNumber=0) const
bool check (const stdair::AirlineCode_T &, const stdair::FlightNumber_T &, const stdair::Date_T &iDepartureDate) const
std::string csvDisplay () const
std::string csvDisplay (const stdair::AirlineCode_T &, const stdair::FlightNumber_T &, const stdair::Date_T &iDepartureDate) const

Detailed Description

Interface for the AIRINV Services.

Definition at line 40 of file AIRINV_Service.hpp.


Constructor & Destructor Documentation

AIRINV::AIRINV_Service::AIRINV_Service ( const stdair::BasLogParams &  iLogParams,
const stdair::BasDBParams &  iDBParams 
)

Constructor.

The initAirinvService() 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 a session can be created on the corresponding database.

Parameters:
conststdair::BasLogParams& Parameters for the output log stream.
conststdair::BasDBParams& Parameters for the database access.

Definition at line 89 of file AIRINV_Service.cpp.

AIRINV::AIRINV_Service::AIRINV_Service ( const stdair::BasLogParams &  iLogParams)

Constructor.

The initAirinvService() 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 60 of file AIRINV_Service.cpp.

AIRINV::AIRINV_Service::AIRINV_Service ( stdair::STDAIR_ServicePtr_T  ioSTDAIR_Service_ptr)

Constructor.

The initAirinvService() 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 AIRINV_Master_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 120 of file AIRINV_Service.cpp.

AIRINV::AIRINV_Service::AIRINV_Service ( stdair::STDAIR_ServicePtr_T  ioSTDAIR_Service_ptr,
SEVMGR::SEVMGR_ServicePtr_T  ioSEVMGR_Service_ptr 
)

Constructor.

The initAirinvService() 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 AIRINV_Master_Service is itself being initialised by another library service such as SIMCRS_Service).

Parameters:
stdair::STDAIR_ServicePtr_TReference on the STDAIR service.
stdair::SEVMGR_ServicePtr_TReference on the SEVMGR service.

Definition at line 148 of file AIRINV_Service.cpp.

AIRINV::AIRINV_Service::~AIRINV_Service ( )

Destructor.

Definition at line 177 of file AIRINV_Service.cpp.


Member Function Documentation

void AIRINV::AIRINV_Service::parseAndLoad ( const AIRINV::InventoryFilePath iInventoryInputFilename)

Parse the inventory dump and load it into memory.

The CSV file, describing the airline inventory for the simulator, is parsed and instantiated in memory accordingly.

Parameters:
constAIRINV::InventoryFilePath& Filename of the input inventory file.

Definition at line 346 of file AIRINV_Service.cpp.

References buildComplementaryLinks(), AIRINV::InventoryParser::buildInventory(), and clonePersistentBom().

Referenced by AIRINV::AIRINV_Master_Service::parseAndLoad().

void AIRINV::AIRINV_Service::parseAndLoad ( const stdair::ScheduleFilePath &  iScheduleInputFilename,
const stdair::ODFilePath &  iODInputFilename,
const stdair::FRAT5FilePath &  iFRAT5InputFilename,
const stdair::FFDisutilityFilePath &  iFFDisutilityInputFilename,
const AIRRAC::YieldFilePath &  iYieldFilename 
)

Parse the schedule and O&D input files, and load them into memory.

The CSV files, describing the airline schedule and the O&Ds for the simulator, are parsed and instantiated in memory accordingly.

Parameters:
conststdair::ScheduleFilePath& Filename of the input schedule file.
conststdair::ODFilePath& Filename of the input O&D file.
conststdair::FRAT5FilePath& Filename of the input FRAT5 file.
conststdair::FFDisutilityFilePath& Filename of the input FF disutility file.
constAIRRAC::YieldFilePath& Filename of the input yield file.

Definition at line 404 of file AIRINV_Service.cpp.

References buildComplementaryLinks(), clonePersistentBom(), AIRINV::ScheduleParser::generateInventories(), AIRINV::FRAT5Parser::parse(), and AIRINV::FFDisutilityParser::parse().

void AIRINV::AIRINV_Service::buildSampleBom ( )

Build a sample BOM tree, and attach it to the BomRoot instance.

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

Definition at line 487 of file AIRINV_Service.cpp.

References buildComplementaryLinks(), and clonePersistentBom().

Referenced by AIRINV::AIRINV_Master_Service::buildSampleBom().

void AIRINV::AIRINV_Service::clonePersistentBom ( )

Clone the persistent BOM object.

Definition at line 570 of file AIRINV_Service.cpp.

References buildComplementaryLinks().

Referenced by buildSampleBom(), AIRINV::AIRINV_Master_Service::clonePersistentBom(), and parseAndLoad().

void AIRINV::AIRINV_Service::buildComplementaryLinks ( stdair::BomRoot &  ioBomRoot)

Build all the complementary links in the given bom root object. For instance, build the links between leg and segment date (as well as leg and segment cabin).

Definition at line 608 of file AIRINV_Service.cpp.

References AIRINV::InventoryManager::buildSimilarSegmentCabinSets(), AIRINV::InventoryManager::createDirectAccesses(), AIRINV::InventoryManager::initialiseListsOfUsablePolicies(), AIRINV::InventoryManager::initialiseYieldBasedNestingStructures(), and AIRINV::InventoryManager::setDefaultBidPriceVector().

Referenced by buildSampleBom(), clonePersistentBom(), and parseAndLoad().

stdair::RMEventList_T AIRINV::AIRINV_Service::initRMEvents ( const stdair::Date_T &  iStartDate,
const stdair::Date_T &  iEndDate 
)

Initialise the RM events for the inventory.

Parameters:
conststdair::Date_T& Parameters for the start date.
conststdair::Date_T& Parameters for the end date.

Definition at line 920 of file AIRINV_Service.cpp.

Referenced by AIRINV::AIRINV_Master_Service::initSnapshotAndRMEvents().

void AIRINV::AIRINV_Service::calculateAvailability ( stdair::TravelSolutionStruct &  ioTravelSolution)

Compute the availability for the given travel solution.

Definition at line 952 of file AIRINV_Service.cpp.

Referenced by AIRINV::AIRINV_Master_Service::calculateAvailability().

bool AIRINV::AIRINV_Service::sell ( const std::string &  iSegmentDateKey,
const stdair::ClassCode_T &  iClassCode,
const stdair::PartySize_T &  iPartySize 
)

Register a booking.

Parameters:
conststd::string& Key for the segment on which the sale is made
conststdair::ClassCode_T& Class code where the sale is made
conststdair::PartySize_T& Party size
Returns:
bool Whether or not the sale was successfull

Definition at line 978 of file AIRINV_Service.cpp.

Referenced by AIRINV::AIRINV_Master_Service::sell(), and sell().

bool AIRINV::AIRINV_Service::sell ( const stdair::BookingClassID_T &  iClassID,
const stdair::PartySize_T &  iPartySize 
)

Register a booking.

Parameters:
conststdair::BookingClassID_T&
conststdair::PartySize_T& Party size
Returns:
bool Whether or not the sale was successfull

Definition at line 1019 of file AIRINV_Service.cpp.

References sell().

bool AIRINV::AIRINV_Service::cancel ( const std::string &  iSegmentDateKey,
const stdair::ClassCode_T &  iClassCode,
const stdair::PartySize_T &  iPartySize 
)

Register a cancellation.

Parameters:
conststd::string& Key for the segment on which the cancellation is made
conststdair::ClassCode_T& Class code where the sale is made
conststdair::PartySize_T& Party size
Returns:
bool Whether or not the cancellation was successfull

Definition at line 1036 of file AIRINV_Service.cpp.

Referenced by AIRINV::AIRINV_Master_Service::cancel(), and cancel().

bool AIRINV::AIRINV_Service::cancel ( const stdair::BookingClassID_T &  iClassID,
const stdair::PartySize_T &  iPartySize 
)

Register a cancellation.

Parameters:
conststdair::BookingClassID_T&
conststdair::PartySize_T& Party size
Returns:
bool Whether or not the cancellation was successfull

Definition at line 1080 of file AIRINV_Service.cpp.

References cancel().

void AIRINV::AIRINV_Service::takeSnapshots ( const stdair::AirlineCode_T &  iAirlineCode,
const stdair::DateTime_T &  iSnapshotTime 
)

Take inventory snapshots.

Definition at line 1097 of file AIRINV_Service.cpp.

Referenced by AIRINV::AIRINV_Master_Service::takeSnapshots().

void AIRINV::AIRINV_Service::optimise ( const stdair::AirlineCode_T &  iAirlineCode,
const stdair::KeyDescription_T &  iFDDescription,
const stdair::DateTime_T &  iRMEventTime 
)

Optimise (revenue management) an flight-date/network-date

Definition at line 1124 of file AIRINV_Service.cpp.

Referenced by AIRINV::AIRINV_Master_Service::optimise().

std::string AIRINV::AIRINV_Service::jsonHandler ( const stdair::JSONString &  iJSONString) const

Dispatch the JSon command string to the right JSon Service, according to the JSon command type.

Parameters:
conststdair::JSONString& Input string which contained the JSon command string.
Returns:
std::string Output string in which the asking objects are logged/dumped in a JSon format.

Definition at line 646 of file AIRINV_Service.cpp.

References csvDisplay(), jsonExportFlightDateList(), jsonExportFlightDateObjects(), and list().

Referenced by AIRINV::AIRINV_Master_Service::jsonHandler().

std::string AIRINV::AIRINV_Service::jsonExportFlightDateList ( const stdair::AirlineCode_T &  iAirlineCode = "all",
const stdair::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 778 of file AIRINV_Service.cpp.

Referenced by AIRINV::AIRINV_Master_Service::jsonExportFlightDateList(), and jsonHandler().

std::string AIRINV::AIRINV_Service::jsonExportFlightDateObjects ( const stdair::AirlineCode_T &  iAirlineCode,
const stdair::FlightNumber_T &  iFlightNumber,
const stdair::Date_T &  iDepartureDate 
) const

Recursively dump, in the returned string and in JSON format, the flight-date corresponding to the parameters given as input.

Parameters:
conststdair::AirlineCode_T& Airline code of the flight to dump.
conststdair::FlightNumber_T& Flight number of the flight to dump.
conststdair::Date_T& Departure date of the flight to dump.
Returns:
std::string Output string in which the BOM tree is JSON-ified.

Definition at line 801 of file AIRINV_Service.cpp.

Referenced by AIRINV::AIRINV_Master_Service::jsonExportFlightDateObjects(), and jsonHandler().

std::string AIRINV::AIRINV_Service::list ( const stdair::AirlineCode_T &  iAirlineCode = "all",
const stdair::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 826 of file AIRINV_Service.cpp.

Referenced by jsonHandler(), and AIRINV::AIRINV_Master_Service::list().

bool AIRINV::AIRINV_Service::check ( const stdair::AirlineCode_T &  iAirlineCode,
const stdair::FlightNumber_T &  iFlightNumber,
const stdair::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 850 of file AIRINV_Service.cpp.

Referenced by AIRINV::AIRINV_Master_Service::check().

std::string AIRINV::AIRINV_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 874 of file AIRINV_Service.cpp.

Referenced by AIRINV::AIRINV_Master_Service::csvDisplay(), and jsonHandler().

std::string AIRINV::AIRINV_Service::csvDisplay ( const stdair::AirlineCode_T &  iAirlineCode,
const stdair::FlightNumber_T &  iFlightNumber,
const stdair::Date_T &  iDepartureDate 
) const

Recursively display (dump in the returned string) the flight-date corresponding to the parameters given as input.

Parameters:
conststdair::AirlineCode_T& Airline code of the flight to display
conststdair::FlightNumber_T& Flight number of the flight to display.
conststdair::Date_T& Departure date of the flight to display.
Returns:
std::string Output string in which the BOM tree is logged/dumped.

Definition at line 896 of file AIRINV_Service.cpp.


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