OpenTREP Logo  0.6.0
C++ Open Travel Request Parsing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OPENTREP_Types.hpp
Go to the documentation of this file.
1 #ifndef __OPENTREP_OPENTREP_TYPES_HPP
2 #define __OPENTREP_OPENTREP_TYPES_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <exception>
9 #include <string>
10 #include <list>
11 #include <map>
12 #include <set>
13 // Boost Date-Time
14 #include <boost/date_time/gregorian/gregorian.hpp>
15 #include <boost/date_time/posix_time/posix_time.hpp>
16 // Boost Array
17 #include <boost/array.hpp>
18 // OpenTrep
21 
22 namespace OPENTREP {
23 
24  // //////// Type definitions /////////
28  struct FilePath_T : public std::string {
29  public:
30  explicit FilePath_T (const std::string& iValue) : std::string (iValue) {
31  }
32  };
33 
37  struct PORFilePath_T : public FilePath_T {
38  public:
39  explicit PORFilePath_T (const std::string& iValue) : FilePath_T (iValue) { }
40  };
41 
46  struct TravelDBFilePath_T : public std::string {
47  public:
48  explicit TravelDBFilePath_T (const std::string& iValue)
49  : std::string (iValue) { }
50  };
51 
56  struct SQLiteDBFilePath_T : public std::string {
57  public:
58  explicit SQLiteDBFilePath_T (const std::string& iValue)
59  : std::string (iValue) { }
60  };
61 
66  struct RawDataString_T : public std::string {
67  public:
68  explicit RawDataString_T (const std::string& iValue)
69  : std::string (iValue) { }
70  };
71 
75  struct IATACode_T : public std::string {
76  public:
77  explicit IATACode_T (const std::string& iValue) : std::string (iValue) { }
78  };
79 
83  struct ICAOCode_T : public std::string {
84  public:
85  explicit ICAOCode_T (const std::string& iValue) : std::string (iValue) { }
86  };
87 
91  typedef int GeonamesID_T;
92 
96  typedef int EnvelopeID_T;
97 
101  struct FAACode_T : public std::string {
102  public:
103  explicit FAACode_T (const std::string& iValue) : std::string (iValue) { }
104  };
105 
109  struct LocationName_T : public std::string {
110  public:
111  explicit LocationName_T (const std::string& iValue) : std::string (iValue) {
112  }
113  };
114 
119  struct CommonName_T : public LocationName_T {
120  public:
121  explicit CommonName_T (const std::string& iValue) : LocationName_T (iValue) {
122  }
123  };
124 
128  struct ASCIIName_T : public LocationName_T {
129  public:
130  explicit ASCIIName_T (const std::string& iValue) : LocationName_T (iValue) {
131  }
132  };
133 
140  public:
141  explicit AltNameShortListString_T (const std::string& iValue)
142  : LocationName_T (iValue) {
143  }
144  };
145  typedef std::list<AltNameShortListString_T> AltNameShortList_T;
146 
151  struct TvlPORListString_T : public IATACode_T {
152  public:
153  explicit TvlPORListString_T (const std::string& iValue)
154  : IATACode_T (iValue) {
155  }
156  };
157  typedef std::list<TvlPORListString_T> TvlPORList_T;
158 
163  struct LanguageCode_T : public std::string {
164  public:
165  explicit LanguageCode_T (const std::string& iValue) : std::string (iValue) {
166  }
167  };
168 
172  struct Comment_T : public std::string {
173  public:
174  explicit Comment_T (const std::string& iValue) : std::string (iValue) { }
175  };
176 
180  struct CityCode_T : public IATACode_T {
181  public:
182  explicit CityCode_T (const std::string& iValue)
183  : IATACode_T (std::string (iValue)) {
184  }
185  };
186 
190  struct CityUTFName_T : public std::string {
191  public:
192  explicit CityUTFName_T (const std::string& iValue) : std::string (iValue) { }
193  };
194 
199  struct CityASCIIName_T : public std::string {
200  public:
201  explicit CityASCIIName_T (const std::string& iValue)
202  : std::string (iValue) { }
203  };
204 
208  struct StateCode_T : public std::string {
209  public:
210  explicit StateCode_T (const std::string& iValue) : std::string (iValue) { }
211  };
212 
216  struct CountryCode_T : public std::string {
217  public:
218  explicit CountryCode_T (const std::string& iValue) : std::string (iValue) { }
219  };
220 
224  struct AltCountryCode_T : public std::string {
225  public:
226  explicit AltCountryCode_T (const std::string& iValue)
227  : std::string (iValue) { }
228  };
229 
233  struct CountryName_T : public std::string {
234  public:
235  explicit CountryName_T (const std::string& iValue) : std::string (iValue) { }
236  };
237 
238 
242  struct ContinentCode_T : public std::string {
243  public:
244  explicit ContinentCode_T (const std::string& iValue) : std::string (iValue) {
245  }
246  };
247 
251  struct ContinentName_T : public std::string {
252  public:
253  explicit ContinentName_T (const std::string& iValue) : std::string (iValue) {
254  }
255  };
256 
260  struct Admin1Code_T : public std::string {
261  public:
262  explicit Admin1Code_T (const std::string& iValue) : std::string (iValue) { }
263  };
264 
268  struct Admin1UTFName_T : public std::string {
269  public:
270  explicit Admin1UTFName_T (const std::string& iValue)
271  : std::string (iValue) { }
272  };
273 
277  struct Admin1ASCIIName_T : public std::string {
278  public:
279  explicit Admin1ASCIIName_T (const std::string& iValue)
280  : std::string (iValue) { }
281  };
282 
286  struct Admin2Code_T : public std::string {
287  public:
288  explicit Admin2Code_T (const std::string& iValue) : std::string (iValue) { }
289  };
290 
294  struct Admin2UTFName_T : public std::string {
295  public:
296  explicit Admin2UTFName_T (const std::string& iValue)
297  : std::string (iValue) { }
298  };
299 
303  struct Admin2ASCIIName_T : public std::string {
304  public:
305  explicit Admin2ASCIIName_T (const std::string& iValue)
306  : std::string (iValue) { }
307  };
308 
312  struct Admin3Code_T : public std::string {
313  public:
314  explicit Admin3Code_T (const std::string& iValue) : std::string (iValue) { }
315  };
316 
320  struct Admin4Code_T : public std::string {
321  public:
322  explicit Admin4Code_T (const std::string& iValue) : std::string (iValue) { }
323  };
324 
328  struct FeatureClass_T : public std::string {
329  public:
330  explicit FeatureClass_T (const std::string& iValue) : std::string (iValue) {
331  }
332  };
333 
337  struct FeatureCode_T : public std::string {
338  public:
339  explicit FeatureCode_T (const std::string& iValue) : std::string (iValue) { }
340  };
341 
345  struct FeatureName_T : public std::string {
346  public:
347  explicit FeatureName_T (const std::string& iValue) : std::string (iValue) { }
348  };
349  typedef std::list<FeatureName_T> FeatureNameList_T;
350 
354  typedef double GeoCoord_T;
357 
361  struct WikiLink_T : public std::string {
362  public:
363  explicit WikiLink_T (const std::string& iValue) : std::string (iValue) { }
364  };
365 
369  typedef boost::gregorian::date Date_T;
370 
374  typedef unsigned int Population_T;
375 
379  typedef int Elevation_T;
380 
384  typedef int GTopo30_T;
385 
389  struct TimeZone_T : public std::string {
390  public:
391  explicit TimeZone_T (const std::string& iValue) : std::string (iValue) { }
392  };
393 
397  typedef double PageRank_T;
398 
402  typedef int XapianDocID_T;
403 
407  typedef float GMTOffset_T;
408 
412  typedef float DSTOffset_T;
413 
417  typedef float RawOffset_T;
418 
422  typedef bool IsGeonames_T;
423 
427  typedef bool IsAirport_T;
428 
432  typedef bool IsCommercial_T;
433 
434 
438  typedef unsigned short Weight_T;
439 
443  typedef std::string TravelQuery_T;
444 
448  typedef double MatchingPercentage_T;
449 
453  typedef double Percentage_T;
454 
458  typedef double Score_T;
459 
463  typedef unsigned int NbOfDBEntries_T;
464 
468  typedef std::string Word_T;
469 
473  typedef std::list<Word_T> WordList_T;
474 
478  typedef std::set<std::string> WordSet_T;
479 
483  typedef std::set<std::string> BlackList_T;
484 
488  typedef unsigned int NbOfLetters_T;
489 
493  typedef unsigned short NbOfWords_T;
494 
498  typedef unsigned short NbOfMatches_T;
499 
503  typedef unsigned short NbOfErrors_T;
504 
508  typedef std::map<NbOfLetters_T, NbOfErrors_T> DistanceErrorScale_T;
509 
513  typedef boost::array<NbOfLetters_T, 5> DistanceErrorScaleArray_T;
514 }
515 #endif // __OPENTREP_OPENTREP_TYPES_HPP
Admin4Code_T(const std::string &iValue)
FeatureName_T(const std::string &iValue)
AltNameShortListString_T(const std::string &iValue)
ASCIIName_T(const std::string &iValue)
double Percentage_T
unsigned short NbOfMatches_T
double Score_T
PORFilePath_T(const std::string &iValue)
SQLiteDBFilePath_T(const std::string &iValue)
CityCode_T(const std::string &iValue)
boost::array< NbOfLetters_T, 5 > DistanceErrorScaleArray_T
TravelDBFilePath_T(const std::string &iValue)
double PageRank_T
CountryName_T(const std::string &iValue)
unsigned short Weight_T
unsigned int NbOfLetters_T
std::string Word_T
FilePath_T(const std::string &iValue)
unsigned int NbOfDBEntries_T
Admin3Code_T(const std::string &iValue)
FAACode_T(const std::string &iValue)
std::list< FeatureName_T > FeatureNameList_T
boost::gregorian::date Date_T
std::list< Word_T > WordList_T
std::map< NbOfLetters_T, NbOfErrors_T > DistanceErrorScale_T
float GMTOffset_T
Admin2UTFName_T(const std::string &iValue)
unsigned int Population_T
std::list< TvlPORListString_T > TvlPORList_T
float RawOffset_T
bool IsCommercial_T
double GeoCoord_T
std::set< std::string > WordSet_T
float DSTOffset_T
LanguageCode_T(const std::string &iValue)
TimeZone_T(const std::string &iValue)
AltCountryCode_T(const std::string &iValue)
unsigned short NbOfErrors_T
Admin1Code_T(const std::string &iValue)
LocationName_T(const std::string &iValue)
CountryCode_T(const std::string &iValue)
ICAOCode_T(const std::string &iValue)
ContinentCode_T(const std::string &iValue)
FeatureClass_T(const std::string &iValue)
TvlPORListString_T(const std::string &iValue)
Comment_T(const std::string &iValue)
unsigned short NbOfWords_T
CommonName_T(const std::string &iValue)
GeoCoord_T Longitude_T
StateCode_T(const std::string &iValue)
CityUTFName_T(const std::string &iValue)
Admin2Code_T(const std::string &iValue)
Admin1ASCIIName_T(const std::string &iValue)
Admin2ASCIIName_T(const std::string &iValue)
RawDataString_T(const std::string &iValue)
Admin1UTFName_T(const std::string &iValue)
std::set< std::string > BlackList_T
std::string TravelQuery_T
GeoCoord_T Latitude_T
ContinentName_T(const std::string &iValue)
IATACode_T(const std::string &iValue)
FeatureCode_T(const std::string &iValue)
double MatchingPercentage_T
CityASCIIName_T(const std::string &iValue)
std::list< AltNameShortListString_T > AltNameShortList_T