$treeview $search $mathjax
AirInv Logo  1.00.0
$projectbrief
$projectbrief
$searchbox

AIRINV::AIRINV_Master_Service Class Reference

Interface for the AIRINV Services. More...

#include <airinv/AIRINV_Master_Service.hpp>

List of all members.


Public Member Functions

 AIRINV_Master_Service (const stdair::BasLogParams &, const stdair::BasDBParams &)
 AIRINV_Master_Service (const stdair::BasLogParams &)
 AIRINV_Master_Service (stdair::STDAIR_ServicePtr_T)
 AIRINV_Master_Service (stdair::STDAIR_ServicePtr_T, SEVMGR::SEVMGR_ServicePtr_T)
void parseAndLoad (const InventoryFilePath &)
void parseAndLoad (const stdair::ScheduleFilePath &, const stdair::ODFilePath &, const stdair::FRAT5FilePath &, const stdair::FFDisutilityFilePath &, const AIRRAC::YieldFilePath &)
 ~AIRINV_Master_Service ()
void initSnapshotAndRMEvents (const stdair::Date_T &, const stdair::Date_T &)
void buildSampleBom ()
void clonePersistentBom ()
void buildComplementaryLinks (stdair::BomRoot &)
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::SnapshotStruct &)
void optimise (const stdair::RMEventStruct &)
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 47 of file AIRINV_Master_Service.hpp.


Constructor & Destructor Documentation

AIRINV::AIRINV_Master_Service::AIRINV_Master_Service ( const stdair::BasLogParams &  ,
const stdair::BasDBParams &   
)

Constructor.

The initSlaveAirinvService() 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:
const stdair::BasLogParams& Parameters for the output log stream.
const stdair::BasDBParams& Parameters for the database access.

Definition at line 46 of file AIRINV_Master_Service.cpp.

AIRINV::AIRINV_Master_Service::AIRINV_Master_Service ( const stdair::BasLogParams &   ) 

Constructor.

The initSlaveAirinvService() 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:
const stdair::BasLogParams& Parameters for the output log stream.

Definition at line 68 of file AIRINV_Master_Service.cpp.

AIRINV::AIRINV_Master_Service::AIRINV_Master_Service ( stdair::STDAIR_ServicePtr_T   ) 

Constructor.

The initSlaveAirinvService() 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_T Reference on the STDAIR service.

Definition at line 89 of file AIRINV_Master_Service.cpp.

AIRINV::AIRINV_Master_Service::AIRINV_Master_Service ( stdair::STDAIR_ServicePtr_T  ,
SEVMGR::SEVMGR_ServicePtr_T   
)

Constructor.

The initSlaveAirinvService() 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_T Reference on the STDAIR service.
stdair::SEVMGR_ServicePtr_T Reference on the SEVMGR service.

Definition at line 106 of file AIRINV_Master_Service.cpp.

AIRINV::AIRINV_Master_Service::~AIRINV_Master_Service (  ) 

Destructor.

Definition at line 127 of file AIRINV_Master_Service.cpp.


Member Function Documentation

void AIRINV::AIRINV_Master_Service::parseAndLoad ( const InventoryFilePath  ) 

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:
const InventoryFilePath& Filename of the input inventory file.

Definition at line 255 of file AIRINV_Master_Service.cpp.

References clonePersistentBom(), AIRINV::AIRINV_Master_ServiceContext::getAIRINV_Service(), AIRINV::AIRINV_Master_ServiceContext::getOwnStdairServiceFlag(), and AIRINV::AIRINV_Service::parseAndLoad().

void AIRINV::AIRINV_Master_Service::parseAndLoad ( const stdair::ScheduleFilePath &  ,
const stdair::ODFilePath &  ,
const stdair::FRAT5FilePath &  ,
const stdair::FFDisutilityFilePath &  ,
const AIRRAC::YieldFilePath &   
)

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:
const stdair::ScheduleFilePath& Filename of the input schedule file.
const stdair::ODFilePath& Filename of the input O&D file.
const stdair::FRAT5FilePath& Filename of the input FRAT5 file.
const stdair::FFDisutilityFilePath& Filename of the input FF disutility file.
const AIRRAC::YieldFilePath& Filename of the input yield file.

Definition at line 353 of file AIRINV_Master_Service.cpp.

References buildComplementaryLinks(), clonePersistentBom(), AIRINV::AIRINV_Master_ServiceContext::getAIRINV_Service(), AIRINV::AIRINV_Master_ServiceContext::getOwnStdairServiceFlag(), AIRINV::AIRINV_Master_ServiceContext::getSTDAIR_Service(), and AIRINV::AIRINV_Service::parseAndLoad().

void AIRINV::AIRINV_Master_Service::initSnapshotAndRMEvents ( const stdair::Date_T &  ,
const stdair::Date_T &   
)

Initialise the snapshot and RM events for the inventories.

Parameters:
const stdiar::Date_T& Parameters for the start date.
const stdiar::Date_T& Parameters for the end date.

Definition at line 647 of file AIRINV_Master_Service.cpp.

References AIRINV::AIRINV_Master_ServiceContext::getAIRINV_Service(), AIRINV::AIRINV_Master_ServiceContext::getSEVMGR_ServicePtr(), and AIRINV::AIRINV_Service::initRMEvents().

void AIRINV::AIRINV_Master_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 291 of file AIRINV_Master_Service.cpp.

References buildComplementaryLinks(), AIRINV::AIRINV_Service::buildSampleBom(), clonePersistentBom(), AIRINV::AIRINV_Master_ServiceContext::getAIRINV_Service(), AIRINV::AIRINV_Master_ServiceContext::getOwnStdairServiceFlag(), and AIRINV::AIRINV_Master_ServiceContext::getSTDAIR_Service().

void AIRINV::AIRINV_Master_Service::clonePersistentBom (  ) 

void AIRINV::AIRINV_Master_Service::buildComplementaryLinks ( stdair::BomRoot &   ) 

Build all the complementary links in the given bom root object.

Note:
Do nothing for now.

Definition at line 466 of file AIRINV_Master_Service.cpp.

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

void AIRINV::AIRINV_Master_Service::calculateAvailability ( stdair::TravelSolutionStruct &   ) 

Compute the availability for the given travel solution.

Definition at line 684 of file AIRINV_Master_Service.cpp.

References AIRINV::AIRINV_Service::calculateAvailability(), and AIRINV::AIRINV_Master_ServiceContext::getAIRINV_Service().

bool AIRINV::AIRINV_Master_Service::sell ( const std::string &  iSegmentDateKey,
const stdair::ClassCode_T &  ,
const stdair::PartySize_T &   
)

Register a booking.

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

Definition at line 714 of file AIRINV_Master_Service.cpp.

References AIRINV::AIRINV_Master_ServiceContext::getAIRINV_Service(), and AIRINV::AIRINV_Service::sell().

bool AIRINV::AIRINV_Master_Service::sell ( const stdair::BookingClassID_T &  ,
const stdair::PartySize_T &   
)

Register a booking.

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

Definition at line 756 of file AIRINV_Master_Service.cpp.

References AIRINV::AIRINV_Master_ServiceContext::getAIRINV_Service(), and AIRINV::AIRINV_Service::sell().

bool AIRINV::AIRINV_Master_Service::cancel ( const std::string &  iSegmentDateKey,
const stdair::ClassCode_T &  ,
const stdair::PartySize_T &   
)

Register a cancellation.

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

Definition at line 797 of file AIRINV_Master_Service.cpp.

References AIRINV::AIRINV_Service::cancel(), and AIRINV::AIRINV_Master_ServiceContext::getAIRINV_Service().

bool AIRINV::AIRINV_Master_Service::cancel ( const stdair::BookingClassID_T &  ,
const stdair::PartySize_T &   
)

Register a cancellation.

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

Definition at line 839 of file AIRINV_Master_Service.cpp.

References AIRINV::AIRINV_Service::cancel(), and AIRINV::AIRINV_Master_ServiceContext::getAIRINV_Service().

void AIRINV::AIRINV_Master_Service::takeSnapshots ( const stdair::SnapshotStruct &   ) 

void AIRINV::AIRINV_Master_Service::optimise ( const stdair::RMEventStruct &   ) 

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

Definition at line 907 of file AIRINV_Master_Service.cpp.

References AIRINV::AIRINV_Master_ServiceContext::getAIRINV_Service(), and AIRINV::AIRINV_Service::optimise().

std::string AIRINV::AIRINV_Master_Service::jsonHandler ( const stdair::JSONString &   )  const

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

Parameters:
const stdair::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 472 of file AIRINV_Master_Service.cpp.

References AIRINV::AIRINV_Master_ServiceContext::getAIRINV_Service(), and AIRINV::AIRINV_Service::jsonHandler().

std::string AIRINV::AIRINV_Master_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:
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 496 of file AIRINV_Master_Service.cpp.

References AIRINV::AIRINV_Master_ServiceContext::getAIRINV_Service(), and AIRINV::AIRINV_Service::jsonExportFlightDateList().

std::string AIRINV::AIRINV_Master_Service::jsonExportFlightDateObjects ( const stdair::AirlineCode_T &  ,
const stdair::FlightNumber_T &  ,
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:
const stdair::AirlineCode_T& Airline code of the flight to dump.
const stdair::FlightNumber_T& Flight number of the flight to dump.
const stdair::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 521 of file AIRINV_Master_Service.cpp.

References AIRINV::AIRINV_Master_ServiceContext::getAIRINV_Service(), and AIRINV::AIRINV_Service::jsonExportFlightDateObjects().

std::string AIRINV::AIRINV_Master_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:
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.
Returns:
std::string Output string in which the BOM tree is logged/dumped.

Definition at line 548 of file AIRINV_Master_Service.cpp.

References AIRINV::AIRINV_Master_ServiceContext::getAIRINV_Service(), and AIRINV::AIRINV_Service::list().

bool AIRINV::AIRINV_Master_Service::check ( const stdair::AirlineCode_T &  ,
const stdair::FlightNumber_T &  ,
const stdair::Date_T &  iDepartureDate 
) const

Check whether the given flight-date is a valid one.

Parameters:
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.
Returns:
bool Whether or not the given flight date is valid.

Definition at line 573 of file AIRINV_Master_Service.cpp.

References AIRINV::AIRINV_Service::check(), and AIRINV::AIRINV_Master_ServiceContext::getAIRINV_Service().

std::string AIRINV::AIRINV_Master_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 598 of file AIRINV_Master_Service.cpp.

References AIRINV::AIRINV_Service::csvDisplay(), and AIRINV::AIRINV_Master_ServiceContext::getAIRINV_Service().

std::string AIRINV::AIRINV_Master_Service::csvDisplay ( const stdair::AirlineCode_T &  ,
const stdair::FlightNumber_T &  ,
const stdair::Date_T &  iDepartureDate 
) const

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

Parameters:
const stdair::AirlineCode_T& Airline code of the flight to display.
const stdair::FlightNumber_T& Flight number of the flight to display.
const stdair::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 621 of file AIRINV_Master_Service.cpp.

References AIRINV::AIRINV_Service::csvDisplay(), and AIRINV::AIRINV_Master_ServiceContext::getAIRINV_Service().


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