$treeview $search $mathjax
SEvMgr Logo  1.00.2
$projectbrief
$projectbrief
$searchbox

FacSEVMGRServiceContext.cpp

Go to the documentation of this file.
00001 // //////////////////////////////////////////////////////////////////////
00002 // Import section
00003 // //////////////////////////////////////////////////////////////////////
00004 // STL
00005 #include <cassert>
00006 // StdAir
00007 #include <stdair/service/FacSupervisor.hpp>
00008 // Sevmgr
00009 #include <sevmgr/factory/FacSEVMGRServiceContext.hpp>
00010 #include <sevmgr/service/SEVMGR_ServiceContext.hpp>
00011 
00012 namespace SEVMGR {
00013 
00014   FacSEVMGRServiceContext* FacSEVMGRServiceContext::_instance = NULL;
00015 
00016   // //////////////////////////////////////////////////////////////////////
00017   FacSEVMGRServiceContext::~FacSEVMGRServiceContext () {
00018     _instance = NULL;
00019   }
00020 
00021   // //////////////////////////////////////////////////////////////////////
00022   FacSEVMGRServiceContext& FacSEVMGRServiceContext::instance () {
00023 
00024     if (_instance == NULL) {
00025       _instance = new FacSEVMGRServiceContext();
00026       assert (_instance != NULL);
00027       
00028       stdair::FacSupervisor::instance().registerServiceFactory (_instance);
00029     }
00030     return *_instance;
00031   }
00032 
00033   // //////////////////////////////////////////////////////////////////////
00034   SEVMGR_ServiceContext& FacSEVMGRServiceContext::create () {
00035     SEVMGR_ServiceContext* aServiceContext_ptr = NULL;
00036 
00037     aServiceContext_ptr = new SEVMGR_ServiceContext ();
00038     assert (aServiceContext_ptr != NULL);
00039 
00040     // The new object is added to the Bom pool
00041     _pool.push_back (aServiceContext_ptr);
00042 
00043     return *aServiceContext_ptr;
00044   }
00045 
00046 }