1.00.0
C++ Simulated Travel-Oriented Distribution System Library
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Friends
Macros
Pages
FacSimcrsServiceContext.cpp
Go to the documentation of this file.
1
// //////////////////////////////////////////////////////////////////////
2
// Import section
3
// //////////////////////////////////////////////////////////////////////
4
// STL
5
#include <cassert>
6
// SIMCRS Common
7
#include <
simcrs/factory/FacSupervisor.hpp
>
8
#include <
simcrs/factory/FacSimcrsServiceContext.hpp
>
9
#include <
simcrs/service/SIMCRS_ServiceContext.hpp
>
10
11
namespace
SIMCRS {
12
13
FacSimcrsServiceContext* FacSimcrsServiceContext::_instance = NULL;
14
15
// //////////////////////////////////////////////////////////////////////
16
FacSimcrsServiceContext::~FacSimcrsServiceContext
() {
17
_instance = NULL;
18
}
19
20
// //////////////////////////////////////////////////////////////////////
21
FacSimcrsServiceContext
&
FacSimcrsServiceContext::instance
() {
22
23
if
(_instance == NULL) {
24
_instance =
new
FacSimcrsServiceContext
();
25
assert (_instance != NULL);
26
27
FacSupervisor::instance
().
registerServiceFactory
(_instance);
28
}
29
return
*_instance;
30
}
31
32
// //////////////////////////////////////////////////////////////////////
33
SIMCRS_ServiceContext
&
FacSimcrsServiceContext::
34
create
(
const
std::string& iTravelDatabaseName) {
35
SIMCRS_ServiceContext
* aSIMCRS_ServiceContext_ptr = NULL;
36
37
aSIMCRS_ServiceContext_ptr =
38
new
SIMCRS_ServiceContext
(iTravelDatabaseName);
39
assert (aSIMCRS_ServiceContext_ptr != NULL);
40
41
// The new object is added to the Bom pool
42
_pool
.push_back (aSIMCRS_ServiceContext_ptr);
43
44
return
*aSIMCRS_ServiceContext_ptr;
45
}
46
47
}
SIMCRS::SIMCRS_ServiceContext
Class holding the context of the Simcrs services.
Definition:
SIMCRS_ServiceContext.hpp:32
SIMCRS::FacSupervisor::instance
static FacSupervisor & instance()
Definition:
FacSupervisor.cpp:20
SIMCRS::FacSimcrsServiceContext::instance
static FacSimcrsServiceContext & instance()
Definition:
FacSimcrsServiceContext.cpp:21
SIMCRS::FacSimcrsServiceContext::create
SIMCRS_ServiceContext & create(const std::string &iTravelDatabaseName)
Definition:
FacSimcrsServiceContext.cpp:34
SIMCRS::FacSimcrsServiceContext
Definition:
FacSimcrsServiceContext.hpp:18
SIMCRS::FacSimcrsServiceContext::~FacSimcrsServiceContext
~FacSimcrsServiceContext()
Definition:
FacSimcrsServiceContext.cpp:16
SIMCRS_ServiceContext.hpp
SIMCRS::FacSupervisor::registerServiceFactory
void registerServiceFactory(FacServiceAbstract *)
Definition:
FacSupervisor.cpp:36
FacSupervisor.hpp
SIMCRS::FacServiceAbstract::_pool
ServicePool_T _pool
Definition:
FacServiceAbstract.hpp:34
FacSimcrsServiceContext.hpp
SIMCRS::FacSimcrsServiceContext::FacSimcrsServiceContext
FacSimcrsServiceContext()
Definition:
FacSimcrsServiceContext.hpp:42
Generated on Wed Sep 3 2014 06:32:41 for SimCRS by
1.8.7