AirInv Logo  1.00.3
C++ Simulated Airline Inventory Management System library
FacAirinvMasterServiceContext.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 // AirInv
11 
12 namespace AIRINV {
13 
14  FacAirinvMasterServiceContext* FacAirinvMasterServiceContext::_instance = NULL;
15 
16  // //////////////////////////////////////////////////////////////////////
18  _instance = NULL;
19  }
20 
21  // //////////////////////////////////////////////////////////////////////
23 
24  if (_instance == NULL) {
25  _instance = new FacAirinvMasterServiceContext();
26  assert (_instance != NULL);
27 
28  stdair::FacSupervisor::instance().registerServiceFactory (_instance);
29  }
30  return *_instance;
31  }
32 
33  // //////////////////////////////////////////////////////////////////////
35  AIRINV_Master_ServiceContext* aAIRINV_Master_ServiceContext_ptr = NULL;
36 
37  aAIRINV_Master_ServiceContext_ptr = new AIRINV_Master_ServiceContext();
38  assert (aAIRINV_Master_ServiceContext_ptr != NULL);
39 
40  // The new object is added to the Bom pool
41  _pool.push_back (aAIRINV_Master_ServiceContext_ptr);
42 
43  return *aAIRINV_Master_ServiceContext_ptr;
44  }
45 
46 }
AIRINV::AIRINV_Master_ServiceContext
Definition: AIRINV_Master_ServiceContext.hpp:28
AIRINV_Master_ServiceContext.hpp
AIRINV::FacAirinvMasterServiceContext::create
AIRINV_Master_ServiceContext & create()
Definition: FacAirinvMasterServiceContext.cpp:34
AIRINV::FacAirinvMasterServiceContext::FacAirinvMasterServiceContext
FacAirinvMasterServiceContext()
Definition: FacAirinvMasterServiceContext.hpp:44
AIRINV::FacAirinvMasterServiceContext::instance
static FacAirinvMasterServiceContext & instance()
Definition: FacAirinvMasterServiceContext.cpp:22
AIRINV::FacAirinvMasterServiceContext::~FacAirinvMasterServiceContext
~FacAirinvMasterServiceContext()
Definition: FacAirinvMasterServiceContext.cpp:17
AIRINV
Definition: AIRINV_Master_Service.hpp:38
FacAirinvMasterServiceContext.hpp
AIRINV::FacAirinvMasterServiceContext
Factory for Bucket.
Definition: FacAirinvMasterServiceContext.hpp:20