1.00.0
C++ Standard Airline IT Object Library
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
LegDate.hpp
Go to the documentation of this file.
1
#ifndef __STDAIR_BOM_LEGDATE_HPP
2
#define __STDAIR_BOM_LEGDATE_HPP
3
4
// //////////////////////////////////////////////////////////////////////
5
// Import section
6
// //////////////////////////////////////////////////////////////////////
7
// STL
8
#include <iosfwd>
9
#include <string>
10
// StdAir
11
#include <
stdair/stdair_inventory_types.hpp
>
12
#include <
stdair/bom/BomAbstract.hpp
>
13
#include <
stdair/bom/LegDateKey.hpp
>
14
#include <
stdair/bom/LegDateTypes.hpp
>
15
16
namespace
stdair {
17
19
struct
LegCabinKey;
20
class
LegCabin;
21
25
class
LegDate
:
public
BomAbstract
{
26
template
<
typename
BOM>
friend
class
FacBom
;
27
template
<
typename
BOM>
friend
class
FacCloneBom
;
28
friend
class
FacBomManager
;
29
30
public
:
31
// ////////// Type definitions ////////////
33
typedef
LegDateKey
Key_T
;
34
35
36
public
:
37
// /////////// Getters /////////////
39
const
Key_T
&
getKey
()
const
{
40
return
_key
;
41
}
42
44
BomAbstract
*
const
getParent
()
const
{
45
return
_parent
;
46
}
47
49
const
AirportCode_T
&
getBoardingPoint
()
const
{
50
return
_key
.
getBoardingPoint
();
51
}
52
60
const
AirlineCode_T
&
getAirlineCode
()
const
;
61
65
const
HolderMap_T
&
getHolderMap
()
const
{
66
return
_holderMap
;
67
}
68
79
LegCabin
*
getLegCabin
(
const
std::string& iLegCabinKeyStr)
const
;
80
91
LegCabin
*
getLegCabin
(
const
LegCabinKey
&)
const
;
92
94
const
AirportCode_T
&
getOffPoint
()
const
{
95
return
_offPoint
;
96
}
97
99
const
Date_T
&
getBoardingDate
()
const
{
100
return
_boardingDate
;
101
}
102
104
const
Duration_T
&
getBoardingTime
()
const
{
105
return
_boardingTime
;
106
}
107
109
const
Date_T
&
getOffDate
()
const
{
110
return
_offDate
;
111
}
112
114
const
Duration_T
&
getOffTime
()
const
{
115
return
_offTime
;
116
}
117
119
const
Duration_T
&
getElapsedTime
()
const
{
120
return
_elapsedTime
;
121
}
122
124
const
Distance_T
&
getDistance
()
const
{
125
return
_distance
;
126
}
127
129
const
CabinCapacity_T
&
getCapacity
()
const
{
130
return
_capacity
;
131
}
132
134
const
DateOffset_T
getDateOffset
()
const
{
135
return
_offDate
-
_boardingDate
;
136
}
137
142
const
Duration_T
getTimeOffset
()
const
;
143
144
145
public
:
146
// ///////// Setters //////////
148
void
setOffPoint
(
const
AirportCode_T
& iOffPoint) {
149
_offPoint
= iOffPoint;
150
}
151
153
void
setBoardingDate
(
const
Date_T
& iBoardingDate) {
154
_boardingDate
= iBoardingDate;
155
}
156
158
void
setBoardingTime
(
const
Duration_T
& iBoardingTime) {
159
_boardingTime
= iBoardingTime;
160
}
161
163
void
setOffDate
(
const
Date_T
& iOffDate) {
164
_offDate
= iOffDate;
165
}
166
168
void
setOffTime
(
const
Duration_T
& iOffTime) {
169
_offTime
= iOffTime;
170
}
171
173
void
setElapsedTime
(
const
Duration_T
&);
174
176
void
setOperatingAirlineCode
(
const
AirlineCode_T
& iAirlineCode) {
177
_operatingAirlineCode
= iAirlineCode;
178
}
179
181
void
setOperatingFlightNumber
(
const
FlightNumber_T
& iFlightNumber) {
182
_operatingFlightNumber
= iFlightNumber;
183
}
184
185
private
:
187
void
updateDistanceFromElapsedTime();
188
189
190
public
:
191
// /////////// Display support methods /////////
194
void
toStream
(std::ostream& ioOut)
const
{
195
ioOut <<
toString
();
196
}
197
200
void
fromStream
(std::istream& ioIn) {
201
}
202
204
std::string
toString
()
const
;
205
207
const
std::string
describeKey
()
const
{
208
return
_key
.
toString
();
209
}
210
212
const
std::string
describeRoutingKey
()
const
;
213
214
protected
:
215
// ////////// Constructors and destructors /////////
217
LegDate
(
const
Key_T
&);
219
virtual
~LegDate
();
220
221
private
:
223
LegDate
();
225
LegDate
(
const
LegDate
&);
226
227
228
protected
:
229
// ////////// Attributes /////////
231
Key_T
_key
;
232
234
BomAbstract
*
_parent
;
235
237
HolderMap_T
_holderMap
;
238
240
AirportCode_T
_offPoint
;
241
243
Date_T
_boardingDate
;
244
246
Duration_T
_boardingTime
;
247
249
Date_T
_offDate
;
250
252
Duration_T
_offTime
;
253
255
Duration_T
_elapsedTime
;
256
258
Distance_T
_distance
;
259
261
CabinCapacity_T
_capacity
;
262
264
AirlineCode_T
_operatingAirlineCode
;
265
267
FlightNumber_T
_operatingFlightNumber
;
268
};
269
270
}
271
#endif // __STDAIR_BOM_LEGDATE_HPP
272
Generated on Sat Dec 22 2012 16:51:53 for StdAir by
1.8.1.1