AirInv Logo  1.00.0
C++ Simulated Airline Inventory Management System library
 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>
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  // ///////////////////////////////////////////////////////////////////
34  };
35 
41  void operator() (iterator_t iStr, iterator_t iStrEnd) const;
42  };
43 
49  void operator() (unsigned int iNumber) const;
50  };
51 
57  void operator() (iterator_t iStr, iterator_t iStrEnd) const;
58  };
59 
65  void operator() (iterator_t iStr, iterator_t iStrEnd) const;
66  };
67 
69  struct storeDow : public ParserSemanticAction {
73  void operator() (iterator_t iStr, iterator_t iStrEnd) const;
74  };
75 
81  void operator() (iterator_t iStr, iterator_t iStrEnd) const;
82  };
83 
89  void operator() (iterator_t iStr, iterator_t iStrEnd) const;
90  };
91 
97  void operator() (iterator_t iStr, iterator_t iStrEnd) const;
98  };
99 
105  void operator() (unsigned int iNumber) const;
106  };
107 
113  void operator() (iterator_t iStr, iterator_t iStrEnd) const;
114  };
115 
121  void operator() (iterator_t iStr, iterator_t iStrEnd) const;
122  };
123 
129  void operator() (iterator_t iStr, iterator_t iStrEnd) const;
130  };
131 
137  void operator() (char iChar) const;
138  };
139 
145  void operator() (double iReal) const;
146  };
147 
156  void operator() (char iChar) const;
157  };
158 
164  void operator() (iterator_t iStr, iterator_t iStrEnd) const;
165  };
166 
172  void operator() (iterator_t iStr, iterator_t iStrEnd) const;
173  };
174 
180  void operator() (char iChar) const;
181  };
182 
188  void operator() (iterator_t iStr, iterator_t iStrEnd) const;
189  };
190 
196  void operator() (int iCode) const;
197  };
198 
204  void operator() (iterator_t iStr, iterator_t iStrEnd) const;
205  };
206 
212  void operator() (iterator_t iStr, iterator_t iStrEnd) const;
213  };
214 
220  void operator() (iterator_t iStr, iterator_t iStrEnd) const;
221  };
222 
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 
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,
300 
302  boost::spirit::classic::rule<ScannerT> const& start() const;
303  };
304 
305  // Parser Context
306  stdair::BomRoot& _bomRoot;
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