1.00.26
C++ Standard Airline IT Object Library
Toggle main menu visibility
Loading...
Searching...
No Matches
SegmentDate.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_BookingClass.hpp
>
9
#include <
stdair/basic/BasConst_Inventory.hpp
>
10
#include <
stdair/bom/BomManager.hpp
>
11
#include <
stdair/bom/SegmentDate.hpp
>
12
#include <
stdair/bom/SegmentCabin.hpp
>
13
14
namespace
stdair
{
15
16
// ////////////////////////////////////////////////////////////////////
17
SegmentDate::SegmentDate
()
18
: _key (
DEFAULT_ORIGIN
,
DEFAULT_DESTINATION
), _parent (NULL),
19
_operatingSegmentDate (NULL) {
20
assert (
false
);
21
}
22
23
// ////////////////////////////////////////////////////////////////////
24
SegmentDate::SegmentDate (
const
SegmentDate& iSegmentDate)
25
: _key (iSegmentDate._key),
26
_parent (NULL),
27
_operatingSegmentDate (NULL),
28
_boardingDate (iSegmentDate._boardingDate),
29
_boardingTime (iSegmentDate._boardingTime),
30
_offDate (iSegmentDate._offDate),
31
_offTime (iSegmentDate._offTime),
32
_elapsedTime (iSegmentDate._elapsedTime),
33
_distance (iSegmentDate._distance),
34
_routingLegKeyList (iSegmentDate._routingLegKeyList) {
35
}
36
37
// ////////////////////////////////////////////////////////////////////
38
SegmentDate::SegmentDate
(
const
Key_T
& iKey)
39
:
_key
(iKey),
_parent
(NULL) ,
40
_operatingSegmentDate
(NULL) {
41
}
42
43
// ////////////////////////////////////////////////////////////////////
44
SegmentDate::~SegmentDate
() {
45
}
46
47
// ////////////////////////////////////////////////////////////////////
48
std::string
SegmentDate::toString
()
const
{
49
std::ostringstream oStr;
50
oStr <<
describeKey
();
51
return
oStr.str();
52
}
53
54
// ////////////////////////////////////////////////////////////////////
55
const
Duration_T
SegmentDate::getTimeOffset
()
const
{
56
// TimeOffset = (OffTime - BoardingTime) + (OffDate - BoardingDate) * 24
57
// - ElapsedTime
58
Duration_T
oTimeOffset = (
_offTime
-
_boardingTime
);
59
const
DateOffset_T
& lDateOffset =
getDateOffset
();
60
const
Duration_T
lDateOffsetInHours (lDateOffset.days() * 24, 0, 0);
61
oTimeOffset += lDateOffsetInHours -
_elapsedTime
;
62
return
oTimeOffset;
63
}
64
}
65
BasConst_BookingClass.hpp
BasConst_Inventory.hpp
BomManager.hpp
SegmentCabin.hpp
SegmentDate.hpp
stdair
Handle on the StdAir library context.
Definition
BasChronometer.cpp:9
stdair::DateOffset_T
boost::gregorian::date_duration DateOffset_T
Definition
stdair_date_time_types.hpp:35
stdair::DEFAULT_DESTINATION
const AirportCode_T DEFAULT_DESTINATION
stdair::DEFAULT_ORIGIN
const AirportCode_T DEFAULT_ORIGIN
stdair::Duration_T
boost::posix_time::time_duration Duration_T
Definition
stdair_date_time_types.hpp:17
stdair::SegmentDate::_operatingSegmentDate
SegmentDate * _operatingSegmentDate
Definition
SegmentDate.hpp:332
stdair::SegmentDate::describeKey
const std::string describeKey() const
Definition
SegmentDate.hpp:260
stdair::SegmentDate::~SegmentDate
virtual ~SegmentDate()
Definition
SegmentDate.cpp:44
stdair::SegmentDate::_parent
BomAbstract * _parent
Definition
SegmentDate.hpp:319
stdair::SegmentDate::_boardingTime
Duration_T _boardingTime
Definition
SegmentDate.hpp:350
stdair::SegmentDate::_elapsedTime
Duration_T _elapsedTime
Definition
SegmentDate.hpp:365
stdair::SegmentDate::SegmentDate
SegmentDate(const Key_T &)
Definition
SegmentDate.cpp:38
stdair::SegmentDate::getTimeOffset
const Duration_T getTimeOffset() const
Definition
SegmentDate.cpp:55
stdair::SegmentDate::_offTime
Duration_T _offTime
Definition
SegmentDate.hpp:360
stdair::SegmentDate::getDateOffset
const DateOffset_T getDateOffset() const
Definition
SegmentDate.hpp:139
stdair::SegmentDate::toString
std::string toString() const
Definition
SegmentDate.cpp:48
stdair::SegmentDate::Key_T
SegmentDateKey Key_T
Definition
SegmentDate.hpp:54
stdair::SegmentDate::_key
Key_T _key
Definition
SegmentDate.hpp:314
Generated for StdAir by
1.17.0