0.08.01
C++ Open Travel Request Parsing Library
Toggle main menu visibility
Loading...
Searching...
No Matches
OPENTREP_ServiceContext.hpp
Go to the documentation of this file.
1
#ifndef __OPENTREP_SVC_OPENTREPSERVICECONTEXT_HPP
2
#define __OPENTREP_SVC_OPENTREPSERVICECONTEXT_HPP
3
4
// //////////////////////////////////////////////////////////////////////
5
// Import section
6
// //////////////////////////////////////////////////////////////////////
7
// STL
8
#include <string>
9
// OpenTrep
10
#include <
opentrep/OPENTREP_Types.hpp
>
11
#include <
opentrep/DBType.hpp
>
12
#include <
opentrep/basic/OTransliterator.hpp
>
13
#include <
opentrep/service/ServiceAbstract.hpp
>
14
15
// Forward declarations
16
namespace
soci
{
17
class
session;
18
}
19
20
namespace
OPENTREP
{
21
22
// Forward declarations
23
class
World
;
24
28
class
OPENTREP_ServiceContext :
public
ServiceAbstract
{
29
friend
class
FacOpenTrepServiceContext
;
30
public
:
31
// /////////////////// Getters //////////////////////
35
World
*
getWorld
()
const
{
36
return
_world;
37
}
38
42
World
&
getWorldHandler
()
const
;
43
47
const
PORFilePath_T
&
getPORFilePath
()
const
{
48
return
_porFilePath;
49
}
50
54
const
TravelDBFilePath_T
&
getTravelDBFilePath
()
const
{
55
return
_travelDBFilePath;
56
}
57
61
const
DBType
&
getSQLDBType
()
const
{
62
return
_sqlDBType;
63
}
64
68
const
SQLDBConnectionString_T
&
getSQLDBConnectionString
()
const
{
69
return
_sqlDBConnectionString;
70
}
71
75
const
DeploymentNumber_T
&
getDeploymentNumber
()
const
{
76
return
_deploymentNumber;
77
}
78
82
const
shouldIndexNonIATAPOR_T
&
getShouldIncludeAllPORFlag
()
const
{
83
return
_shouldIndexNonIATAPOR;
84
}
85
89
const
shouldIndexPORInXapian_T
&
getShouldIndexPORInXapianFlag
()
const
{
90
return
_shouldIndexPORInXapian;
91
}
92
96
const
shouldAddPORInSQLDB_T
&
getShouldAddPORInSQLDB
()
const
{
97
return
_shouldAddPORInSQLDB;
98
}
99
103
const
OTransliterator
&
getTransliterator
()
const
{
104
return
_transliterator;
105
}
106
107
public
:
108
// ////////////////// Setters /////////////////////
112
void
setWorld
(
World
& ioWorld) {
113
_world = &ioWorld;
114
}
115
119
void
setPORFilePath
(
const
std::string& iPORFilePath) {
120
_porFilePath =
PORFilePath_T
(iPORFilePath);
121
}
122
126
void
setTravelDBFilePath
(
const
std::string& iTravelDBFilePath) {
127
_travelDBFilePathPrefix =
TravelDBFilePath_T
(iTravelDBFilePath);
128
updateXapianAndSQLDBConnectionWithDeploymentNumber();
129
}
130
134
void
setSQLDBType
(
const
DBType
& iDBType) {
135
_sqlDBType = iDBType;
136
}
137
141
void
setSQLDBConnectionString
(
const
std::string& iSQLDBConnStr) {
142
_sqlDBConnectionStringWPfxDBName =
SQLDBConnectionString_T
(iSQLDBConnStr);
143
updateXapianAndSQLDBConnectionWithDeploymentNumber();
144
}
145
149
void
setDeploymentNumber
(
const
DeploymentNumber_T
& iDeploymentNumber) {
150
_deploymentNumber = iDeploymentNumber;
151
updateXapianAndSQLDBConnectionWithDeploymentNumber();
152
}
153
157
void
setShouldIncludeAllPORFlag
(
const
shouldIndexNonIATAPOR_T
& iShouldIndexNonIATAPOR) {
158
_shouldIndexNonIATAPOR = iShouldIndexNonIATAPOR;
159
}
160
164
void
setShouldIndexPORInXapianFlag
(
const
shouldIndexPORInXapian_T
& iShouldIndexPORInXapian) {
165
_shouldIndexPORInXapian = iShouldIndexPORInXapian;
166
}
167
171
void
setShouldAddPORInSQLDB
(
const
shouldAddPORInSQLDB_T
& iShouldAddPORInSQLDB) {
172
_shouldAddPORInSQLDB = iShouldAddPORInSQLDB;
173
}
174
178
void
setTransliterator
(
const
OTransliterator
& iTransliterator) {
179
_transliterator = iTransliterator;
180
}
181
182
183
public
:
184
// ///////// Display Methods //////////
188
const
std::string
shortDisplay
()
const
;
189
193
const
std::string
display
()
const
;
194
195
196
private
:
197
// /////// Construction / initialisation ////////
206
OPENTREP_ServiceContext
(
const
TravelDBFilePath_T
&,
207
const
DBType
&,
const
SQLDBConnectionString_T
&,
208
const
DeploymentNumber_T
&);
209
223
OPENTREP_ServiceContext
(
const
PORFilePath_T
&,
const
TravelDBFilePath_T
&,
224
const
DBType
&,
const
SQLDBConnectionString_T
&,
225
const
DeploymentNumber_T
&,
226
const
shouldIndexNonIATAPOR_T
&,
227
const
shouldIndexPORInXapian_T
&,
228
const
shouldAddPORInSQLDB_T
&);
229
249
void
updateXapianAndSQLDBConnectionWithDeploymentNumber();
250
254
OPENTREP_ServiceContext
();
255
259
OPENTREP_ServiceContext
(
const
OPENTREP_ServiceContext
&);
260
264
virtual
~OPENTREP_ServiceContext
();
265
266
267
private
:
268
// ////////////// Attributes ///////////////
272
World
* _world;
273
277
PORFilePath_T
_porFilePath;
278
305
DeploymentNumber_T
_deploymentNumber;
306
310
TravelDBFilePath_T
_travelDBFilePathPrefix;
311
315
TravelDBFilePath_T
_travelDBFilePath;
316
320
DBType
_sqlDBType;
321
335
SQLDBConnectionString_T
_sqlDBConnectionStringWPfxDBName;
336
352
SQLDBConnectionString_T
_sqlDBConnectionString;
353
380
shouldIndexNonIATAPOR_T
_shouldIndexNonIATAPOR;
381
385
shouldIndexPORInXapian_T
_shouldIndexPORInXapian;
386
390
shouldAddPORInSQLDB_T
_shouldAddPORInSQLDB;
391
395
OTransliterator
_transliterator;
396
};
397
398
}
399
#endif
// __OPENTREP_SVC_OPENTREPSERVICECONTEXT_HPP
DBType.hpp
OPENTREP_Types.hpp
OTransliterator.hpp
ServiceAbstract.hpp
OPENTREP::OPENTREP_ServiceContext
Class holding the context of the OpenTrep services.
Definition
OPENTREP_ServiceContext.hpp:28
OPENTREP::OPENTREP_ServiceContext::FacOpenTrepServiceContext
friend class FacOpenTrepServiceContext
Definition
OPENTREP_ServiceContext.hpp:29
OPENTREP::OPENTREP_ServiceContext::getShouldAddPORInSQLDB
const shouldAddPORInSQLDB_T & getShouldAddPORInSQLDB() const
Definition
OPENTREP_ServiceContext.hpp:96
OPENTREP::OPENTREP_ServiceContext::getWorldHandler
World & getWorldHandler() const
Definition
OPENTREP_ServiceContext.cpp:169
OPENTREP::OPENTREP_ServiceContext::setTravelDBFilePath
void setTravelDBFilePath(const std::string &iTravelDBFilePath)
Definition
OPENTREP_ServiceContext.hpp:126
OPENTREP::OPENTREP_ServiceContext::shortDisplay
const std::string shortDisplay() const
Definition
OPENTREP_ServiceContext.cpp:175
OPENTREP::OPENTREP_ServiceContext::setShouldIndexPORInXapianFlag
void setShouldIndexPORInXapianFlag(const shouldIndexPORInXapian_T &iShouldIndexPORInXapian)
Definition
OPENTREP_ServiceContext.hpp:164
OPENTREP::OPENTREP_ServiceContext::getTransliterator
const OTransliterator & getTransliterator() const
Definition
OPENTREP_ServiceContext.hpp:103
OPENTREP::OPENTREP_ServiceContext::setTransliterator
void setTransliterator(const OTransliterator &iTransliterator)
Definition
OPENTREP_ServiceContext.hpp:178
OPENTREP::OPENTREP_ServiceContext::setPORFilePath
void setPORFilePath(const std::string &iPORFilePath)
Definition
OPENTREP_ServiceContext.hpp:119
OPENTREP::OPENTREP_ServiceContext::getSQLDBConnectionString
const SQLDBConnectionString_T & getSQLDBConnectionString() const
Definition
OPENTREP_ServiceContext.hpp:68
OPENTREP::OPENTREP_ServiceContext::getSQLDBType
const DBType & getSQLDBType() const
Definition
OPENTREP_ServiceContext.hpp:61
OPENTREP::OPENTREP_ServiceContext::setWorld
void setWorld(World &ioWorld)
Definition
OPENTREP_ServiceContext.hpp:112
OPENTREP::OPENTREP_ServiceContext::setSQLDBConnectionString
void setSQLDBConnectionString(const std::string &iSQLDBConnStr)
Definition
OPENTREP_ServiceContext.hpp:141
OPENTREP::OPENTREP_ServiceContext::setShouldIncludeAllPORFlag
void setShouldIncludeAllPORFlag(const shouldIndexNonIATAPOR_T &iShouldIndexNonIATAPOR)
Definition
OPENTREP_ServiceContext.hpp:157
OPENTREP::OPENTREP_ServiceContext::setShouldAddPORInSQLDB
void setShouldAddPORInSQLDB(const shouldAddPORInSQLDB_T &iShouldAddPORInSQLDB)
Definition
OPENTREP_ServiceContext.hpp:171
OPENTREP::OPENTREP_ServiceContext::getWorld
World * getWorld() const
Definition
OPENTREP_ServiceContext.hpp:35
OPENTREP::OPENTREP_ServiceContext::getShouldIndexPORInXapianFlag
const shouldIndexPORInXapian_T & getShouldIndexPORInXapianFlag() const
Definition
OPENTREP_ServiceContext.hpp:89
OPENTREP::OPENTREP_ServiceContext::setDeploymentNumber
void setDeploymentNumber(const DeploymentNumber_T &iDeploymentNumber)
Definition
OPENTREP_ServiceContext.hpp:149
OPENTREP::OPENTREP_ServiceContext::display
const std::string display() const
Definition
OPENTREP_ServiceContext.cpp:196
OPENTREP::OPENTREP_ServiceContext::getDeploymentNumber
const DeploymentNumber_T & getDeploymentNumber() const
Definition
OPENTREP_ServiceContext.hpp:75
OPENTREP::OPENTREP_ServiceContext::setSQLDBType
void setSQLDBType(const DBType &iDBType)
Definition
OPENTREP_ServiceContext.hpp:134
OPENTREP::OPENTREP_ServiceContext::getPORFilePath
const PORFilePath_T & getPORFilePath() const
Definition
OPENTREP_ServiceContext.hpp:47
OPENTREP::OPENTREP_ServiceContext::getTravelDBFilePath
const TravelDBFilePath_T & getTravelDBFilePath() const
Definition
OPENTREP_ServiceContext.hpp:54
OPENTREP::OPENTREP_ServiceContext::getShouldIncludeAllPORFlag
const shouldIndexNonIATAPOR_T & getShouldIncludeAllPORFlag() const
Definition
OPENTREP_ServiceContext.hpp:82
OPENTREP::OTransliterator
Definition
OTransliterator.hpp:18
OPENTREP::ServiceAbstract::ServiceAbstract
ServiceAbstract()
Definition
ServiceAbstract.hpp:30
OPENTREP::World
Definition
World.hpp:20
OPENTREP
Definition
BasChronometer.cpp:10
OPENTREP::shouldAddPORInSQLDB_T
bool shouldAddPORInSQLDB_T
Definition
OPENTREP_Types.hpp:146
OPENTREP::shouldIndexPORInXapian_T
bool shouldIndexPORInXapian_T
Definition
OPENTREP_Types.hpp:141
OPENTREP::DeploymentNumber_T
unsigned short DeploymentNumber_T
Definition
OPENTREP_Types.hpp:108
OPENTREP::shouldIndexNonIATAPOR_T
bool shouldIndexNonIATAPOR_T
Definition
OPENTREP_Types.hpp:136
soci
Definition
DBManager.hpp:14
OPENTREP::DBType
Enumeration of database types.
Definition
DBType.hpp:17
OPENTREP::PORFilePath_T
Definition
OPENTREP_Types.hpp:37
OPENTREP::SQLDBConnectionString_T
Definition
OPENTREP_Types.hpp:56
OPENTREP::TravelDBFilePath_T
Definition
OPENTREP_Types.hpp:46
Generated on
for OpenTREP by
1.17.0