$treeview $search $mathjax
00001 // ////////////////////////////////////////////////////////////////////// 00002 // Import section 00003 // ////////////////////////////////////////////////////////////////////// 00004 // STL 00005 #include <cassert> 00006 #include <sstream> 00007 // StdAir 00008 #include <stdair/basic/BasConst_Inventory.hpp> 00009 #include <stdair/bom/BomManager.hpp> 00010 #include <stdair/bom/Inventory.hpp> 00011 #include <stdair/bom/FlightDate.hpp> 00012 00013 namespace stdair { 00014 00015 // //////////////////////////////////////////////////////////////////// 00016 Inventory::Inventory() : 00017 _key (DEFAULT_AIRLINE_CODE), 00018 _parent (NULL), 00019 _airlineFeature (NULL) { 00020 // That constructor is used by the serialisation process 00021 } 00022 00023 // //////////////////////////////////////////////////////////////////// 00024 Inventory::Inventory (const Inventory& iInventory) 00025 : _key (iInventory._key), 00026 _parent (NULL), 00027 _airlineFeature (NULL) { 00028 } 00029 00030 // //////////////////////////////////////////////////////////////////// 00031 Inventory::Inventory (const Key_T& iKey) : 00032 _key (iKey), 00033 _parent (NULL), 00034 _airlineFeature (NULL) { 00035 } 00036 00037 // //////////////////////////////////////////////////////////////////// 00038 Inventory::~Inventory() { 00039 } 00040 00041 // //////////////////////////////////////////////////////////////////// 00042 std::string Inventory::toString() const { 00043 std::ostringstream oStr; 00044 oStr << describeKey(); 00045 return oStr.str(); 00046 } 00047 00048 // //////////////////////////////////////////////////////////////////// 00049 FlightDate* Inventory:: 00050 getFlightDate (const std::string& iFlightDateKeyStr) const { 00051 FlightDate* oFlightDate_ptr = 00052 BomManager::getObjectPtr<FlightDate> (*this, iFlightDateKeyStr); 00053 return oFlightDate_ptr; 00054 } 00055 00056 // //////////////////////////////////////////////////////////////////// 00057 FlightDate* Inventory:: 00058 getFlightDate (const FlightDateKey& iFlightDateKey) const { 00059 return getFlightDate (iFlightDateKey.toString()); 00060 } 00061 00062 // //////////////////////////////////////////////////////////////////// 00063 ForecastingMethod::EN_ForecastingMethod Inventory:: 00064 getForecastingMethod() const { 00065 assert (_airlineFeature != NULL); 00066 return _airlineFeature->getForecastingMethod(); 00067 } 00068 00069 // //////////////////////////////////////////////////////////////////// 00070 UnconstrainingMethod::EN_UnconstrainingMethod Inventory:: 00071 getUnconstrainingMethod() const { 00072 assert (_airlineFeature != NULL); 00073 return _airlineFeature->getUnconstrainingMethod(); 00074 } 00075 00076 // //////////////////////////////////////////////////////////////////// 00077 PreOptimisationMethod::EN_PreOptimisationMethod Inventory:: 00078 getPreOptimisationMethod() const { 00079 assert (_airlineFeature != NULL); 00080 return _airlineFeature->getPreOptimisationMethod(); 00081 } 00082 00083 // //////////////////////////////////////////////////////////////////// 00084 OptimisationMethod::EN_OptimisationMethod Inventory:: 00085 getOptimisationMethod() const { 00086 assert (_airlineFeature != NULL); 00087 return _airlineFeature->getOptimisationMethod(); 00088 } 00089 00090 // //////////////////////////////////////////////////////////////////// 00091 PartnershipTechnique::EN_PartnershipTechnique Inventory:: 00092 getPartnershipTechnique() const { 00093 assert (_airlineFeature != NULL); 00094 return _airlineFeature->getPartnershipTechnique(); 00095 } 00096 00097 } 00098