StdAir Logo  1.00.10
C++ Standard Airline IT Object Library
Inventory.cpp
Go to the documentation of this file.
1 // //////////////////////////////////////////////////////////////////////
2 // Import section
3 // //////////////////////////////////////////////////////////////////////
4 // STL
5 #include <cassert>
6 #include <sstream>
7 // StdAir
10 #include <stdair/bom/Inventory.hpp>
12 
13 namespace stdair {
14 
15  // ////////////////////////////////////////////////////////////////////
16  Inventory::Inventory() :
17  _key (DEFAULT_AIRLINE_CODE),
18  _parent (NULL),
19  _airlineFeature (NULL) {
20  // That constructor is used by the serialisation process
21  }
22 
23  // ////////////////////////////////////////////////////////////////////
24  Inventory::Inventory (const Inventory& iInventory)
25  : _key (iInventory._key),
26  _parent (NULL),
27  _airlineFeature (NULL) {
28  }
29 
30  // ////////////////////////////////////////////////////////////////////
31  Inventory::Inventory (const Key_T& iKey) :
32  _key (iKey),
33  _parent (NULL),
34  _airlineFeature (NULL) {
35  }
36 
37  // ////////////////////////////////////////////////////////////////////
39  }
40 
41  // ////////////////////////////////////////////////////////////////////
42  std::string Inventory::toString() const {
43  std::ostringstream oStr;
44  oStr << describeKey();
45  return oStr.str();
46  }
47 
48  // ////////////////////////////////////////////////////////////////////
50  getFlightDate (const std::string& iFlightDateKeyStr) const {
51  FlightDate* oFlightDate_ptr =
52  BomManager::getObjectPtr<FlightDate> (*this, iFlightDateKeyStr);
53  return oFlightDate_ptr;
54  }
55 
56  // ////////////////////////////////////////////////////////////////////
58  getFlightDate (const FlightDateKey& iFlightDateKey) const {
59  return getFlightDate (iFlightDateKey.toString());
60  }
61 
62  // ////////////////////////////////////////////////////////////////////
64  getForecastingMethod() const {
65  assert (_airlineFeature != NULL);
67  }
68 
69  // ////////////////////////////////////////////////////////////////////
72  assert (_airlineFeature != NULL);
74  }
75 
76  // ////////////////////////////////////////////////////////////////////
79  assert (_airlineFeature != NULL);
81  }
82 
83  // ////////////////////////////////////////////////////////////////////
85  getOptimisationMethod() const {
86  assert (_airlineFeature != NULL);
88  }
89 
90  // ////////////////////////////////////////////////////////////////////
93  assert (_airlineFeature != NULL);
95  }
96 
97 }
98 
stdair::PartnershipTechnique::EN_PartnershipTechnique
EN_PartnershipTechnique
Definition: PartnershipTechnique.hpp:19
stdair::FlightDateKey::toString
const std::string toString() const
Definition: FlightDateKey.cpp:52
stdair::Inventory::getPreOptimisationMethod
PreOptimisationMethod::EN_PreOptimisationMethod getPreOptimisationMethod() const
Definition: Inventory.cpp:78
stdair::AirlineFeature::getForecastingMethod
ForecastingMethod::EN_ForecastingMethod getForecastingMethod() const
Definition: AirlineFeature.hpp:94
stdair::Inventory::getUnconstrainingMethod
UnconstrainingMethod::EN_UnconstrainingMethod getUnconstrainingMethod() const
Definition: Inventory.cpp:71
stdair::FlightDateKey
Key of a given flight-date, made of a flight number and a departure date.
Definition: FlightDateKey.hpp:28
stdair::PreOptimisationMethod::EN_PreOptimisationMethod
EN_PreOptimisationMethod
Definition: PreOptimisationMethod.hpp:17
stdair::AirlineFeature::getPreOptimisationMethod
PreOptimisationMethod::EN_PreOptimisationMethod getPreOptimisationMethod() const
Definition: AirlineFeature.hpp:115
stdair::DEFAULT_AIRLINE_CODE
const AirlineCode_T DEFAULT_AIRLINE_CODE
stdair::AirlineFeature::getUnconstrainingMethod
UnconstrainingMethod::EN_UnconstrainingMethod getUnconstrainingMethod() const
Definition: AirlineFeature.hpp:101
stdair::Inventory::getForecastingMethod
ForecastingMethod::EN_ForecastingMethod getForecastingMethod() const
Definition: Inventory.cpp:64
stdair::Inventory::toString
std::string toString() const
Definition: Inventory.cpp:42
stdair
Handle on the StdAir library context.
Definition: BasChronometer.cpp:9
stdair::ForecastingMethod::EN_ForecastingMethod
EN_ForecastingMethod
Definition: ForecastingMethod.hpp:17
stdair::UnconstrainingMethod::EN_UnconstrainingMethod
EN_UnconstrainingMethod
Definition: UnconstrainingMethod.hpp:17
stdair::AirlineFeature::getOptimisationMethod
OptimisationMethod::EN_OptimisationMethod getOptimisationMethod() const
Definition: AirlineFeature.hpp:122
BasConst_Inventory.hpp
stdair::Inventory::getOptimisationMethod
OptimisationMethod::EN_OptimisationMethod getOptimisationMethod() const
Definition: Inventory.cpp:85
stdair::Inventory::~Inventory
virtual ~Inventory()
Definition: Inventory.cpp:38
stdair::Inventory::_airlineFeature
AirlineFeature * _airlineFeature
Definition: Inventory.hpp:223
stdair::FlightDate
Class representing the actual attributes for an airline flight-date.
Definition: FlightDate.hpp:42
stdair::Inventory::getPartnershipTechnique
PartnershipTechnique::EN_PartnershipTechnique getPartnershipTechnique() const
Definition: Inventory.cpp:92
stdair::AirlineFeature::getPartnershipTechnique
PartnershipTechnique::EN_PartnershipTechnique getPartnershipTechnique() const
Definition: AirlineFeature.hpp:108
FlightDate.hpp
stdair::OptimisationMethod::EN_OptimisationMethod
EN_OptimisationMethod
Definition: OptimisationMethod.hpp:17
BomManager.hpp
Inventory.hpp
stdair::Inventory::getFlightDate
FlightDate * getFlightDate(const std::string &iFlightDateKeyStr) const
Definition: Inventory.cpp:50
stdair::Inventory::describeKey
const std::string describeKey() const
Definition: Inventory.hpp:160
stdair::InventoryKey
Key of a given inventory, made of the airline code.
Definition: InventoryKey.hpp:26