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