0.6.0
C++ Open Travel Request Parsing Library
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
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,
36
const
SQLiteDBFilePath_T
& iSQLiteDBFilePath) {
37
OPENTREP_ServiceContext
* aOPENTREP_ServiceContext_ptr = NULL;
38
39
aOPENTREP_ServiceContext_ptr =
40
new
OPENTREP_ServiceContext
(iTravelDBFilePath, iSQLiteDBFilePath);
41
assert (aOPENTREP_ServiceContext_ptr != NULL);
42
43
// The new object is added to the Bom pool
44
_pool
.push_back (aOPENTREP_ServiceContext_ptr);
45
46
return
*aOPENTREP_ServiceContext_ptr;
47
}
48
49
// //////////////////////////////////////////////////////////////////////
50
OPENTREP_ServiceContext
&
FacOpenTrepServiceContext::
51
create
(
const
PORFilePath_T
& iPORFilePath,
52
const
TravelDBFilePath_T
& iTravelDBFilePath,
53
const
SQLiteDBFilePath_T
& iSQLiteDBFilePath) {
54
OPENTREP_ServiceContext
* aOPENTREP_ServiceContext_ptr = NULL;
55
56
aOPENTREP_ServiceContext_ptr =
57
new
OPENTREP_ServiceContext
(iPORFilePath, iTravelDBFilePath, iSQLiteDBFilePath);
58
assert (aOPENTREP_ServiceContext_ptr != NULL);
59
60
// The new object is added to the Bom pool
61
_pool
.push_back (aOPENTREP_ServiceContext_ptr);
62
63
return
*aOPENTREP_ServiceContext_ptr;
64
}
65
66
}
OPENTREP::FacSupervisor::instance
static FacSupervisor & instance()
Definition:
FacSupervisor.cpp:22
OPENTREP::FacSupervisor::registerServiceFactory
void registerServiceFactory(FacServiceAbstract *)
Definition:
FacSupervisor.cpp:38
OPENTREP_Types.hpp
OPENTREP::FacOpenTrepServiceContext::~FacOpenTrepServiceContext
~FacOpenTrepServiceContext()
Definition:
FacOpenTrepServiceContext.cpp:17
OPENTREP::SQLiteDBFilePath_T
Definition:
OPENTREP_Types.hpp:56
OPENTREP::OPENTREP_ServiceContext
Class holding the context of the OpenTrep services.
Definition:
OPENTREP_ServiceContext.hpp:27
FacOpenTrepServiceContext.hpp
OPENTREP::TravelDBFilePath_T
Definition:
OPENTREP_Types.hpp:46
OPENTREP::FacOpenTrepServiceContext::instance
static FacOpenTrepServiceContext & instance()
Definition:
FacOpenTrepServiceContext.cpp:22
OPENTREP::FacServiceAbstract::_pool
ServicePool_T _pool
Definition:
FacServiceAbstract.hpp:34
OPENTREP_ServiceContext.hpp
OPENTREP::FacOpenTrepServiceContext::create
OPENTREP_ServiceContext & create(const TravelDBFilePath_T &, const SQLiteDBFilePath_T &)
Definition:
FacOpenTrepServiceContext.cpp:35
FacSupervisor.hpp
OPENTREP::FacOpenTrepServiceContext::FacOpenTrepServiceContext
FacOpenTrepServiceContext()
Definition:
FacOpenTrepServiceContext.hpp:71
OPENTREP::FacOpenTrepServiceContext
Factory for Bucket.
Definition:
FacOpenTrepServiceContext.hpp:19
OPENTREP::PORFilePath_T
Definition:
OPENTREP_Types.hpp:37
Generated on Mon Feb 3 2014 14:17:07 for OpenTREP by
1.8.6