SimCRS Logo  0.1.1
C++ Simulated Travel-Oriented Distribution System Library
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
SIMCRS_ServiceContext.cpp
Go to the documentation of this file.
1 // //////////////////////////////////////////////////////////////////////
2 // Import section
3 // //////////////////////////////////////////////////////////////////////
4 // STL
5 #include <cassert>
6 // Standard Airline Object Model
7 #include <stdair/STDAIR_Service.hpp>
8 #include <stdair/service/Logger.hpp>
9 // Simcrs
12 
13 namespace SIMCRS {
14 
15  // //////////////////////////////////////////////////////////////////////
16  SIMCRS_ServiceContext::SIMCRS_ServiceContext ()
17  : _ownStdairService (false), _CRSCode (DEFAULT_CRS_CODE) {
18  }
19 
20  // //////////////////////////////////////////////////////////////////////
21  SIMCRS_ServiceContext::SIMCRS_ServiceContext (const SIMCRS_ServiceContext&)
22  : _ownStdairService (false) {
23  }
24 
25  // //////////////////////////////////////////////////////////////////////
26  SIMCRS_ServiceContext::SIMCRS_ServiceContext (const CRSCode_T& iCRSCode)
27  : _CRSCode (iCRSCode) {
28  }
29 
30  // //////////////////////////////////////////////////////////////////////
31  SIMCRS_ServiceContext::~SIMCRS_ServiceContext() {
32  }
33 
34  // //////////////////////////////////////////////////////////////////////
35  const std::string SIMCRS_ServiceContext::shortDisplay() const {
36  std::ostringstream oStr;
37  oStr << "SIMCRS_ServiceContext [" << _CRSCode
38  << "] - Owns StdAir service: " << _ownStdairService;
39  return oStr.str();
40  }
41 
42  // //////////////////////////////////////////////////////////////////////
43  const std::string SIMCRS_ServiceContext::display() const {
44  std::ostringstream oStr;
45  oStr << shortDisplay();
46  return oStr.str();
47  }
48 
49  // //////////////////////////////////////////////////////////////////////
50  const std::string SIMCRS_ServiceContext::describe() const {
51  return shortDisplay();
52  }
53 
54  // //////////////////////////////////////////////////////////////////////
55  void SIMCRS_ServiceContext::reset() {
56  if (_ownStdairService == true) {
57  _stdairService.reset();
58  }
59  }
60 
61 }