1.00.9
C++ Simulated Travel Demand Generation Library
Loading...
Searching...
No Matches
FacTRADEMGENServiceContext.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
// TraDemGen
9
#include <
trademgen/factory/FacTRADEMGENServiceContext.hpp
>
10
#include <
trademgen/service/TRADEMGEN_ServiceContext.hpp
>
11
12
namespace
TRADEMGEN
{
13
14
FacTRADEMGENServiceContext* FacTRADEMGENServiceContext::_instance = NULL;
15
16
// //////////////////////////////////////////////////////////////////////
17
FacTRADEMGENServiceContext::~FacTRADEMGENServiceContext
() {
18
_instance = NULL;
19
}
20
21
// //////////////////////////////////////////////////////////////////////
22
FacTRADEMGENServiceContext
&
FacTRADEMGENServiceContext::instance
() {
23
24
if
(_instance == NULL) {
25
_instance =
new
FacTRADEMGENServiceContext
();
26
assert (_instance != NULL);
27
28
stdair::FacSupervisor::instance().registerServiceFactory (_instance);
29
}
30
return
*_instance;
31
}
32
33
// //////////////////////////////////////////////////////////////////////
34
TRADEMGEN_ServiceContext
&
FacTRADEMGENServiceContext::
35
create
(
const
stdair::RandomSeed_T& iRandomSeed) {
36
TRADEMGEN_ServiceContext
* aServiceContext_ptr = NULL;
37
38
aServiceContext_ptr =
new
TRADEMGEN_ServiceContext
(iRandomSeed);
39
assert (aServiceContext_ptr != NULL);
40
41
// The new object is added to the Bom pool
42
_pool.push_back (aServiceContext_ptr);
43
44
return
*aServiceContext_ptr;
45
}
46
47
}
TRADEMGEN_ServiceContext.hpp
FacTRADEMGENServiceContext.hpp
TRADEMGEN
Definition
BasConst.cpp:10
TRADEMGEN::FacTRADEMGENServiceContext
Factory for creating the TraDemGen service context instance.
Definition
FacTRADEMGENServiceContext.hpp:21
TRADEMGEN::FacTRADEMGENServiceContext::FacTRADEMGENServiceContext
FacTRADEMGENServiceContext()
Definition
FacTRADEMGENServiceContext.hpp:57
TRADEMGEN::FacTRADEMGENServiceContext::create
TRADEMGEN_ServiceContext & create(const stdair::RandomSeed_T &)
Definition
FacTRADEMGENServiceContext.cpp:35
TRADEMGEN::FacTRADEMGENServiceContext::instance
static FacTRADEMGENServiceContext & instance()
Definition
FacTRADEMGENServiceContext.cpp:22
TRADEMGEN::FacTRADEMGENServiceContext::~FacTRADEMGENServiceContext
~FacTRADEMGENServiceContext()
Definition
FacTRADEMGENServiceContext.cpp:17
TRADEMGEN::TRADEMGEN_ServiceContext
Class holding the context of the Trademgen services.
Definition
TRADEMGEN_ServiceContext.hpp:34
Generated on Tue Nov 21 2023 00:00:00 for TraDemGen by
1.9.8