SimCRS Logo  0.1.1
C++ Simulated Travel-Oriented Distribution System Library
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
SIMCRS_ServiceContext.hpp
Go to the documentation of this file.
1 #ifndef __SIMCRS_SVC_SIMCRSSERVICECONTEXT_HPP
2 #define __SIMCRS_SVC_SIMCRSSERVICECONTEXT_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <string>
9 #include <map>
10 // Boost
11 #include <boost/shared_ptr.hpp>
12 // StdAir
13 #include <stdair/stdair_basic_types.hpp>
14 #include <stdair/stdair_service_types.hpp>
15 // AirInv
16 #include <airinv/AIRINV_Types.hpp>
17 // AirSched
18 #include <airsched/AIRSCHED_Types.hpp>
19 // SimFQT
20 #include <simfqt/SIMFQT_Types.hpp>
21 // SimCRS
22 #include <simcrs/SIMCRS_Types.hpp>
24 
25 namespace SIMCRS {
26 
36  friend class SIMCRS_Service;
38 
39  private:
40  // ///////////////// Getters ///////////////////
46  const CRSCode_T& getCRSCode() const {
47  return _CRSCode;
48  }
49 
53  stdair::STDAIR_ServicePtr_T getSTDAIR_ServicePtr() const {
54  return _stdairService;
55  }
56 
60  stdair::STDAIR_Service& getSTDAIR_Service() const {
61  assert (_stdairService != NULL);
62  return *_stdairService;
63  }
64 
68  const bool getOwnStdairServiceFlag() const {
69  return _ownStdairService;
70  }
71 
75  AIRINV::AIRINV_Master_Service& getAIRINV_Service() const {
76  assert (_airinvService != NULL);
77  return *_airinvService;
78  }
79 
83  AIRSCHED::AIRSCHED_Service& getAIRSCHED_Service() const {
84  assert (_airschedService != NULL);
85  return *_airschedService;
86  }
87 
91  SIMFQT::SIMFQT_Service& getSIMFQT_Service() const {
92  assert (_simfqtService != NULL);
93  return *_simfqtService;
94  }
95 
96 
97  private:
98  // ///////////////// Setters ///////////////////
102  void setCRSCode (const CRSCode_T& iCRSCode) {
103  _CRSCode = iCRSCode;
104  }
105 
109  void setSTDAIR_Service (stdair::STDAIR_ServicePtr_T ioSTDAIR_ServicePtr,
110  const bool iOwnStdairService) {
111  _stdairService = ioSTDAIR_ServicePtr;
112  _ownStdairService = iOwnStdairService;
113  }
114 
118  void setAIRINV_Service (AIRINV::AIRINV_Master_ServicePtr_T ioServicePtr) {
119  _airinvService = ioServicePtr;
120  }
121 
125  void setAIRSCHED_Service (AIRSCHED::AIRSCHED_ServicePtr_T ioServicePtr) {
126  _airschedService = ioServicePtr;
127  }
128 
132  void setSIMFQT_Service (SIMFQT::SIMFQT_ServicePtr_T ioServicePtr) {
133  _simfqtService = ioServicePtr;
134  }
135 
136 
137  private:
138  // //////////////////// Display Methods /////////////////////
142  const std::string shortDisplay() const;
143 
147  const std::string display() const;
148 
152  const std::string describe() const;
153 
154 
155  private:
157 
160  SIMCRS_ServiceContext (const CRSCode_T& iCRSCode);
164  SIMCRS_ServiceContext();
168  SIMCRS_ServiceContext (const SIMCRS_ServiceContext&);
169 
173  ~SIMCRS_ServiceContext();
174 
178  void reset();
179 
180 
181  private:
185  stdair::STDAIR_ServicePtr_T _stdairService;
186 
190  bool _ownStdairService;
191 
195  AIRSCHED::AIRSCHED_ServicePtr_T _airschedService;
196 
200  AIRINV::AIRINV_Master_ServicePtr_T _airinvService;
201 
205  SIMFQT::SIMFQT_ServicePtr_T _simfqtService;
206 
207 
208  private:
209  // /////////////// Attributes //////////////////
215  CRSCode_T _CRSCode;
216  };
217 
218 }
219 #endif // __SIMCRS_SVC_SIMCRSSERVICECONTEXT_HPP