AirRAC Logo  0.2.3
C++ Simulated Revenue Accounting (RAC) System Library
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines
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     if (_ownStdairService == true) {
00049       _stdairService.reset();
00050     }
00051   }
00052 
00053 }