StdAir Logo  0.45.1
C++ Standard Airline IT Object Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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() : _key (DEFAULT_AIRLINE_CODE), _parent (NULL) {
17  // That constructor is used by the serialisation process
18  }
19 
20  // ////////////////////////////////////////////////////////////////////
21  Inventory::Inventory (const Inventory&)
22  : _key (DEFAULT_AIRLINE_CODE), _parent (NULL) {
23  assert (false);
24  }
25 
26  // ////////////////////////////////////////////////////////////////////
27  Inventory::Inventory (const Key_T& iKey) : _key (iKey), _parent (NULL) {
28  }
29 
30  // ////////////////////////////////////////////////////////////////////
32  }
33 
34  // ////////////////////////////////////////////////////////////////////
35  std::string Inventory::toString() const {
36  std::ostringstream oStr;
37  oStr << describeKey();
38  return oStr.str();
39  }
40 
41  // ////////////////////////////////////////////////////////////////////
43  getFlightDate (const std::string& iFlightDateKeyStr) const {
44  FlightDate* oFlightDate_ptr =
45  BomManager::getObjectPtr<FlightDate> (*this, iFlightDateKeyStr);
46  return oFlightDate_ptr;
47  }
48 
49  // ////////////////////////////////////////////////////////////////////
51  getFlightDate (const FlightDateKey& iFlightDateKey) const {
52  return getFlightDate (iFlightDateKey.toString());
53  }
54 
55 }
56