OpenTREP Logo  0.07.18
C++ Open Travel Request Parsing Library
Loading...
Searching...
No Matches
OPENTREP_Service.hpp
Go to the documentation of this file.
1#ifndef __OPENTREP_SVC_OPENTREP_SERVICE_HPP
2#define __OPENTREP_SVC_OPENTREP_SERVICE_HPP
3
4// //////////////////////////////////////////////////////////////////////
5// Import section
6// //////////////////////////////////////////////////////////////////////
7// STL
8#include <iosfwd>
9#include <string>
10// OpenTREP
12#include <opentrep/DBType.hpp>
15
16namespace OPENTREP {
17
18 // Forward declaration
20
21
26 public:
27 // /////////// Business Methods /////////////
34
46
58 NbOfMatches_T interpretTravelRequest (const std::string& iTravelQuery,
60
61
73 typedef std::pair<const TravelDBFilePath_T,
75 typedef std::pair<const PORFilePath_T, const DBFilePathPair_T> FilePathSet_T;
77
84
93
94 public:
95 // ////////// Interaction with the SQL database //////////
104 bool createSQLDBUser();
105
119
127 void createSQLDBTables();
128
132 void createSQLDBIndexes();
133
140
147
154
161
178
186
197
208
219
230
241
252
253
254 public:
255 // ////////// Constructors and destructors //////////
265 OPENTREP_Service (std::ostream& ioLogStream, const TravelDBFilePath_T&,
266 const DBType&, const SQLDBConnectionString_T&,
267 const DeploymentNumber_T&);
268
283 OPENTREP_Service (std::ostream& ioLogStream, const PORFilePath_T&,
284 const TravelDBFilePath_T&, const DBType&,
288 const shouldAddPORInSQLDB_T&);
289
294
295
296 private:
297 // /////// Construction and Destruction helper methods ///////
306
316 void init (std::ostream& ioLogStream, const TravelDBFilePath_T&,
317 const DBType&, const SQLDBConnectionString_T&,
318 const DeploymentNumber_T&);
319
334 void init (std::ostream& ioLogStream, const PORFilePath_T&,
335 const TravelDBFilePath_T&,
336 const DBType&, const SQLDBConnectionString_T&,
339
343 void finalise();
344
345
346 private:
347 // ///////// Service Context /////////
351 OPENTREP_ServiceContext* _opentrepServiceContext;
352 };
353}
354#endif // __OPENTREP_SVC_OPENTREP_SERVICE_HPP
Class holding the context of the OpenTrep services.
NbOfMatches_T listByIataCode(const IATACode_T &, LocationList_T &)
NbOfMatches_T listByUNLOCode(const UNLOCode_T &, LocationList_T &)
void setSQLDBConnectString(const SQLDBConnectionString_T &)
bool checkXapianDBOnFileSystem(const TravelDBFilePath_T &) const
OPENTREP::shouldIndexNonIATAPOR_T toggleShouldIncludeAllPORFlag()
std::pair< const PORFilePath_T, const DBFilePathPair_T > FilePathSet_T
FilePathSet_T getFilePaths() const
NbOfMatches_T listByFaaCode(const FAACode_T &, LocationList_T &)
NbOfMatches_T listByUICCode(const UICCode_T &, LocationList_T &)
NbOfMatches_T listByIcaoCode(const ICAOCode_T &, LocationList_T &)
NbOfMatches_T interpretTravelRequest(const std::string &iTravelQuery, LocationList_T &, WordList_T &)
NbOfMatches_T listByGeonameID(const GeonamesID_T &, LocationList_T &)
OPENTREP_Service(std::ostream &ioLogStream, const TravelDBFilePath_T &, const DBType &, const SQLDBConnectionString_T &, const DeploymentNumber_T &)
NbOfMatches_T drawRandomLocations(const NbOfMatches_T &iNbOfDraws, LocationList_T &)
const DeploymentNumber_T & getDeploymentNumber() const
OPENTREP::shouldIndexPORInXapian_T toggleShouldIndexPORInXapianFlag()
std::pair< const TravelDBFilePath_T, const SQLDBConnectionString_T > DBFilePathPair_T
NbOfDBEntries_T insertIntoDBAndXapian()
OPENTREP::DeploymentNumber_T toggleDeploymentNumber()
OPENTREP::shouldAddPORInSQLDB_T toggleShouldAddPORInSQLDBFlag()
std::list< Word_T > WordList_T
unsigned int UICCode_T
bool shouldAddPORInSQLDB_T
unsigned int NbOfDBEntries_T
std::list< Location > LocationList_T
bool shouldIndexPORInXapian_T
unsigned short DeploymentNumber_T
unsigned short NbOfMatches_T
unsigned int GeonamesID_T
bool shouldIndexNonIATAPOR_T
Enumeration of database types.
Definition DBType.hpp:17