0.08.01
C++ Open Travel Request Parsing Library
Toggle main menu visibility
Loading...
Searching...
No Matches
FacOpenTrepServiceContext.cpp
Go to the documentation of this file.
1
// //////////////////////////////////////////////////////////////////////
2
// Import section
3
// //////////////////////////////////////////////////////////////////////
4
// STL
5
#include <cassert>
6
// OpenTrep
7
#include <
opentrep/OPENTREP_Types.hpp
>
8
#include <
opentrep/factory/FacSupervisor.hpp
>
9
#include <
opentrep/factory/FacOpenTrepServiceContext.hpp
>
10
#include <
opentrep/service/OPENTREP_ServiceContext.hpp
>
11
12
namespace
OPENTREP
{
13
14
FacOpenTrepServiceContext
* FacOpenTrepServiceContext::_instance = NULL;
15
16
// //////////////////////////////////////////////////////////////////////
17
FacOpenTrepServiceContext::~FacOpenTrepServiceContext
() {
18
_instance = NULL;
19
}
20
21
// //////////////////////////////////////////////////////////////////////
22
FacOpenTrepServiceContext
&
FacOpenTrepServiceContext::instance
() {
23
24
if
(_instance == NULL) {
25
_instance =
new
FacOpenTrepServiceContext
();
26
assert (_instance != NULL);
27
28
FacSupervisor::instance
().
registerServiceFactory
(_instance);
29
}
30
return
*_instance;
31
}
32
33
// //////////////////////////////////////////////////////////////////////
34
OPENTREP_ServiceContext
&
FacOpenTrepServiceContext::
35
create
(
const
TravelDBFilePath_T
& iTravelDBFilePath,
const
DBType
& iSQLDBType,
36
const
SQLDBConnectionString_T
& iSQLDBConnStr,
37
const
DeploymentNumber_T
& iDeploymentNumber) {
38
OPENTREP_ServiceContext
* aOPENTREP_ServiceContext_ptr = NULL;
39
40
aOPENTREP_ServiceContext_ptr =
41
new
OPENTREP_ServiceContext
(iTravelDBFilePath, iSQLDBType, iSQLDBConnStr,
42
iDeploymentNumber);
43
assert (aOPENTREP_ServiceContext_ptr != NULL);
44
45
// The new object is added to the Bom pool
46
_pool
.push_back (aOPENTREP_ServiceContext_ptr);
47
48
return
*aOPENTREP_ServiceContext_ptr;
49
}
50
51
// //////////////////////////////////////////////////////////////////////
52
OPENTREP_ServiceContext
&
FacOpenTrepServiceContext::
53
create
(
const
PORFilePath_T
& iPORFilePath,
54
const
TravelDBFilePath_T
& iTravelDBFilePath,
const
DBType
& iSQLDBType,
55
const
SQLDBConnectionString_T
& iSQLDBConnStr,
56
const
DeploymentNumber_T
& iDeploymentNumber,
57
const
shouldIndexNonIATAPOR_T
& iShouldIndexNonIATAPOR,
58
const
shouldIndexPORInXapian_T
& iShouldIndexPORInXapian,
59
const
shouldAddPORInSQLDB_T
& iShouldAddPORInSQLDB) {
60
OPENTREP_ServiceContext
* aOPENTREP_ServiceContext_ptr = NULL;
61
62
aOPENTREP_ServiceContext_ptr =
63
new
OPENTREP_ServiceContext
(iPORFilePath, iTravelDBFilePath, iSQLDBType,
64
iSQLDBConnStr, iDeploymentNumber,
65
iShouldIndexNonIATAPOR,
66
iShouldIndexPORInXapian,
67
iShouldAddPORInSQLDB);
68
assert (aOPENTREP_ServiceContext_ptr != NULL);
69
70
// The new object is added to the Service pool
71
_pool
.push_back (aOPENTREP_ServiceContext_ptr);
72
73
return
*aOPENTREP_ServiceContext_ptr;
74
}
75
76
}
FacOpenTrepServiceContext.hpp
FacSupervisor.hpp
OPENTREP_ServiceContext.hpp
OPENTREP_Types.hpp
OPENTREP::FacOpenTrepServiceContext
Factory for an OPENTREP_ServiceContext object.
Definition
FacOpenTrepServiceContext.hpp:20
OPENTREP::FacOpenTrepServiceContext::~FacOpenTrepServiceContext
~FacOpenTrepServiceContext()
Definition
FacOpenTrepServiceContext.cpp:17
OPENTREP::FacOpenTrepServiceContext::FacOpenTrepServiceContext
FacOpenTrepServiceContext()
Definition
FacOpenTrepServiceContext.hpp:88
OPENTREP::FacOpenTrepServiceContext::create
OPENTREP_ServiceContext & create(const TravelDBFilePath_T &, const DBType &, const SQLDBConnectionString_T &, const DeploymentNumber_T &)
Definition
FacOpenTrepServiceContext.cpp:35
OPENTREP::FacOpenTrepServiceContext::instance
static FacOpenTrepServiceContext & instance()
Definition
FacOpenTrepServiceContext.cpp:22
OPENTREP::FacServiceAbstract::_pool
ServicePool_T _pool
Definition
FacServiceAbstract.hpp:34
OPENTREP::FacSupervisor::instance
static FacSupervisor & instance()
Definition
FacSupervisor.cpp:21
OPENTREP::FacSupervisor::registerServiceFactory
void registerServiceFactory(FacServiceAbstract *)
Definition
FacSupervisor.cpp:37
OPENTREP::OPENTREP_ServiceContext
Class holding the context of the OpenTrep services.
Definition
OPENTREP_ServiceContext.hpp:28
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
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