1.00.26
C++ Standard Airline IT Object Library
Toggle main menu visibility
Loading...
Searching...
No Matches
YieldFeatures.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_Request.hpp
>
9
#include <
stdair/service/Logger.hpp
>
10
#include <
stdair/bom/YieldFeatures.hpp
>
11
12
namespace
stdair
{
13
14
// ////////////////////////////////////////////////////////////////////
15
YieldFeatures::YieldFeatures
()
16
: _key (
TRIP_TYPE_ONE_WAY
,
17
DEFAULT_PREFERRED_CABIN
),
18
_parent (NULL) {
19
// That constructor is used by the serialisation process
20
}
21
22
// ////////////////////////////////////////////////////////////////////
23
YieldFeatures::YieldFeatures (
const
YieldFeatures& iFeatures)
24
: _key (iFeatures.getKey()), _parent (NULL) {
25
}
26
27
// ////////////////////////////////////////////////////////////////////
28
YieldFeatures::YieldFeatures
(
const
Key_T
& iKey)
29
:
_key
(iKey),
_parent
(NULL) {
30
}
31
32
// ////////////////////////////////////////////////////////////////////
33
YieldFeatures::~YieldFeatures
() {
34
}
35
36
// ////////////////////////////////////////////////////////////////////
37
std::string
YieldFeatures::toString
()
const
{
38
std::ostringstream oStr;
39
oStr <<
describeKey
();
40
return
oStr.str();
41
}
42
43
// ////////////////////////////////////////////////////////////////////
44
bool
YieldFeatures::
45
isTripTypeValid
(
const
TripType_T
& iBookingRequestTripType)
const
{
46
bool
oIsTripTypeValidFlag =
true
;
47
48
// Check whether the yield trip type is the same as the booking request
49
// trip type
50
const
TripType_T
& lYieldTripType =
getTripType
();
51
if
(iBookingRequestTripType == lYieldTripType) {
52
// One way case
53
return
oIsTripTypeValidFlag;
54
}
55
56
if
(iBookingRequestTripType ==
TRIP_TYPE_INBOUND
||
57
iBookingRequestTripType ==
TRIP_TYPE_OUTBOUND
) {
58
// Round trip case.
59
if
(lYieldTripType ==
TRIP_TYPE_ROUND_TRIP
) {
60
return
oIsTripTypeValidFlag;
61
}
62
}
63
64
oIsTripTypeValidFlag =
false
;
65
return
false
;
66
}
67
68
}
69
BasConst_Request.hpp
YieldFeatures.hpp
Logger.hpp
stdair
Handle on the StdAir library context.
Definition
BasChronometer.cpp:9
stdair::TripType_T
std::string TripType_T
Definition
stdair_basic_types.hpp:64
stdair::TRIP_TYPE_INBOUND
const TripType_T TRIP_TYPE_INBOUND
stdair::TRIP_TYPE_ROUND_TRIP
const TripType_T TRIP_TYPE_ROUND_TRIP
stdair::DEFAULT_PREFERRED_CABIN
const CabinCode_T DEFAULT_PREFERRED_CABIN
stdair::TRIP_TYPE_OUTBOUND
const TripType_T TRIP_TYPE_OUTBOUND
stdair::TRIP_TYPE_ONE_WAY
const TripType_T TRIP_TYPE_ONE_WAY
stdair::YieldFeatures::~YieldFeatures
virtual ~YieldFeatures()
Definition
YieldFeatures.cpp:33
stdair::YieldFeatures::toString
std::string toString() const
Definition
YieldFeatures.cpp:37
stdair::YieldFeatures::getTripType
const TripType_T & getTripType() const
Definition
YieldFeatures.hpp:95
stdair::YieldFeatures::Key_T
YieldFeaturesKey Key_T
Definition
YieldFeatures.hpp:29
stdair::YieldFeatures::isTripTypeValid
bool isTripTypeValid(const TripType_T &) const
Definition
YieldFeatures.cpp:45
stdair::YieldFeatures::describeKey
const std::string describeKey() const
Definition
YieldFeatures.hpp:58
stdair::YieldFeatures::_key
Key_T _key
Definition
YieldFeatures.hpp:138
stdair::YieldFeatures::_parent
BomAbstract * _parent
Definition
YieldFeatures.hpp:143
stdair::YieldFeatures::YieldFeatures
YieldFeatures(const Key_T &)
Definition
YieldFeatures.cpp:28
Generated for StdAir by
1.17.0