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
SegmentDate.hpp
Go to the documentation of this file.
1
#ifndef __STDAIR_BOM_SEGMENTDATE_HPP
2
#define __STDAIR_BOM_SEGMENTDATE_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/SegmentDateKey.hpp
>
14
#include <
stdair/bom/SegmentDateTypes.hpp
>
15
17
namespace
boost {
18
namespace
serialization {
19
class
access;
20
}
21
}
22
23
namespace
stdair {
24
26
struct
SegmentCabinKey;
27
class
SegmentCabin
;
28
29
// Define the routing leg keys list type.
30
typedef
std::list<std::string>
RoutingLegKeyList_T
;
31
36
class
SegmentDate
:
public
BomAbstract
{
37
template
<
typename
BOM>
friend
class
FacBom
;
38
template
<
typename
BOM>
friend
class
FacCloneBom
;
39
friend
class
FacBomManager
;
40
friend
class
boost::serialization::access
;
41
42
public
:
43
// ////////// Type definitions ////////////
47
typedef
SegmentDateKey
Key_T
;
48
49
50
public
:
51
// /////////// Getters /////////////
55
const
Key_T
&
getKey
()
const
{
56
return
_key
;
57
}
58
62
BomAbstract
*
const
getParent
()
const
{
63
return
_parent
;
64
}
65
69
const
AirportCode_T
&
getBoardingPoint
()
const
{
70
return
_key
.
getBoardingPoint
();
71
}
72
76
const
AirportCode_T
&
getOffPoint
()
const
{
77
return
_key
.
getOffPoint
();
78
}
79
83
const
HolderMap_T
&
getHolderMap
()
const
{
84
return
_holderMap
;
85
}
86
90
const
Date_T
&
getBoardingDate
()
const
{
91
return
_boardingDate
;
92
}
93
97
const
Duration_T
&
getBoardingTime
()
const
{
98
return
_boardingTime
;
99
}
100
104
const
Date_T
&
getOffDate
()
const
{
105
return
_offDate
;
106
}
107
111
const
Duration_T
&
getOffTime
()
const
{
112
return
_offTime
;
113
}
114
118
const
Duration_T
&
getElapsedTime
()
const
{
119
return
_elapsedTime
;
120
}
121
125
const
Distance_T
&
getDistance
()
const
{
126
return
_distance
;
127
}
128
132
const
DateOffset_T
getDateOffset
()
const
{
133
return
_offDate
-
_boardingDate
;
134
}
135
144
const
Duration_T
getTimeOffset
()
const
;
145
149
SegmentDate
*
getOperatingSegmentDate
()
const
{
150
return
_operatingSegmentDate
;
151
}
152
156
const
SegmentDateList_T
&
getMarketingSegmentDateList
()
const
{
157
return
_marketingSegmentDateList
;
158
}
159
163
const
RoutingLegKeyList_T
&
getLegKeyList
()
const
{
164
return
_routingLegKeyList
;
165
}
166
167
public
:
168
// ///////// Setters //////////
172
void
setBoardingDate
(
const
Date_T
& iBoardingDate) {
173
_boardingDate
= iBoardingDate;
174
}
175
179
void
setBoardingTime
(
const
Duration_T
& iBoardingTime) {
180
_boardingTime
= iBoardingTime;
181
}
182
186
void
setOffDate
(
const
Date_T
& iOffDate) {
187
_offDate
= iOffDate;
188
}
189
193
void
setOffTime
(
const
Duration_T
& iOffTime) {
194
_offTime
= iOffTime;
195
}
196
200
void
setElapsedTime
(
const
Duration_T
& iElapsedTime) {
201
_elapsedTime
= iElapsedTime;
202
}
203
207
void
setDistance
(
const
Distance_T
& iDistance) {
208
_distance
= iDistance;
209
}
210
214
void
addLegKey
(
const
std::string& iLegKey) {
215
_routingLegKeyList
.push_back(iLegKey);
216
}
217
218
private
:
222
void
linkWithOperating (
SegmentDate
& iSegmentDate) {
223
_operatingSegmentDate
= &iSegmentDate;
224
}
225
226
public
:
227
// /////////// Display support methods /////////
233
void
toStream
(std::ostream& ioOut)
const
{
234
ioOut <<
toString
();
235
}
236
242
void
fromStream
(std::istream& ioIn) {
243
}
244
248
std::string
toString
()
const
;
249
253
const
std::string
describeKey
()
const
{
254
return
_key
.
toString
();
255
}
256
257
258
public
:
259
// /////////// (Boost) Serialisation support methods /////////
263
template
<
class
Archive>
264
void
serialize
(Archive& ar,
const
unsigned
int
iFileVersion);
265
266
private
:
274
void
serialisationImplementationExport()
const
;
275
void
serialisationImplementationImport();
276
277
278
protected
:
279
// ////////// Constructors and destructors /////////
283
SegmentDate
(
const
Key_T
&);
284
288
virtual
~SegmentDate
();
289
290
private
:
294
SegmentDate
();
295
299
SegmentDate
(
const
SegmentDate
&);
300
301
302
protected
:
303
// ////////// Attributes /////////
307
Key_T
_key
;
308
312
BomAbstract
*
_parent
;
313
317
HolderMap_T
_holderMap
;
318
325
SegmentDate
*
_operatingSegmentDate
;
326
333
SegmentDateList_T
_marketingSegmentDateList
;
334
338
Date_T
_boardingDate
;
339
343
Duration_T
_boardingTime
;
344
348
Date_T
_offDate
;
349
353
Duration_T
_offTime
;
354
358
Duration_T
_elapsedTime
;
359
363
Distance_T
_distance
;
364
368
RoutingLegKeyList_T
_routingLegKeyList
;
369
};
370
371
}
372
#endif // __STDAIR_BOM_SEGMENTDATE_HPP
373
Generated on Sat Dec 22 2012 16:51:54 for StdAir by
1.8.1.1