$treeview $search $mathjax
AirInv Logo  1.00.0
$projectbrief
$projectbrief
$searchbox

AIRINV_Master_ServiceContext.cpp

Go to the documentation of this file.
00001 // //////////////////////////////////////////////////////////////////////
00002 // Import section
00003 // //////////////////////////////////////////////////////////////////////
00004 // STL
00005 #include <cassert>
00006 #include <sstream>
00007 // Airinv
00008 #include <airinv/basic/BasConst_AIRINV_Service.hpp>
00009 #include <airinv/service/AIRINV_Master_ServiceContext.hpp>
00010 
00011 namespace AIRINV {
00012 
00013   // //////////////////////////////////////////////////////////////////////
00014   AIRINV_Master_ServiceContext::AIRINV_Master_ServiceContext()
00015     : _ownStdairService (false),
00016       _ownSEVMGRService (true) {
00017   }
00018 
00019   // //////////////////////////////////////////////////////////////////////
00020   AIRINV_Master_ServiceContext::~AIRINV_Master_ServiceContext() {
00021   }
00022   
00023   // //////////////////////////////////////////////////////////////////////
00024   const std::string AIRINV_Master_ServiceContext::shortDisplay() const {
00025     std::ostringstream oStr;
00026     oStr << "AIRINV_Master_ServiceContext -- Owns StdAir service: "
00027          << _ownStdairService;
00028     return oStr.str();
00029   }
00030 
00031   // //////////////////////////////////////////////////////////////////////
00032   const std::string AIRINV_Master_ServiceContext::display() const {
00033     std::ostringstream oStr;
00034     oStr << shortDisplay();
00035     return oStr.str();
00036   }
00037 
00038   // //////////////////////////////////////////////////////////////////////
00039   const std::string AIRINV_Master_ServiceContext::describe() const {
00040     return shortDisplay();
00041   }
00042 
00043   // //////////////////////////////////////////////////////////////////////
00044   void AIRINV_Master_ServiceContext::reset() {
00045     
00046     // The shared_ptr<>::reset() method drops the refcount by one.
00047     // If the count result is dropping to zero, the resource pointed to
00048     // by the shared_ptr<> will be freed.
00049     
00050     // Reset the stdair shared pointer
00051     _stdairService.reset();
00052     
00053     // Reset the sevmgr shared pointer
00054     _sevmgrService.reset();
00055     
00056     // Reset the airinv shared pointer
00057     _airinvService.reset();
00058   }
00059 
00060 }