1.01.6
C++ Simulated Travel-Oriented Distribution System Library
Loading...
Searching...
No Matches
FacDsimServiceContext.cpp
Go to the documentation of this file.
1
// //////////////////////////////////////////////////////////////////////
2
// Import section
3
// //////////////////////////////////////////////////////////////////////
4
// STL
5
#include <cassert>
6
// StdAir
7
#include <stdair/service/FacSupervisor.hpp>
8
// TvlSim
9
#include <
tvlsim/factory/FacDsimServiceContext.hpp
>
10
#include <
tvlsim/service/TVLSIM_ServiceContext.hpp
>
11
12
namespace
TVLSIM
{
13
14
FacDsimServiceContext* FacDsimServiceContext::_instance = NULL;
15
16
// //////////////////////////////////////////////////////////////////////
17
FacDsimServiceContext::~FacDsimServiceContext
() {
18
_instance = NULL;
19
}
20
21
// //////////////////////////////////////////////////////////////////////
22
FacDsimServiceContext
&
FacDsimServiceContext::instance
() {
23
24
if
(_instance == NULL) {
25
_instance =
new
FacDsimServiceContext
();
26
assert (_instance != NULL);
27
28
stdair::FacSupervisor::instance().registerServiceFactory (_instance);
29
}
30
return
*_instance;
31
}
32
33
// //////////////////////////////////////////////////////////////////////
34
TVLSIM_ServiceContext
&
FacDsimServiceContext::
35
create
() {
36
TVLSIM_ServiceContext
* aTVLSIM_ServiceContext_ptr = NULL;
37
38
aTVLSIM_ServiceContext_ptr =
new
TVLSIM_ServiceContext
();
39
assert (aTVLSIM_ServiceContext_ptr != NULL);
40
41
// The new object is added to the Bom pool
42
_pool.push_back (aTVLSIM_ServiceContext_ptr);
43
44
return
*aTVLSIM_ServiceContext_ptr;
45
}
46
47
}
FacDsimServiceContext.hpp
TVLSIM_ServiceContext.hpp
TVLSIM::FacDsimServiceContext
Definition
FacDsimServiceContext.hpp:19
TVLSIM::FacDsimServiceContext::FacDsimServiceContext
FacDsimServiceContext()
Definition
FacDsimServiceContext.hpp:43
TVLSIM::FacDsimServiceContext::instance
static FacDsimServiceContext & instance()
Definition
FacDsimServiceContext.cpp:22
TVLSIM::FacDsimServiceContext::create
TVLSIM_ServiceContext & create()
Definition
FacDsimServiceContext.cpp:35
TVLSIM::FacDsimServiceContext::~FacDsimServiceContext
~FacDsimServiceContext()
Definition
FacDsimServiceContext.cpp:17
TVLSIM::TVLSIM_ServiceContext
Class holding the context of the Dsim services.
Definition
TVLSIM_ServiceContext.hpp:30
TVLSIM
Definition
BasConst.cpp:7
Generated on Sun Oct 22 2023 00:00:00 for TvlSim by
1.9.8