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

Utility class to retrieve StdAir objects. More...

#include <stdair/bom/BomRetriever.hpp>

Static Public Member Functions

static InventoryretrieveInventoryFromLongKey (const BomRoot &, const std::string &iFullKeyStr)
 
static InventoryretrieveInventoryFromLongKey (const Inventory &, const std::string &iFullKeyStr)
 
static InventoryretrieveInventoryFromKey (const BomRoot &, const InventoryKey &)
 
static InventoryretrieveInventoryFromKey (const BomRoot &, const AirlineCode_T &)
 
static AirlineFeatureretrieveAirlineFeatureFromKey (const BomRoot &, const AirlineCode_T &)
 
static FlightDateretrieveFlightDateFromLongKey (const BomRoot &, const std::string &iFullKeyStr)
 
static FlightDateretrieveFlightDateFromKeySet (const BomRoot &, const AirlineCode_T &, const FlightNumber_T &, const Date_T &iFlightDateDate)
 
static FlightDateretrieveFlightDateFromLongKey (const Inventory &, const std::string &iFullKeyStr)
 
static FlightDateretrieveFlightDateFromKey (const Inventory &, const FlightDateKey &)
 
static FlightDateretrieveFlightDateFromKey (const Inventory &, const FlightNumber_T &, const Date_T &iFlightDateDate)
 
static LegDateretrieveOperatingLegDateFromLongKey (const FlightDate &, const std::string &iFullKeyStr)
 
static SegmentDateretrievePartnerSegmentDateFromLongKey (const Inventory &, const std::string &iFullKeyStr)
 
static SegmentDateretrieveSegmentDateFromLongKey (const BomRoot &, const std::string &iFullKeyStr)
 
static SegmentDateretrieveSegmentDateFromLongKey (const Inventory &, const std::string &iFullKeyStr)
 
static SegmentDateretrieveSegmentDateFromLongKey (const FlightDate &, const std::string &iFullKeyStr)
 
static SegmentDateretrieveSegmentDateFromKey (const FlightDate &, const SegmentDateKey &)
 
static SegmentDateretrieveSegmentDateFromKey (const FlightDate &, const AirportCode_T &iOrigin, const AirportCode_T &iDestination)
 
static BookingClassretrieveBookingClassFromLongKey (const Inventory &, const std::string &iFullKeyStr, const ClassCode_T &)
 
static AirportPairretrieveAirportPairFromKeySet (const BomRoot &, const stdair::AirportCode_T &, const stdair::AirportCode_T &)
 
static void retrieveDatePeriodListFromKey (const AirportPair &, const stdair::Date_T &, stdair::DatePeriodList_T &)
 
static void retrieveDatePeriodListFromKeySet (const BomRoot &, const stdair::AirportCode_T &, const stdair::AirportCode_T &, const stdair::Date_T &, stdair::DatePeriodList_T &)
 
static stdair::LegCabinretrieveDummyLegCabin (stdair::BomRoot &, const bool isForFareFamilies=false)
 
static stdair::SegmentCabinretrieveDummySegmentCabin (stdair::BomRoot &, const bool isForFareFamilies=false)
 
static std::string retrieveFullKeyFromSegmentDate (const SegmentDate &)
 

Detailed Description

Utility class to retrieve StdAir objects.

Definition at line 36 of file BomRetriever.hpp.

Member Function Documentation

Inventory * stdair::BomRetriever::retrieveInventoryFromLongKey ( const BomRoot iBomRoot,
const std::string &  iFullKeyStr 
)
static

Retrieve an Inventory object from a (full) key string.

The full key string gathers airline code, flight number, origin and destination, cabin and booking class. It corresponds to the output generated by the toString() methods of the XxxKey structures.

Parameters
constBomRoot& The root of the BOM tree.
conststd::string& The full key string.
Returns
Inventory* The just retrieved Inventory object.

Definition at line 31 of file BomRetriever.cpp.

References stdair::BomKeyManager::extractInventoryKey(), and stdair::BomRoot::getInventory().

Referenced by retrieveFlightDateFromLongKey(), and retrievePartnerSegmentDateFromLongKey().

Inventory * stdair::BomRetriever::retrieveInventoryFromLongKey ( const Inventory iInventory,
const std::string &  iFullKeyStr 
)
static

Retrieve an Inventory object from a (full) key string.

The full key string gathers airline code, flight number, origin and destination, cabin and booking class. It corresponds to the output generated by the toString() methods of the XxxKey structures.

Parameters
constInventory& The root of the BOM tree.
conststd::string& The full key string.
Returns
Inventory* The just retrieved Inventory object.

Definition at line 46 of file BomRetriever.cpp.

References stdair::BomKeyManager::extractInventoryKey(), and stdair::InventoryKey::getAirlineCode().

Inventory * stdair::BomRetriever::retrieveInventoryFromKey ( const BomRoot iBomRoot,
const InventoryKey iKey 
)
static

Retrieve an Inventory object from an InventoryKey structure.

Parameters
constBomRoot& The root of the BOM tree.
constInventoryKey& The key.
Returns
Inventory* The just retrieved Inventory object.

Definition at line 63 of file BomRetriever.cpp.

References stdair::BomRoot::getInventory().

Referenced by retrieveAirlineFeatureFromKey(), retrieveDummyLegCabin(), retrieveDummySegmentCabin(), and retrieveFlightDateFromKeySet().

Inventory * stdair::BomRetriever::retrieveInventoryFromKey ( const BomRoot iBomRoot,
const AirlineCode_T iAirlineCode 
)
static

Retrieve an Inventory object from an InventoryKey structure.

Parameters
constBomRoot& The root of the BOM tree.
constAirlineCode_T& The key.
Returns
Inventory* The just retrieved Inventory object.

Definition at line 75 of file BomRetriever.cpp.

References stdair::BomRoot::getInventory().

AirlineFeature * stdair::BomRetriever::retrieveAirlineFeatureFromKey ( const BomRoot iBomRoot,
const AirlineCode_T iAirlineCode 
)
static

Retrieve an Airline Feature object from an airline code.

Parameters
constBomRoot& The root of the BOM tree.
constAirlineCode_T& The key.
Returns
AirlineFeature* The just retrieved Airline Feature object.

Definition at line 88 of file BomRetriever.cpp.

References retrieveInventoryFromKey().

Referenced by stdair::ConfigHolderStruct::updateAirlineFeatures().

FlightDate * stdair::BomRetriever::retrieveFlightDateFromLongKey ( const BomRoot iBomRoot,
const std::string &  iFullKeyStr 
)
static

Retrieve a FlightDate object from a (full) key string.

The full key string gathers airline code, flight number, origin and destination, cabin and booking class. It corresponds to the output generated by the toString() methods of the XxxKey structures.

Parameters
constBomRoot& The root of the BOM tree.
conststd::string& The full key string.
Returns
FlightDate* The just retrieved FlightDate object.

Definition at line 109 of file BomRetriever.cpp.

References stdair::BomKeyManager::extractFlightDateKey(), stdair::Inventory::getFlightDate(), and retrieveInventoryFromLongKey().

Referenced by retrieveSegmentDateFromLongKey().

FlightDate * stdair::BomRetriever::retrieveFlightDateFromKeySet ( const BomRoot iBomRoot,
const AirlineCode_T iAirlineCode,
const FlightNumber_T iFlightNumber,
const Date_T iFlightDateDate 
)
static

Retrieve a FlightDate object from a set of keys.

Parameters
constBomRoot& The root of the BOM tree.
constAirlineCode_T& The key.
constFlightNumber_T& Part of the key.
constDate_T& Part of the key.
Returns
FlightDate* The just retrieved FlightDate object.

Definition at line 132 of file BomRetriever.cpp.

References retrieveFlightDateFromKey(), and retrieveInventoryFromKey().

Referenced by stdair::STDAIR_Service::check(), stdair::STDAIR_Service::csvDisplay(), and stdair::STDAIR_Service::jsonExportFlightDateObjects().

FlightDate * stdair::BomRetriever::retrieveFlightDateFromLongKey ( const Inventory iInventory,
const std::string &  iFullKeyStr 
)
static

Retrieve a FlightDate object from a (full) key string.

The full key string gathers airline code, flight number, origin and destination, cabin and booking class. It corresponds to the output generated by the toString() methods of the XxxKey structures.

Parameters
constInventory& The root of the BOM tree.
conststd::string& The full key string.
Returns
FlightDate* The just retrieved FlightDate object.

Definition at line 155 of file BomRetriever.cpp.

References stdair::BomKeyManager::extractFlightDateKey(), and stdair::Inventory::getFlightDate().

FlightDate * stdair::BomRetriever::retrieveFlightDateFromKey ( const Inventory iInventory,
const FlightDateKey iKey 
)
static

Retrieve a FlightDate object from an FlightDateKey structure.

Parameters
constInventory& The root of the BOM tree.
constFlightDateKey& The key.
Returns
FlightDate* The just retrieved FlightDate object.

Definition at line 170 of file BomRetriever.cpp.

References stdair::Inventory::getFlightDate().

Referenced by retrieveDummyLegCabin(), retrieveDummySegmentCabin(), retrieveFlightDateFromKeySet(), and retrieveSegmentDateFromLongKey().

FlightDate * stdair::BomRetriever::retrieveFlightDateFromKey ( const Inventory iInventory,
const FlightNumber_T iFlightNumber,
const Date_T iFlightDateDate 
)
static

Retrieve a FlightDate object from an FlightDateKey structure.

Parameters
constInventory& The root of the BOM tree.
constFlightNumber_T& Part of the key.
constDate_T& Part of the key.
Returns
FlightDate* The just retrieved FlightDate object.

Definition at line 182 of file BomRetriever.cpp.

References stdair::Inventory::getFlightDate().

LegDate * stdair::BomRetriever::retrieveOperatingLegDateFromLongKey ( const FlightDate iFlightDate,
const std::string &  iFullKeyStr 
)
static

Retrieve a LegDate object from an FlightDate structure.

The full key string gathers airline code, flight number, origin and destination, cabin and booking class. It corresponds to the output generated by the toString() methods of the XxxKey structures.

Parameters
constFlightDate& The root of the BOM tree.
conststd::string& The full key string.
Returns
LegDate* The just retrieved LegDate object.

Definition at line 266 of file BomRetriever.cpp.

References stdair::BomKeyManager::extractLegDateKey(), and stdair::FlightDate::getLegDate().

SegmentDate * stdair::BomRetriever::retrievePartnerSegmentDateFromLongKey ( const Inventory iInventory,
const std::string &  iFullKeyStr 
)
static

Retrieve a partner SegmentDate object from an Inventory structure.

The full key string gathers airline code, flight number, origin and destination, cabin and booking class. It corresponds to the output generated by the toString() methods of the XxxKey structures.

Parameters
constInventory& The root of the BOM tree.
conststd::string& The full key string.
Returns
SegmentDate* The just retrieved SegmentDate object.

Definition at line 281 of file BomRetriever.cpp.

References stdair::BomKeyManager::extractInventoryKey(), stdair::InventoryKey::getAirlineCode(), retrieveInventoryFromLongKey(), and retrieveSegmentDateFromLongKey().

SegmentDate * stdair::BomRetriever::retrieveSegmentDateFromLongKey ( const BomRoot iBomRoot,
const std::string &  iFullKeyStr 
)
static

Retrieve a SegmentDate object from a (full) key string.

The full key string gathers airline code, segment number, origin and destination, cabin and booking class. It corresponds to the output generated by the toString() methods of the XxxKey structures.

Parameters
constBomRoot& The root of the BOM tree.
conststd::string& The full key string.
Returns
SegmentDate* The just retrieved SegmentDate object.

Definition at line 196 of file BomRetriever.cpp.

References stdair::BomKeyManager::extractSegmentDateKey(), stdair::FlightDate::getSegmentDate(), and retrieveFlightDateFromLongKey().

Referenced by retrieveBookingClassFromLongKey(), and retrievePartnerSegmentDateFromLongKey().

SegmentDate * stdair::BomRetriever::retrieveSegmentDateFromLongKey ( const Inventory iInventory,
const std::string &  iFullKeyStr 
)
static

Retrieve a SegmentDate object from a (full) key string.

The full key string gathers airline code, segment number, origin and destination, cabin and booking class. It corresponds to the output generated by the toString() methods of the XxxKey structures.

Parameters
constInventory& The root of the BOM tree.
conststd::string& The full key string.
Returns
SegmentDate* The just retrieved SegmentDate object.

Definition at line 219 of file BomRetriever.cpp.

References stdair::ParsedKey::_airlineCode, stdair::BomKeyManager::extractKeys(), stdair::Inventory::getAirlineCode(), stdair::ParsedKey::getFlightDateKey(), stdair::ParsedKey::getSegmentKey(), retrieveFlightDateFromKey(), retrieveSegmentDateFromKey(), STDAIR_LOG_DEBUG, stdair::SegmentDateKey::toString(), and stdair::FlightDateKey::toString().

SegmentDate * stdair::BomRetriever::retrieveSegmentDateFromLongKey ( const FlightDate iFlightDate,
const std::string &  iFullKeyStr 
)
static

Retrieve a SegmentDate object from a (full) key string.

The full key string gathers airline code, segment number, origin and destination, cabin and booking class. It corresponds to the output generated by the toString() methods of the XxxKey structures.

Parameters
constFlightDate& The root of the BOM tree.
conststd::string& The full key string.
Returns
SegmentDate* The just retrieved SegmentDate object.

Definition at line 251 of file BomRetriever.cpp.

References stdair::BomKeyManager::extractSegmentDateKey(), and stdair::FlightDate::getSegmentDate().

SegmentDate * stdair::BomRetriever::retrieveSegmentDateFromKey ( const FlightDate iFlightDate,
const SegmentDateKey iKey 
)
static

Retrieve a SegmentDate object from an SegmentDateKey structure.

Parameters
constFlightDate& The root of the BOM tree.
constSegmentDateKey& The key.
Returns
SegmentDate* The just retrieved SegmentDate object.

Definition at line 307 of file BomRetriever.cpp.

References stdair::FlightDate::getSegmentDate().

Referenced by retrieveSegmentDateFromLongKey().

SegmentDate * stdair::BomRetriever::retrieveSegmentDateFromKey ( const FlightDate iFlightDate,
const AirportCode_T iOrigin,
const AirportCode_T iDestination 
)
static

Retrieve a SegmentDate object from an SegmentDateKey structure.

Parameters
constFlightDate& The root of the BOM tree.
constAirportCode_T& Origin, part of the key.
constAirportCode_T& Destination, part of the key.
Returns
SegmentDate* The just retrieved SegmentDate object.

Definition at line 319 of file BomRetriever.cpp.

References stdair::FlightDate::getSegmentDate().

BookingClass * stdair::BomRetriever::retrieveBookingClassFromLongKey ( const Inventory iInventory,
const std::string &  iFullKeyStr,
const ClassCode_T iClassCode 
)
static

Retrieve a BookingClass object from a (full) key string.

The full key string gathers airline code, segment number, origin and destination, cabin and booking class. It corresponds to the output generated by the toString() methods of the XxxKey structures.

Besides being attached to segment-cabin objects (and fare family objects, when they exist), the booking-class objects must also be attached directly to the segment-date.

Hence, if an assertion fails within that method call, chances are that the booking-class objects have not been attached to the segment-date objects. Check, for instance, the CmdBomManager::buildSampleBom() to see how that should be properly done.

Parameters
constInventory& The root of the BOM tree.
conststd::string& Part of the full key string.
constClassCode_T& Part of the full key string.
Returns
BookingClass* The just retrieved BookingClass object.

Definition at line 333 of file BomRetriever.cpp.

References retrieveSegmentDateFromLongKey().

AirportPair * stdair::BomRetriever::retrieveAirportPairFromKeySet ( const BomRoot iBomRoot,
const stdair::AirportCode_T iOrigin,
const stdair::AirportCode_T iDestination 
)
static

Retrieve an AirportPair object from an AirportPair structure.

Parameters
constBomRoot& The root of the BOM tree.
constAirportCode_T& Origin, part of the key.
constAirportCode_T& Destination, part of the key.
Returns
AirportPair* The just retrieved AirportPair object.

Definition at line 355 of file BomRetriever.cpp.

References stdair::AirportPairKey::toString().

Referenced by retrieveDatePeriodListFromKeySet().

void stdair::BomRetriever::retrieveDatePeriodListFromKey ( const AirportPair iAirportPair,
const stdair::Date_T iDepartureDate,
stdair::DatePeriodList_T ioDatePeriodList 
)
static

Retrieve a list of date-period corresponding to a flight date.

Parameters
constAirportPair& The root of the BOM tree.
constDate_T& Departure Date of the flight
stdair::DatePeriodList_T&List of DatePeriod to display.

Definition at line 373 of file BomRetriever.cpp.

References stdair::DatePeriod::isDepartureDateValid().

Referenced by retrieveDatePeriodListFromKeySet().

void stdair::BomRetriever::retrieveDatePeriodListFromKeySet ( const BomRoot iBomRoot,
const stdair::AirportCode_T iOrigin,
const stdair::AirportCode_T iDestination,
const stdair::Date_T iDepartureDate,
stdair::DatePeriodList_T ioDatePeriodList 
)
static

Retrieve a list of date-period from a set of keys.

Parameters
constBomRoot& The root of the BOM tree.
constAirportCode_T& Part of the AirportPair key: the origin airport
constAirportCode_T& Part of the AirportPair key: the destination airport.
constDate_T& Departure date of the flight
stdair::DatePeriodList_T&List of DatePeriod to display.

Definition at line 404 of file BomRetriever.cpp.

References retrieveAirportPairFromKeySet(), and retrieveDatePeriodListFromKey().

Referenced by stdair::STDAIR_Service::check(), and stdair::STDAIR_Service::csvDisplay().

LegCabin & stdair::BomRetriever::retrieveDummyLegCabin ( stdair::BomRoot iBomRoot,
const bool  isForFareFamilies = false 
)
static

Retrieve one sample leg-cabin of the dummy inventory of "XX".

Parameters
stdair::BomRoot&The BOM tree.
constbool Boolean to choose the sample leg-cabin. True: the dummy leg-cabin with fare families. False: the dummy leg-cabin without fare families. By default the value is false.

Definition at line 427 of file BomRetriever.cpp.

References stdair::DEFAULT_AIRLINE_CODE, stdair::DEFAULT_CABIN_CODE, stdair::DEFAULT_DEPARTURE_DATE, stdair::DEFAULT_FLIGHT_NUMBER, stdair::DEFAULT_FLIGHT_NUMBER_FF, stdair::DEFAULT_ORIGIN, stdair::LegDate::getLegCabin(), stdair::FlightDate::getLegDate(), retrieveFlightDateFromKey(), and retrieveInventoryFromKey().

SegmentCabin & stdair::BomRetriever::retrieveDummySegmentCabin ( stdair::BomRoot iBomRoot,
const bool  isForFareFamilies = false 
)
static

Retrieve one sample segment-cabin of the dummy inventory of "XX".

Parameters
stdair::BomRoot&The BOM tree.
constbool Boolean to choose the sample segment-cabin. True: the dummy segment-cabin with fare families. False: the dummy segment-cabin without fare families. By default the value is false.

Definition at line 502 of file BomRetriever.cpp.

References stdair::DEFAULT_AIRLINE_CODE, stdair::DEFAULT_CABIN_CODE, stdair::DEFAULT_DEPARTURE_DATE, stdair::DEFAULT_DESTINATION, stdair::DEFAULT_FLIGHT_NUMBER, stdair::DEFAULT_FLIGHT_NUMBER_FF, stdair::DEFAULT_ORIGIN, stdair::FlightDate::getSegmentDate(), retrieveFlightDateFromKey(), retrieveInventoryFromKey(), and stdair::SegmentCabinKey::toString().

std::string stdair::BomRetriever::retrieveFullKeyFromSegmentDate ( const SegmentDate iSegmentdate)
static

Retrieve the whole key of the segment date, that is to say a string composed of the inventory key, the flight date key and the segment date key.

Parameters
constSegmentDate& Segment date to retrieve the whole key for.
Returns
std::string The just retrieved whole key.

Definition at line 578 of file BomRetriever.cpp.

References stdair::DEFAULT_KEY_SUB_FLD_DELIMITER, stdair::Inventory::describeKey(), and stdair::SegmentDate::describeKey().


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