0.08.01
C++ Open Travel Request Parsing Library
Toggle main menu visibility
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
11
#include <
opentrep/OPENTREP_Types.hpp
>
12
#include <
opentrep/DBType.hpp
>
13
#include <
opentrep/LocationList.hpp
>
14
#include <
opentrep/DistanceErrorRule.hpp
>
15
16
namespace
OPENTREP
{
17
18
// Forward declaration
19
class
OPENTREP_ServiceContext
;
20
21
25
class
OPENTREP_Service
{
26
public
:
27
// /////////// Business Methods /////////////
33
NbOfDBEntries_T
getIndexSize
();
34
44
NbOfMatches_T
drawRandomLocations
(
const
NbOfMatches_T
& iNbOfDraws,
45
LocationList_T
&);
46
58
NbOfMatches_T
interpretTravelRequest
(
const
std::string& iTravelQuery,
59
LocationList_T
&,
WordList_T
&);
60
61
73
typedef
std::pair<
const
TravelDBFilePath_T
,
74
const
SQLDBConnectionString_T
>
DBFilePathPair_T
;
75
typedef
std::pair<const PORFilePath_T, const DBFilePathPair_T>
FilePathSet_T
;
76
FilePathSet_T
getFilePaths
()
const
;
77
83
const
DeploymentNumber_T
&
getDeploymentNumber
()
const
;
84
92
bool
checkXapianDBOnFileSystem
(
const
TravelDBFilePath_T
&)
const
;
93
94
public
:
95
// ////////// Interaction with the SQL database //////////
104
bool
createSQLDBUser
();
105
118
void
setSQLDBConnectString
(
const
SQLDBConnectionString_T
&);
119
127
void
createSQLDBTables
();
128
132
void
createSQLDBIndexes
();
133
139
OPENTREP::DeploymentNumber_T
toggleDeploymentNumber
();
140
146
OPENTREP::shouldIndexNonIATAPOR_T
toggleShouldIncludeAllPORFlag
();
147
153
OPENTREP::shouldIndexPORInXapian_T
toggleShouldIndexPORInXapianFlag
();
154
160
OPENTREP::shouldAddPORInSQLDB_T
toggleShouldAddPORInSQLDBFlag
();
161
177
NbOfDBEntries_T
insertIntoDBAndXapian
();
178
185
NbOfDBEntries_T
getNbOfPORFromDB
();
186
196
NbOfMatches_T
listByIataCode
(
const
IATACode_T
&,
LocationList_T
&);
197
207
NbOfMatches_T
listByIcaoCode
(
const
ICAOCode_T
&,
LocationList_T
&);
208
218
NbOfMatches_T
listByFaaCode
(
const
FAACode_T
&,
LocationList_T
&);
219
229
NbOfMatches_T
listByUNLOCode
(
const
UNLOCode_T
&,
LocationList_T
&);
230
240
NbOfMatches_T
listByUICCode
(
const
UICCode_T
&,
LocationList_T
&);
241
251
NbOfMatches_T
listByGeonameID
(
const
GeonamesID_T
&,
LocationList_T
&);
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
&,
285
const
SQLDBConnectionString_T
&,
const
DeploymentNumber_T
&,
286
const
shouldIndexNonIATAPOR_T
&,
287
const
shouldIndexPORInXapian_T
&,
288
const
shouldAddPORInSQLDB_T
&);
289
293
~OPENTREP_Service
();
294
295
296
private
:
297
// /////// Construction and Destruction helper methods ///////
301
OPENTREP_Service
();
305
OPENTREP_Service
(
const
OPENTREP_Service
&);
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
&,
337
const
DeploymentNumber_T
&,
const
shouldIndexNonIATAPOR_T
&,
338
const
shouldIndexPORInXapian_T
&,
const
shouldAddPORInSQLDB_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
DBType.hpp
DistanceErrorRule.hpp
LocationList.hpp
OPENTREP_Types.hpp
OPENTREP::OPENTREP_ServiceContext
Class holding the context of the OpenTrep services.
Definition
OPENTREP_ServiceContext.hpp:28
OPENTREP::OPENTREP_Service::listByIataCode
NbOfMatches_T listByIataCode(const IATACode_T &, LocationList_T &)
Definition
OPENTREP_Service.cpp:612
OPENTREP::OPENTREP_Service::listByUNLOCode
NbOfMatches_T listByUNLOCode(const UNLOCode_T &, LocationList_T &)
Definition
OPENTREP_Service.cpp:757
OPENTREP::OPENTREP_Service::setSQLDBConnectString
void setSQLDBConnectString(const SQLDBConnectionString_T &)
Definition
OPENTREP_Service.cpp:326
OPENTREP::OPENTREP_Service::checkXapianDBOnFileSystem
bool checkXapianDBOnFileSystem(const TravelDBFilePath_T &) const
Definition
OPENTREP_Service.cpp:207
OPENTREP::OPENTREP_Service::toggleShouldIncludeAllPORFlag
OPENTREP::shouldIndexNonIATAPOR_T toggleShouldIncludeAllPORFlag()
Definition
OPENTREP_Service.cpp:476
OPENTREP::OPENTREP_Service::FilePathSet_T
std::pair< const PORFilePath_T, const DBFilePathPair_T > FilePathSet_T
Definition
OPENTREP_Service.hpp:75
OPENTREP::OPENTREP_Service::getFilePaths
FilePathSet_T getFilePaths() const
Definition
OPENTREP_Service.cpp:180
OPENTREP::OPENTREP_Service::listByFaaCode
NbOfMatches_T listByFaaCode(const FAACode_T &, LocationList_T &)
Definition
OPENTREP_Service.cpp:709
OPENTREP::OPENTREP_Service::listByUICCode
NbOfMatches_T listByUICCode(const UICCode_T &, LocationList_T &)
Definition
OPENTREP_Service.cpp:807
OPENTREP::OPENTREP_Service::createSQLDBIndexes
void createSQLDBIndexes()
Definition
OPENTREP_Service.cpp:393
OPENTREP::OPENTREP_Service::createSQLDBUser
bool createSQLDBUser()
Definition
OPENTREP_Service.cpp:274
OPENTREP::OPENTREP_Service::listByIcaoCode
NbOfMatches_T listByIcaoCode(const ICAOCode_T &, LocationList_T &)
Definition
OPENTREP_Service.cpp:661
OPENTREP::OPENTREP_Service::interpretTravelRequest
NbOfMatches_T interpretTravelRequest(const std::string &iTravelQuery, LocationList_T &, WordList_T &)
Definition
OPENTREP_Service.cpp:965
OPENTREP::OPENTREP_Service::listByGeonameID
NbOfMatches_T listByGeonameID(const GeonamesID_T &, LocationList_T &)
Definition
OPENTREP_Service.cpp:854
OPENTREP::OPENTREP_Service::OPENTREP_Service
OPENTREP_Service(std::ostream &ioLogStream, const TravelDBFilePath_T &, const DBType &, const SQLDBConnectionString_T &, const DeploymentNumber_T &)
Definition
OPENTREP_Service.cpp:49
OPENTREP::OPENTREP_Service::getNbOfPORFromDB
NbOfDBEntries_T getNbOfPORFromDB()
Definition
OPENTREP_Service.cpp:566
OPENTREP::OPENTREP_Service::drawRandomLocations
NbOfMatches_T drawRandomLocations(const NbOfMatches_T &iNbOfDraws, LocationList_T &)
Definition
OPENTREP_Service.cpp:243
OPENTREP::OPENTREP_Service::getDeploymentNumber
const DeploymentNumber_T & getDeploymentNumber() const
Definition
OPENTREP_Service.cpp:164
OPENTREP::OPENTREP_Service::getIndexSize
NbOfDBEntries_T getIndexSize()
Definition
OPENTREP_Service.cpp:214
OPENTREP::OPENTREP_Service::toggleShouldIndexPORInXapianFlag
OPENTREP::shouldIndexPORInXapian_T toggleShouldIndexPORInXapianFlag()
Definition
OPENTREP_Service.cpp:506
OPENTREP::OPENTREP_Service::createSQLDBTables
void createSQLDBTables()
Definition
OPENTREP_Service.cpp:343
OPENTREP::OPENTREP_Service::DBFilePathPair_T
std::pair< const TravelDBFilePath_T, const SQLDBConnectionString_T > DBFilePathPair_T
Definition
OPENTREP_Service.hpp:74
OPENTREP::OPENTREP_Service::insertIntoDBAndXapian
NbOfDBEntries_T insertIntoDBAndXapian()
Definition
OPENTREP_Service.cpp:901
OPENTREP::OPENTREP_Service::toggleDeploymentNumber
OPENTREP::DeploymentNumber_T toggleDeploymentNumber()
Definition
OPENTREP_Service.cpp:444
OPENTREP::OPENTREP_Service::~OPENTREP_Service
~OPENTREP_Service()
Definition
OPENTREP_Service.cpp:70
OPENTREP::OPENTREP_Service::toggleShouldAddPORInSQLDBFlag
OPENTREP::shouldAddPORInSQLDB_T toggleShouldAddPORInSQLDBFlag()
Definition
OPENTREP_Service.cpp:537
OPENTREP
Definition
BasChronometer.cpp:10
OPENTREP::WordList_T
std::list< Word_T > WordList_T
Definition
OPENTREP_Types.hpp:690
OPENTREP::UICCode_T
unsigned int UICCode_T
Definition
OPENTREP_Types.hpp:238
OPENTREP::shouldAddPORInSQLDB_T
bool shouldAddPORInSQLDB_T
Definition
OPENTREP_Types.hpp:146
OPENTREP::NbOfDBEntries_T
unsigned int NbOfDBEntries_T
Definition
OPENTREP_Types.hpp:680
OPENTREP::LocationList_T
std::list< Location > LocationList_T
Definition
LocationList.hpp:18
OPENTREP::shouldIndexPORInXapian_T
bool shouldIndexPORInXapian_T
Definition
OPENTREP_Types.hpp:141
OPENTREP::DeploymentNumber_T
unsigned short DeploymentNumber_T
Definition
OPENTREP_Types.hpp:108
OPENTREP::NbOfMatches_T
unsigned short NbOfMatches_T
Definition
OPENTREP_Types.hpp:715
OPENTREP::GeonamesID_T
unsigned int GeonamesID_T
Definition
OPENTREP_Types.hpp:182
OPENTREP::shouldIndexNonIATAPOR_T
bool shouldIndexNonIATAPOR_T
Definition
OPENTREP_Types.hpp:136
OPENTREP::DBType
Enumeration of database types.
Definition
DBType.hpp:17
OPENTREP::FAACode_T
Definition
OPENTREP_Types.hpp:199
OPENTREP::IATACode_T
Definition
OPENTREP_Types.hpp:154
OPENTREP::ICAOCode_T
Definition
OPENTREP_Types.hpp:170
OPENTREP::PORFilePath_T
Definition
OPENTREP_Types.hpp:37
OPENTREP::SQLDBConnectionString_T
Definition
OPENTREP_Types.hpp:56
OPENTREP::TravelDBFilePath_T
Definition
OPENTREP_Types.hpp:46
OPENTREP::UNLOCode_T
Definition
OPENTREP_Types.hpp:225
Generated on
for OpenTREP by
1.17.0