1.00.0
C++ Standard Airline IT Object Library
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
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
8
#include <
stdair/basic/BasConst_Inventory.hpp
>
9
#include <
stdair/bom/BomManager.hpp
>
10
#include <
stdair/bom/Inventory.hpp
>
11
#include <
stdair/bom/FlightDate.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
// ////////////////////////////////////////////////////////////////////
38
Inventory::~Inventory
() {
39
}
40
41
// ////////////////////////////////////////////////////////////////////
42
std::string
Inventory::toString
()
const
{
43
std::ostringstream oStr;
44
oStr <<
describeKey
();
45
return
oStr.str();
46
}
47
48
// ////////////////////////////////////////////////////////////////////
49
FlightDate
*
Inventory::
50
getFlightDate
(
const
std::string& iFlightDateKeyStr)
const
{
51
FlightDate
* oFlightDate_ptr =
52
BomManager::getObjectPtr<FlightDate> (*
this
, iFlightDateKeyStr);
53
return
oFlightDate_ptr;
54
}
55
56
// ////////////////////////////////////////////////////////////////////
57
FlightDate
*
Inventory::
58
getFlightDate
(
const
FlightDateKey
& iFlightDateKey)
const
{
59
return
getFlightDate
(iFlightDateKey.
toString
());
60
}
61
62
// ////////////////////////////////////////////////////////////////////
63
ForecastingMethod::EN_ForecastingMethod
Inventory::
64
getForecastingMethod
()
const
{
65
assert (
_airlineFeature
!= NULL);
66
return
_airlineFeature
->
getForecastingMethod
();
67
}
68
69
// ////////////////////////////////////////////////////////////////////
70
UnconstrainingMethod::EN_UnconstrainingMethod
Inventory::
71
getUnconstrainingMethod
()
const
{
72
assert (
_airlineFeature
!= NULL);
73
return
_airlineFeature
->
getUnconstrainingMethod
();
74
}
75
76
// ////////////////////////////////////////////////////////////////////
77
PreOptimisationMethod::EN_PreOptimisationMethod
Inventory::
78
getPreOptimisationMethod
()
const
{
79
assert (
_airlineFeature
!= NULL);
80
return
_airlineFeature
->
getPreOptimisationMethod
();
81
}
82
83
// ////////////////////////////////////////////////////////////////////
84
OptimisationMethod::EN_OptimisationMethod
Inventory::
85
getOptimisationMethod
()
const
{
86
assert (
_airlineFeature
!= NULL);
87
return
_airlineFeature
->
getOptimisationMethod
();
88
}
89
90
// ////////////////////////////////////////////////////////////////////
91
PartnershipTechnique::EN_PartnershipTechnique
Inventory::
92
getPartnershipTechnique
()
const
{
93
assert (
_airlineFeature
!= NULL);
94
return
_airlineFeature
->
getPartnershipTechnique
();
95
}
96
97
}
98
Generated on Sat Dec 22 2012 16:51:53 for StdAir by
1.8.1.1