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