AirInv Logo  1.00.12
C++ Simulated Airline Inventory Management System Library
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
12
13namespace AIRINV {
14
15 // //////////////////////////////////////////////////////////////////////
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}
Forward declarations.
const std::string describe() const
stdair::Duration_T _boardingTime
Definition LegStruct.hpp:31
stdair::DateOffset_T _boardingDateOffset
Definition LegStruct.hpp:29
const std::string describe() const
Definition LegStruct.cpp:21
stdair::Date_T _boardingDate
Definition LegStruct.hpp:30
stdair::DateOffset_T _offDateOffset
Definition LegStruct.hpp:33
stdair::Duration_T _offTime
Definition LegStruct.hpp:35
stdair::Date_T _offDate
Definition LegStruct.hpp:34
stdair::AirportCode_T _offPoint
Definition LegStruct.hpp:32
stdair::Duration_T _elapsed
Definition LegStruct.hpp:36
stdair::AirportCode_T _boardingPoint
Definition LegStruct.hpp:28
stdair::FlightNumber_T _flightNumber
Definition LegStruct.hpp:27
void fill(const stdair::Date_T &iRefDate, stdair::LegDate &) const
Definition LegStruct.cpp:41
stdair::AirlineCode_T _airlineCode
Definition LegStruct.hpp:26
LegCabinStructList_T _cabinList
Definition LegStruct.hpp:37