SimFQT Logo  0.1.2
C++ Simulated Fare Quote System Library
SIMFQT_ServiceContext.cpp
Go to the documentation of this file.
00001 // //////////////////////////////////////////////////////////////////////
00002 // Import section
00003 // //////////////////////////////////////////////////////////////////////
00004 // STL
00005 #include <cassert>
00006 #include <sstream>
00007 // SimFQT
00008 #include <simfqt/basic/BasConst_SIMFQT_Service.hpp>
00009 #include <simfqt/service/SIMFQT_ServiceContext.hpp>
00010 
00011 namespace SIMFQT {
00012   
00013   // //////////////////////////////////////////////////////////////////////
00014   SIMFQT_ServiceContext::SIMFQT_ServiceContext() : _ownStdairService (false) {
00015   }
00016 
00017   // //////////////////////////////////////////////////////////////////////
00018   SIMFQT_ServiceContext::SIMFQT_ServiceContext (const SIMFQT_ServiceContext&) {
00019     assert (false);
00020   }
00021 
00022   // //////////////////////////////////////////////////////////////////////
00023   SIMFQT_ServiceContext::~SIMFQT_ServiceContext() {
00024   }
00025   
00026   // ////////////////////////////////////////////////////////////////////
00027   stdair::STDAIR_Service& SIMFQT_ServiceContext::getSTDAIR_Service() const {
00028     assert (_stdairService != NULL);
00029     return *_stdairService;
00030   }
00031 
00032   // //////////////////////////////////////////////////////////////////////
00033   const std::string SIMFQT_ServiceContext::shortDisplay() const {
00034     std::ostringstream oStr;
00035     oStr << "SIMFQT_ServiceContext -- Owns StdAir service: "
00036          << _ownStdairService;
00037     return oStr.str();
00038   }
00039 
00040   // //////////////////////////////////////////////////////////////////////
00041   const std::string SIMFQT_ServiceContext::display() const {
00042     std::ostringstream oStr;
00043     oStr << shortDisplay();
00044     return oStr.str();
00045   }
00046 
00047   // //////////////////////////////////////////////////////////////////////
00048   const std::string SIMFQT_ServiceContext::describe() const {
00049     return shortDisplay();
00050   }
00051 
00052   // //////////////////////////////////////////////////////////////////////
00053   void SIMFQT_ServiceContext::reset() {
00054     if (_ownStdairService == true) {
00055       _stdairService.reset();
00056     }
00057   }
00058 
00059 }