TraDemGen Logo  1.00.12
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
11
12namespace TRADEMGEN {
13
14 FacTRADEMGENServiceContext* FacTRADEMGENServiceContext::_instance = NULL;
15
16 // //////////////////////////////////////////////////////////////////////
20
21 // //////////////////////////////////////////////////////////////////////
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 // //////////////////////////////////////////////////////////////////////
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}
Factory for creating the TraDemGen service context instance.
TRADEMGEN_ServiceContext & create(const stdair::RandomSeed_T &)
static FacTRADEMGENServiceContext & instance()
Class holding the context of the Trademgen services.