TvlSim Logo  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
11
12namespace TVLSIM {
13
14 FacDsimServiceContext* FacDsimServiceContext::_instance = NULL;
15
16 // //////////////////////////////////////////////////////////////////////
18 _instance = NULL;
19 }
20
21 // //////////////////////////////////////////////////////////////////////
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 // //////////////////////////////////////////////////////////////////////
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}
static FacDsimServiceContext & instance()
Class holding the context of the Dsim services.