SimCRS Logo  1.01.8
C++ Simulated Travel-Oriented Distribution System Library
Loading...
Searching...
No Matches
FacSimcrsServiceContext.cpp
Go to the documentation of this file.
1// //////////////////////////////////////////////////////////////////////
2// Import section
3// //////////////////////////////////////////////////////////////////////
4// STL
5#include <cassert>
6// SIMCRS Common
10
11namespace SIMCRS {
12
13 FacSimcrsServiceContext* FacSimcrsServiceContext::_instance = NULL;
14
15 // //////////////////////////////////////////////////////////////////////
17 _instance = NULL;
18 }
19
20 // //////////////////////////////////////////////////////////////////////
22
23 if (_instance == NULL) {
24 _instance = new FacSimcrsServiceContext();
25 assert (_instance != NULL);
26
28 }
29 return *_instance;
30 }
31
32 // //////////////////////////////////////////////////////////////////////
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_ServiceContext & create(const std::string &iTravelDatabaseName)
static FacSimcrsServiceContext & instance()
void registerServiceFactory(FacServiceAbstract *)
static FacSupervisor & instance()
Class holding the context of the Simcrs services.