TravelCCM Logo  0.5.0
C++ Travel Customer Choice Model Library
TRAVELCCM_ServiceContext.cpp
Go to the documentation of this file.
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     if (_ownStdairService == true) {
00050       _stdairService.reset();
00051     }
00052   }
00053 
00054 }