AirTSP Logo  1.01.9
C++ Simulated Airline Travel Solution Provider (TSP) Library
Loading...
Searching...
No Matches
FacAIRTSPServiceContext.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// AirTSP
11
12namespace AIRTSP {
13
14 FacAIRTSPServiceContext* FacAIRTSPServiceContext::_instance = NULL;
15
16 // //////////////////////////////////////////////////////////////////////
18 _instance = NULL;
19 }
20
21 // //////////////////////////////////////////////////////////////////////
23
24 if (_instance == NULL) {
25 _instance = new FacAIRTSPServiceContext();
26 assert (_instance != NULL);
27
28 stdair::FacSupervisor::instance().registerServiceFactory (_instance);
29 }
30 return *_instance;
31 }
32
33 // //////////////////////////////////////////////////////////////////////
35 AIRTSP_ServiceContext* aServiceContext_ptr = NULL;
36
37 aServiceContext_ptr = new AIRTSP_ServiceContext();
38 assert (aServiceContext_ptr != NULL);
39
40 // The new object is added to the Bom pool
41 _pool.push_back (aServiceContext_ptr);
42
43 return *aServiceContext_ptr;
44 }
45
46}
Class holding the context of the Airtsp services.
Factory for the service context.
static FacAIRTSPServiceContext & instance()