1.01.0
C++ Simulated Airline Travel Solution Provider Library
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
ScheduleParserHelper.hpp
Go to the documentation of this file.
1
#ifndef __AIRTSP_CMD_SCHEDULEPARSERHELPER_HPP
2
#define __AIRTSP_CMD_SCHEDULEPARSERHELPER_HPP
3
4
// //////////////////////////////////////////////////////////////////////
5
// Import section
6
// //////////////////////////////////////////////////////////////////////
7
// STL
8
#include <string>
9
// StdAir
10
#include <stdair/command/CmdAbstract.hpp>
11
// AirTSP
12
#include <
airtsp/AIRTSP_Types.hpp
>
13
#include <
airtsp/basic/BasParserTypes.hpp
>
14
#include <
airtsp/bom/FlightPeriodStruct.hpp
>
15
16
// Forward declarations
17
namespace
stdair {
18
class
BomRoot;
19
}
20
21
namespace
AIRTSP {
22
23
namespace
ScheduleParserHelper {
24
25
// ///////////////////////////////////////////////////////////////////
26
// Semantic actions
27
// ///////////////////////////////////////////////////////////////////
29
struct
ParserSemanticAction
{
31
ParserSemanticAction
(
FlightPeriodStruct
&);
33
FlightPeriodStruct
&
_flightPeriod
;
34
};
35
37
struct
storeAirlineCode
:
public
ParserSemanticAction
{
39
storeAirlineCode
(
FlightPeriodStruct
&);
41
void
operator()
(
iterator_t
iStr,
iterator_t
iStrEnd)
const
;
42
};
43
45
struct
storeFlightNumber
:
public
ParserSemanticAction
{
47
storeFlightNumber
(
FlightPeriodStruct
&);
49
void
operator()
(
unsigned
int
iNumber)
const
;
50
};
51
53
struct
storeDateRangeStart
:
public
ParserSemanticAction
{
55
storeDateRangeStart
(
FlightPeriodStruct
&);
57
void
operator()
(
iterator_t
iStr,
iterator_t
iStrEnd)
const
;
58
};
59
61
struct
storeDateRangeEnd
:
public
ParserSemanticAction
{
63
storeDateRangeEnd
(
FlightPeriodStruct
&);
65
void
operator()
(
iterator_t
iStr,
iterator_t
iStrEnd)
const
;
66
};
67
69
struct
storeDow
:
public
ParserSemanticAction
{
71
storeDow
(
FlightPeriodStruct
&);
73
void
operator()
(
iterator_t
iStr,
iterator_t
iStrEnd)
const
;
74
};
75
77
struct
storeLegBoardingPoint
:
public
ParserSemanticAction
{
79
storeLegBoardingPoint
(
FlightPeriodStruct
&);
81
void
operator()
(
iterator_t
iStr,
iterator_t
iStrEnd)
const
;
82
};
83
85
struct
storeLegOffPoint
:
public
ParserSemanticAction
{
87
storeLegOffPoint
(
FlightPeriodStruct
&);
89
void
operator()
(
iterator_t
iStr,
iterator_t
iStrEnd)
const
;
90
};
91
93
struct
storeOperatingAirlineCode
:
public
ParserSemanticAction
{
95
storeOperatingAirlineCode
(
FlightPeriodStruct
&);
97
void
operator()
(
iterator_t
iStr,
iterator_t
iStrEnd)
const
;
98
};
99
101
struct
storeOperatingFlightNumber
:
public
ParserSemanticAction
{
103
storeOperatingFlightNumber
(
FlightPeriodStruct
&);
105
void
operator()
(
unsigned
int
iNumber)
const
;
106
};
107
109
struct
storeBoardingTime
:
public
ParserSemanticAction
{
111
storeBoardingTime
(
FlightPeriodStruct
&);
113
void
operator()
(
iterator_t
iStr,
iterator_t
iStrEnd)
const
;
114
};
115
117
struct
storeOffTime
:
public
ParserSemanticAction
{
119
storeOffTime
(
FlightPeriodStruct
&);
121
void
operator()
(
iterator_t
iStr,
iterator_t
iStrEnd)
const
;
122
};
123
125
struct
storeElapsedTime
:
public
ParserSemanticAction
{
127
storeElapsedTime
(
FlightPeriodStruct
&);
129
void
operator()
(
iterator_t
iStr,
iterator_t
iStrEnd)
const
;
130
};
131
133
struct
storeLegCabinCode
:
public
ParserSemanticAction
{
135
storeLegCabinCode
(
FlightPeriodStruct
&);
137
void
operator()
(
char
iChar)
const
;
138
};
139
141
struct
storeCapacity
:
public
ParserSemanticAction
{
143
storeCapacity
(
FlightPeriodStruct
&);
145
void
operator()
(
double
iReal)
const
;
146
};
147
152
struct
storeSegmentSpecificity
:
public
ParserSemanticAction
{
154
storeSegmentSpecificity
(
FlightPeriodStruct
&);
156
void
operator()
(
char
iChar)
const
;
157
};
158
160
struct
storeSegmentBoardingPoint
:
public
ParserSemanticAction
{
162
storeSegmentBoardingPoint
(
FlightPeriodStruct
&);
164
void
operator()
(
iterator_t
iStr,
iterator_t
iStrEnd)
const
;
165
};
166
168
struct
storeSegmentOffPoint
:
public
ParserSemanticAction
{
170
storeSegmentOffPoint
(
FlightPeriodStruct
&);
172
void
operator()
(
iterator_t
iStr,
iterator_t
iStrEnd)
const
;
173
};
174
176
struct
storeSegmentCabinCode
:
public
ParserSemanticAction
{
178
storeSegmentCabinCode
(
FlightPeriodStruct
&);
180
void
operator()
(
char
iChar)
const
;
181
};
182
184
struct
storeClasses
:
public
ParserSemanticAction
{
186
storeClasses
(
FlightPeriodStruct
&);
188
void
operator()
(
iterator_t
iStr,
iterator_t
iStrEnd)
const
;
189
};
190
192
struct
storeFamilyCode
:
public
ParserSemanticAction
{
194
storeFamilyCode
(
FlightPeriodStruct
&);
196
void
operator()
(
int
iCode)
const
;
197
};
198
200
struct
storeFRAT5CurveKey
:
public
ParserSemanticAction
{
202
storeFRAT5CurveKey
(
FlightPeriodStruct
&);
204
void
operator()
(
iterator_t
iStr,
iterator_t
iStrEnd)
const
;
205
};
206
208
struct
storeFFDisutilityCurveKey
:
public
ParserSemanticAction
{
210
storeFFDisutilityCurveKey
(
FlightPeriodStruct
&);
212
void
operator()
(
iterator_t
iStr,
iterator_t
iStrEnd)
const
;
213
};
214
216
struct
storeFClasses
:
public
ParserSemanticAction
{
218
storeFClasses
(
FlightPeriodStruct
&);
220
void
operator()
(
iterator_t
iStr,
iterator_t
iStrEnd)
const
;
221
};
222
224
struct
doEndFlight
:
public
ParserSemanticAction
{
226
doEndFlight
(stdair::BomRoot&,
FlightPeriodStruct
&);
228
void
operator()
(
iterator_t
iStr,
iterator_t
iStrEnd)
const
;
230
stdair::BomRoot&
_bomRoot
;
231
};
232
233
235
//
236
// (Boost Spirit) Grammar Definition
237
//
239
281
struct
FlightPeriodParser
:
282
public
boost::spirit::classic::grammar<FlightPeriodParser> {
283
284
FlightPeriodParser
(stdair::BomRoot&,
FlightPeriodStruct
&);
285
286
template
<
typename
ScannerT>
287
struct
definition
{
288
definition
(
FlightPeriodParser
const
&
self
);
289
290
// Instantiation of rules
291
boost::spirit::classic::rule<ScannerT>
flight_period_list
,
flight_period
,
292
not_to_be_parsed
,
flight_period_end
,
flight_key
,
airline_code
,
293
flight_number
,
date
,
dow
,
time
,
date_offset
,
294
leg
,
leg_key
,
operating_leg_details
,
leg_details
,
leg_cabin_details
,
295
segment_section
,
segment_key
,
full_segment_cabin_details
,
296
segment_cabin_details
,
full_family_cabin_details
,
297
family_cabin_details
,
generic_segment
,
specific_segment_list
;
298
300
boost::spirit::classic::rule<ScannerT>
const
&
start
()
const
;
301
};
302
303
// Parser Context
304
stdair::BomRoot&
_bomRoot
;
305
FlightPeriodStruct
&
_flightPeriod
;
306
};
307
308
}
313
314
//
315
// Entry class for the file parser
316
//
318
323
class
FlightPeriodFileParser
:
public
stdair::CmdAbstract {
324
public
:
326
FlightPeriodFileParser
(stdair::BomRoot& ioBomRoot,
327
const
stdair::Filename_T& iFilename);
328
330
bool
generateInventories
();
331
332
private
:
334
void
init();
335
336
private
:
337
// Attributes
339
stdair::Filename_T _filename;
340
342
iterator_t
_startIterator;
343
345
iterator_t
_endIterator;
346
348
stdair::BomRoot& _bomRoot;
349
351
FlightPeriodStruct
_flightPeriod;
352
};
353
354
}
355
#endif // __AIRTSP_CMD_SCHEDULEPARSERHELPER_HPP
Generated on Sun Jun 9 2013 12:36:19 for AirTSP by
1.8.3.1