1.01.17
C++ Simulated Airline Travel Solution Provider (TSP) Library
Toggle main menu visibility
Loading...
Searching...
No Matches
LegStruct.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_Period_BOM.hpp>
9
#include <stdair/bom/LegDate.hpp>
10
// AirTSP
11
#include <
airtsp/bom/LegStruct.hpp
>
12
13
namespace
AIRTSP
{
14
15
// //////////////////////////////////////////////////////////////////////
16
LegStruct::LegStruct
()
17
:
_boardingDateOffset
(
stdair
::DEFAULT_DATE_OFFSET),
18
_offDateOffset
(
stdair
::DEFAULT_DATE_OFFSET) {
19
}
20
21
// //////////////////////////////////////////////////////////////////////
22
const
std::string
LegStruct::describe
()
const
{
23
std::ostringstream ostr;
24
ostr <<
" "
<<
_boardingPoint
<<
" / "
25
<< boost::posix_time::to_simple_string(
_boardingTime
);
26
if
(
_boardingDateOffset
.days() != 0) {
27
ostr <<
" ["
<<
_boardingDateOffset
.days() <<
"]"
;
28
}
29
ostr <<
" -- "
<<
_offPoint
<<
" / "
30
<< boost::posix_time::to_simple_string(
_offTime
);
31
if
(
_offDateOffset
.days() != 0) {
32
ostr <<
" ["
<<
_offDateOffset
.days() <<
"]"
;
33
}
34
ostr <<
" --> "
35
<< boost::posix_time::to_simple_string(
_elapsed
)
36
<< std::endl;
37
for
(LegCabinStructList_T::const_iterator itCabin =
_cabinList
.begin();
38
itCabin !=
_cabinList
.end(); itCabin++) {
39
const
LegCabinStruct
& lCabin = *itCabin;
40
ostr << lCabin.
describe
();
41
}
42
ostr << std::endl;
43
44
return
ostr.str();
45
}
46
47
// //////////////////////////////////////////////////////////////////////
48
void
LegStruct::fill
(
const
stdair::Date_T& iRefDate,
49
stdair::LegDate& ioLegDate)
const
{
50
// Set the Off Point
51
ioLegDate.setOffPoint (
_offPoint
);
52
53
// Set the Boarding Date
54
ioLegDate.setBoardingDate (iRefDate +
_boardingDateOffset
);
55
56
// Set the Boarding Time
57
ioLegDate.setBoardingTime (
_boardingTime
);
58
59
// Set the Off Date
60
ioLegDate.setOffDate (iRefDate +
_offDateOffset
);
61
62
// Set the Off Time
63
ioLegDate.setOffTime (
_offTime
);
64
65
// Set the Elapsed Time
66
ioLegDate.setElapsedTime (
_elapsed
);
67
68
// Set the operating airline code
69
ioLegDate.setOperatingAirlineCode (
_airlineCode
);
70
71
// Set the operating flight number
72
ioLegDate.setOperatingFlightNumber (
_flightNumber
);
73
74
}
75
76
}
LegStruct.hpp
AIRTSP
Definition
AIRTSP_Service.hpp:23
stdair
Forward declarations.
Definition
AIRTSP_Service.hpp:14
AIRTSP::LegCabinStruct
Definition
LegCabinStruct.hpp:22
AIRTSP::LegCabinStruct::describe
const std::string describe() const
Definition
LegCabinStruct.cpp:15
AIRTSP::LegStruct::_boardingTime
stdair::Duration_T _boardingTime
Definition
LegStruct.hpp:30
AIRTSP::LegStruct::_boardingDateOffset
stdair::DateOffset_T _boardingDateOffset
Definition
LegStruct.hpp:29
AIRTSP::LegStruct::_boardingPoint
stdair::AirportCode_T _boardingPoint
Definition
LegStruct.hpp:28
AIRTSP::LegStruct::describe
const std::string describe() const
Definition
LegStruct.cpp:22
AIRTSP::LegStruct::_offPoint
stdair::AirportCode_T _offPoint
Definition
LegStruct.hpp:31
AIRTSP::LegStruct::fill
void fill(const stdair::Date_T &iRefDate, stdair::LegDate &) const
Definition
LegStruct.cpp:48
AIRTSP::LegStruct::_offDateOffset
stdair::DateOffset_T _offDateOffset
Definition
LegStruct.hpp:32
AIRTSP::LegStruct::_elapsed
stdair::Duration_T _elapsed
Definition
LegStruct.hpp:34
AIRTSP::LegStruct::_cabinList
LegCabinStructList_T _cabinList
Definition
LegStruct.hpp:35
AIRTSP::LegStruct::_offTime
stdair::Duration_T _offTime
Definition
LegStruct.hpp:33
AIRTSP::LegStruct::_flightNumber
stdair::FlightNumber_T _flightNumber
Definition
LegStruct.hpp:27
AIRTSP::LegStruct::LegStruct
LegStruct()
Definition
LegStruct.cpp:16
AIRTSP::LegStruct::_airlineCode
stdair::AirlineCode_T _airlineCode
Definition
LegStruct.hpp:26
Generated on
for AirTSP by
1.17.0