TvlSim Logo  1.00.0
C++ Simulated Travel-Oriented Distribution System Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TVLSIM_ServiceContext.hpp
Go to the documentation of this file.
1 #ifndef __TVLSIM_SVC_TVLSIMSERVICECONTEXT_HPP
2 #define __TVLSIM_SVC_TVLSIMSERVICECONTEXT_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <string>
9 // StdAir
10 #include <stdair/stdair_service_types.hpp>
11 #include <stdair/service/ServiceAbstract.hpp>
12 // SEvMgr
13 #include <sevmgr/SEVMGR_Types.hpp>
14 // SimCRS
15 #include <simcrs/SIMCRS_Types.hpp>
16 // TraDemGen
17 #include <trademgen/TRADEMGEN_Types.hpp>
18 // TravelCCM
19 #include <travelccm/TRAVELCCM_Types.hpp>
20 // TvlSim
21 #include <tvlsim/TVLSIM_Types.hpp>
24 
25 namespace TVLSIM {
26 
30  class TVLSIM_ServiceContext : public stdair::ServiceAbstract {
36  friend class TVLSIM_Service;
37  friend class FacDsimServiceContext;
38 
39  private:
40  // ///////////// Getters on attributes //////////////
44  const SimulatorID_T& getSimulatorID() const {
45  return _simulatorID;
46  }
47 
51  SimulationStatus& getSimulationStatus() const {
52  assert (_simulationStatus != NULL);
53  return *_simulationStatus;
54  }
55 
56  // /////////////// Getters on children //////////////
60  stdair::STDAIR_ServicePtr_T getSTDAIR_ServicePtr() const {
61  return _stdairService;
62  }
63 
67  stdair::STDAIR_Service& getSTDAIR_Service() const {
68  assert (_stdairService != NULL);
69  return *_stdairService;
70  }
71 
75  SEVMGR::SEVMGR_ServicePtr_T getSEVMGR_ServicePtr() const {
76  return _sevmgrService;
77  }
78 
82  SEVMGR::SEVMGR_Service& getSEVMGR_Service() const {
83  assert (_sevmgrService != NULL);
84  return *_sevmgrService;
85  }
89  const bool getOwnStdairServiceFlag() const {
90  return _ownStdairService;
91  }
92 
96  const RDSParameters& getRDSParameters() const {
97  return _rdsParameters;
98  }
99 
103  SIMCRS::SIMCRS_Service& getSIMCRS_Service() const {
104  return *_simcrsService.get();
105  }
106 
110  TRADEMGEN::TRADEMGEN_Service& getTRADEMGEN_Service() const {
111  return *_trademgenService.get();
112  }
113 
117  TRAVELCCM::TRAVELCCM_Service& getTRAVELCCM_Service() const {
118  return *_travelccmService.get();
119  }
120 
121 
122  private:
123  // //////// Setters on attributes /////////
125  void setSimulatorID (const SimulatorID_T& iSimulatorID) {
126  _simulatorID = iSimulatorID;
127  }
128 
129  // ///////// Setters on children //////////
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  _sevmgrService = ioSEVMGR_ServicePtr;
144  }
145 
149  void setRDSParameters (const RDSParameters& iRDSParameters) {
150  _rdsParameters = iRDSParameters;
151  }
152 
156  void setSIMCRS_Service (SIMCRS::SIMCRS_ServicePtr_T ioServicePtr) {
157  _simcrsService = ioServicePtr;
158  }
159 
163  void setTRADEMGEN_Service (TRADEMGEN::TRADEMGEN_ServicePtr_T ioServicePtr) {
164  _trademgenService = ioServicePtr;
165  }
166 
170  void setTRAVELCCM_Service (TRAVELCCM::TRAVELCCM_ServicePtr_T ioServicePtr) {
171  _travelccmService = ioServicePtr;
172  }
173 
174 
175  private:
176  // //////////////////// Display Methods /////////////////////
180  const std::string shortDisplay() const;
181 
185  const std::string display() const;
186 
190  const std::string describe() const;
191 
192 
193  private:
195 
198  TVLSIM_ServiceContext ();
199 
203  TVLSIM_ServiceContext (const SimulatorID_T&);
204 
208  TVLSIM_ServiceContext (const TVLSIM_ServiceContext&);
209 
213  ~TVLSIM_ServiceContext();
214 
218  void reset();
219 
226  void initSimulationStatus (const SimulatorID_T&);
227 
228 
229  private:
230  // //////////////////// Children ///////////////////////
234  stdair::STDAIR_ServicePtr_T _stdairService;
235 
239  bool _ownStdairService;
240 
244  SEVMGR::SEVMGR_ServicePtr_T _sevmgrService;
245 
249  SIMCRS::SIMCRS_ServicePtr_T _simcrsService;
250 
254  TRADEMGEN::TRADEMGEN_ServicePtr_T _trademgenService;
255 
259  TRAVELCCM::TRAVELCCM_ServicePtr_T _travelccmService;
260 
261 
262  private:
263  // /////////////////// Attributes ////////////////////////
269  SimulatorID_T _simulatorID;
270 
274  SimulationStatus* _simulationStatus;
275 
279  RDSParameters _rdsParameters;
280  };
281 
282 }
283 #endif // __TVLSIM_SVC_TVLSIMSERVICECONTEXT_HPP