1.00.0
C++ Simulated Airline Inventory Management System 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 __AIRINV_CMD_SCHEDULEPARSERHELPER_HPP
2
#define __AIRINV_CMD_SCHEDULEPARSERHELPER_HPP
3
4
// //////////////////////////////////////////////////////////////////////
5
// Import section
6
// //////////////////////////////////////////////////////////////////////
7
// STL
8
#include <string>
9
// StdAir
10
#include <stdair/command/CmdAbstract.hpp>
11
// Airinv
12
#include <
airinv/AIRINV_Types.hpp
>
13
#include <
airinv/basic/BasParserTypes.hpp
>
14
#include <
airinv/bom/FlightPeriodStruct.hpp
>
15
16
// Forward declarations
17
namespace
stdair {
18
class
BomRoot;
19
}
20
21
namespace
AIRINV {
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
282
struct
FlightPeriodParser
:
283
public
boost::spirit::classic::grammar<FlightPeriodParser> {
284
285
FlightPeriodParser
(stdair::BomRoot&,
FlightPeriodStruct
&);
286
287
template
<
typename
ScannerT>
288
struct
definition
{
289
definition
(
FlightPeriodParser
const
&
self
);
290
291
// Instantiation of rules
292
boost::spirit::classic::rule<ScannerT>
flight_period_list
,
293
not_to_be_parsed
,
flight_period
,
flight_period_end
,
294
flight_key
,
airline_code
,
flight_number
,
295
date
,
dow
,
time
,
date_offset
,
296
leg
,
leg_key
,
operating_leg_details
,
leg_details
,
leg_cabin_details
,
297
segment_section
,
segment_key
,
full_segment_cabin_details
,
298
segment_cabin_details
,
full_family_cabin_details
,
299
family_cabin_details
,
generic_segment
,
specific_segment_list
;
300
302
boost::spirit::classic::rule<ScannerT>
const
&
start
()
const
;
303
};
304
305
// Parser Context
306
stdair::BomRoot&
_bomRoot
;
307
FlightPeriodStruct
&
_flightPeriod
;
308
};
309
310
}
315
316
//
317
// Entry class for the file parser
318
//
320
325
class
FlightPeriodFileParser
:
public
stdair::CmdAbstract {
326
public
:
328
FlightPeriodFileParser
(stdair::BomRoot& ioBomRoot,
329
const
stdair::Filename_T& iFilename);
330
332
bool
generateInventories
();
333
334
private
:
336
void
init();
337
338
private
:
339
// Attributes
341
stdair::Filename_T _filename;
342
344
iterator_t
_startIterator;
345
347
iterator_t
_endIterator;
348
350
stdair::BomRoot& _bomRoot;
351
353
FlightPeriodStruct
_flightPeriod;
354
};
355
356
}
357
#endif // __AIRINV_CMD_SCHEDULEPARSERHELPER_HPP
Generated on Tue Dec 25 2012 22:19:42 for AirInv by
1.8.1.1