SimCRS Logo  1.00.0
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 // SEvMgr
16 #include <sevmgr/SEVMGR_Types.hpp>
17 // AirInv
18 #include <airinv/AIRINV_Types.hpp>
19 // AirSched
20 #include <airsched/AIRSCHED_Types.hpp>
21 // SimFQT
22 #include <simfqt/SIMFQT_Types.hpp>
23 // SimCRS
24 #include <simcrs/SIMCRS_Types.hpp>
26 
27 namespace SIMCRS {
28 
38  friend class SIMCRS_Service;
40 
41  private:
42  // ///////////////// Getters ///////////////////
48  const CRSCode_T& getCRSCode() const {
49  return _CRSCode;
50  }
51 
55  stdair::STDAIR_ServicePtr_T getSTDAIR_ServicePtr() const {
56  return _stdairService;
57  }
58 
62  stdair::STDAIR_Service& getSTDAIR_Service() const {
63  assert (_stdairService != NULL);
64  return *_stdairService;
65  }
66 
70  const bool getOwnStdairServiceFlag() const {
71  return _ownStdairService;
72  }
73 
77  SEVMGR::SEVMGR_ServicePtr_T getSEVMGR_ServicePtr() const {
78  return _sevmgrService;
79  }
80 
84  SEVMGR::SEVMGR_Service& getSEVMGR_Service() const {
85  assert (_sevmgrService != NULL);
86  return *_sevmgrService;
87  }
88 
92  const bool getOwnSEVMGRServiceFlag() const {
93  return _ownSEVMGRService;
94  }
95 
99  AIRINV::AIRINV_Master_Service& getAIRINV_Service() const {
100  assert (_airinvService != NULL);
101  return *_airinvService;
102  }
103 
107  AIRSCHED::AIRSCHED_Service& getAIRSCHED_Service() const {
108  assert (_airschedService != NULL);
109  return *_airschedService;
110  }
111 
115  SIMFQT::SIMFQT_Service& getSIMFQT_Service() const {
116  assert (_simfqtService != NULL);
117  return *_simfqtService;
118  }
119 
120 
121  private:
122  // ///////////////// Setters ///////////////////
126  void setCRSCode (const CRSCode_T& iCRSCode) {
127  _CRSCode = iCRSCode;
128  }
129 
133  void setSTDAIR_Service (stdair::STDAIR_ServicePtr_T ioSTDAIR_ServicePtr,
134  const bool iOwnStdairService) {
135  _stdairService = ioSTDAIR_ServicePtr;
136  _ownStdairService = iOwnStdairService;
137  }
138 
142  void setSEVMGR_Service (SEVMGR::SEVMGR_ServicePtr_T ioSEVMGR_ServicePtr,
143  const bool iOwnSEVMGRService) {
144  _sevmgrService = ioSEVMGR_ServicePtr;
145  _ownSEVMGRService = iOwnSEVMGRService;
146  }
147 
151  void setAIRINV_Service (AIRINV::AIRINV_Master_ServicePtr_T ioServicePtr) {
152  _airinvService = ioServicePtr;
153  }
154 
158  void setAIRSCHED_Service (AIRSCHED::AIRSCHED_ServicePtr_T ioServicePtr) {
159  _airschedService = ioServicePtr;
160  }
161 
165  void setSIMFQT_Service (SIMFQT::SIMFQT_ServicePtr_T ioServicePtr) {
166  _simfqtService = ioServicePtr;
167  }
168 
169 
170  private:
171  // //////////////////// Display Methods /////////////////////
175  const std::string shortDisplay() const;
176 
180  const std::string display() const;
181 
185  const std::string describe() const;
186 
187 
188  private:
190 
193  SIMCRS_ServiceContext (const CRSCode_T& iCRSCode);
197  SIMCRS_ServiceContext();
201  SIMCRS_ServiceContext (const SIMCRS_ServiceContext&);
202 
206  ~SIMCRS_ServiceContext();
207 
211  void reset();
212 
213 
214  private:
218  stdair::STDAIR_ServicePtr_T _stdairService;
219 
223  bool _ownStdairService;
224 
228  SEVMGR::SEVMGR_ServicePtr_T _sevmgrService;
229 
233  bool _ownSEVMGRService;
234 
238  AIRSCHED::AIRSCHED_ServicePtr_T _airschedService;
239 
243  AIRINV::AIRINV_Master_ServicePtr_T _airinvService;
244 
248  SIMFQT::SIMFQT_ServicePtr_T _simfqtService;
249 
250 
251  private:
252  // /////////////// Attributes //////////////////
258  CRSCode_T _CRSCode;
259  };
260 
261 }
262 #endif // __SIMCRS_SVC_SIMCRSSERVICECONTEXT_HPP