$treeview $search $mathjax
AirRAC Logo  1.00.1
$projectbrief
$projectbrief
$searchbox

AIRRAC_ServiceContext.cpp

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