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