TraDemGen Logo  1.00.10
C++ Simulated Travel Demand Generation Library
Loading...
Searching...
No Matches
DemandParserHelper.hpp
Go to the documentation of this file.
1#ifndef __TRADEMGEN_CMD_DEMANDPARSERHELPER_HPP
2#define __TRADEMGEN_CMD_DEMANDPARSERHELPER_HPP
3
4// //////////////////////////////////////////////////////////////////////
5// Import section
6// //////////////////////////////////////////////////////////////////////
7// STL
8#include <string>
9// STDAIR
10#include <stdair/command/CmdAbstract.hpp>
11// SEvMgr
12#include <sevmgr/SEVMGR_Types.hpp>
13// TRADEMGEN
17
18// Forward declarations
19namespace stdair {
20 struct RandomGeneration;
21}
22
23namespace TRADEMGEN {
24
25 namespace DemandParserHelper {
26
27 // ///////////////////////////////////////////////////////////////////
28 // Semantic actions
29 // ///////////////////////////////////////////////////////////////////
37
45
53
59 void operator() (iterator_t iStr, iterator_t iStrEnd) const;
60 };
61
67 void operator() (iterator_t iStr, iterator_t iStrEnd) const;
68 };
69
75 void operator() (iterator_t iStr, iterator_t iStrEnd) const;
76 };
77
83 void operator() (iterator_t iStr, iterator_t iStrEnd) const;
84 };
85
91 void operator() (double iReal) const;
92 };
93
99 void operator() (double iReal) const;
100 };
101
107 void operator() (double iReal) const;
108 };
109
117
123 void operator() (double iReal) const;
124 };
125
133
139 void operator() (iterator_t iStr, iterator_t iStrEnd) const;
140 };
141
147 void operator() (double iReal) const;
148 };
149
155 void operator() (iterator_t iStr, iterator_t iStrEnd) const;
156 };
157
163 void operator() (double iReal) const;
164 };
165
171 void operator() (iterator_t iStr, iterator_t iStrEnd) const;
172 };
173
179 void operator() (double iReal) const;
180 };
181
187 void operator() (unsigned int iInteger) const;
188 };
189
195 void operator() (double iReal) const;
196 };
197
203 void operator() (iterator_t iStr, iterator_t iStrEnd) const;
204 };
205
211 void operator() (double iReal) const;
212 };
213
220 void operator() (iterator_t iStr, iterator_t iStrEnd) const;
221 };
222
229 void operator() (double iReal) const;
230 };
231
237 void operator() (double iReal) const;
238 };
239
245 void operator() (double iReal) const;
246 };
247
253 void operator() (double iReal) const;
254 };
255
262 void operator() (unsigned int iInteger) const;
263 };
264
271 void operator() (double iReal) const;
272 };
273
277 doEndDemand (SEVMGR::SEVMGR_ServicePtr_T, stdair::RandomGeneration&,
280 void operator() (iterator_t iStr, iterator_t iStrEnd) const;
282 SEVMGR::SEVMGR_ServicePtr_T _sevmgrServicePtr;
283 stdair::RandomGeneration& _uniformGenerator;
285 };
286
287
289 //
290 // (Boost Spirit) Grammar Definition
291 //
293
384 struct DemandParser :
385 public boost::spirit::classic::grammar<DemandParser> {
386
387 DemandParser (SEVMGR::SEVMGR_ServicePtr_T, stdair::RandomGeneration&,
389
390 template <typename ScannerT>
413
414 // Parser Context
415 SEVMGR::SEVMGR_ServicePtr_T _sevmgrServicePtr;
416 stdair::RandomGeneration& _uniformGenerator;
419 };
420
421 }
422
423
425 //
426 // Entry class for the file parser
427 //
429
434 class DemandFileParser : public stdair::CmdAbstract {
435 public:
437 DemandFileParser (SEVMGR::SEVMGR_ServicePtr_T, stdair::RandomGeneration&,
439 const stdair::Filename_T& iDemandInputFilename);
440
442 bool generateDemand ();
443
444 private:
446 void init();
447
448 private:
449 // Attributes
451 stdair::Filename_T _filename;
452
454 iterator_t _startIterator;
455
457 iterator_t _endIterator;
458
460 SEVMGR::SEVMGR_ServicePtr_T _sevmgrServicePtr;
461
463 stdair::RandomGeneration& _uniformGenerator;
464
466 const POSProbabilityMass_T& _posProbabilityMass;
467
469 DemandStruct _demand;
470 };
471
472}
473#endif // __TRADEMGEN_CMD_DEMANDPARSERHELPER_HPP
boost::spirit::classic::file_iterator< char_t > iterator_t
Forward declarations.
void operator()(iterator_t iStr, iterator_t iStrEnd) const
void operator()(iterator_t iStr, iterator_t iStrEnd) const
void operator()(iterator_t iStr, iterator_t iStrEnd) const
void operator()(iterator_t iStr, iterator_t iStrEnd) const
void operator()(iterator_t iStr, iterator_t iStrEnd) const
void operator()(iterator_t iStr, iterator_t iStrEnd) const
void operator()(iterator_t iStr, iterator_t iStrEnd) const
void operator()(iterator_t iStr, iterator_t iStrEnd) const
void operator()(iterator_t iStr, iterator_t iStrEnd) const
void operator()(unsigned int iInteger) const
void operator()(iterator_t iStr, iterator_t iStrEnd) const
void operator()(iterator_t iStr, iterator_t iStrEnd) const
void operator()(unsigned int iInteger) const
doEndDemand(SEVMGR::SEVMGR_ServicePtr_T, stdair::RandomGeneration &, const POSProbabilityMass_T &, DemandStruct &)
void operator()(iterator_t iStr, iterator_t iStrEnd) const
DemandParser(SEVMGR::SEVMGR_ServicePtr_T, stdair::RandomGeneration &, const POSProbabilityMass_T &, DemandStruct &)
boost::spirit::classic::rule< ScannerT > trip_share
boost::spirit::classic::rule< ScannerT > demand_list
boost::spirit::classic::rule< ScannerT > non_refundable
boost::spirit::classic::rule< ScannerT > demand_end
boost::spirit::classic::rule< ScannerT > channel_code
boost::spirit::classic::rule< ScannerT > pref_dep_time_dist
boost::spirit::classic::rule< ScannerT > pref_dep_time_share
boost::spirit::classic::rule< ScannerT > pref_cabin
boost::spirit::classic::rule< ScannerT > channel_share
boost::spirit::classic::rule< ScannerT > channel_pair
boost::spirit::classic::rule< ScannerT > stay_share
boost::spirit::classic::rule< ScannerT > time_value_pair
boost::spirit::classic::rule< ScannerT > destination
boost::spirit::classic::rule< ScannerT > demand_params
boost::spirit::classic::rule< ScannerT > pref_dep_time_pair
boost::spirit::classic::rule< ScannerT > time_value_dist
boost::spirit::classic::rule< ScannerT > change_fees
boost::spirit::classic::rule< ScannerT > const & start() const
boost::spirit::classic::rule< ScannerT > pref_dep_date_range
boost::spirit::classic::rule< ScannerT > channel_dist
boost::spirit::classic::rule< ScannerT > time_value_share
boost::spirit::classic::rule< ScannerT > not_to_be_parsed
DemandFileParser(SEVMGR::SEVMGR_ServicePtr_T, stdair::RandomGeneration &, const POSProbabilityMass_T &, const stdair::Filename_T &iDemandInputFilename)