AirInv Logo  1.00.7
C++ Simulated Airline Inventory Management System Library
AIRINV_ServiceContext.hpp
Go to the documentation of this file.
1#ifndef __AIRINV_SVC_AIRINVSERVICECONTEXT_HPP
2#define __AIRINV_SVC_AIRINVSERVICECONTEXT_HPP
3
4// //////////////////////////////////////////////////////////////////////
5// Import section
6// //////////////////////////////////////////////////////////////////////
7// STL
8#include <string>
9// Boost
10#include <boost/shared_ptr.hpp>
11// StdAir
12#include <stdair/stdair_service_types.hpp>
13#include <stdair/service/ServiceAbstract.hpp>
14// RMOL
15#include <rmol/RMOL_Types.hpp>
16// AIRRAC
17#include <airrac/AIRRAC_Types.hpp>
18// SEvMgr
19#include <sevmgr/SEVMGR_Types.hpp>
20// AirInv
22
23namespace AIRINV {
24
28 class AIRINV_ServiceContext : public stdair::ServiceAbstract {
34 friend class AIRINV_Service;
36
37 private:
38 // ///////////////// Getters ///////////////////
42 stdair::AirlineCode_T getAirlineCode() const {
43 return _airlineCode;
44 }
45
49 stdair::STDAIR_ServicePtr_T getSTDAIR_ServicePtr() const {
50 return _stdairService;
51 }
52
56 stdair::STDAIR_Service& getSTDAIR_Service() const {
57 assert (_stdairService != NULL);
58 return *_stdairService;
59 }
60
64 const bool getOwnStdairServiceFlag() const {
65 return _ownStdairService;
66 }
67
71 RMOL::RMOL_Service& getRMOL_Service() const {
72 assert (_rmolService != NULL);
73 return *_rmolService;
74 }
75
79 AIRRAC::AIRRAC_Service& getAIRRAC_Service() const {
80 assert (_airracService != NULL);
81 return *_airracService;
82 }
83
87 SEVMGR::SEVMGR_ServicePtr_T getSEVMGR_ServicePtr() const {
88 return _sevmgrService;
89 }
90
94 SEVMGR::SEVMGR_Service& getSEVMGR_Service() const {
95 assert (_sevmgrService != NULL);
96 return *_sevmgrService;
97 }
98
102 const bool getOwnSEVMGRServiceFlag() const {
103 return _ownSEVMGRService;
104 }
105
106
107 private:
108 // ///////////////// Setters ///////////////////
112 void setAirlineCode (const stdair::AirlineCode_T& iAirlineCode) {
113 _airlineCode = iAirlineCode;
114 }
115
119 void setSTDAIR_Service (stdair::STDAIR_ServicePtr_T ioSTDAIR_ServicePtr,
120 const bool iOwnStdairService) {
121 _stdairService = ioSTDAIR_ServicePtr;
122 _ownStdairService = iOwnStdairService;
123 }
124
128 void setRMOL_Service (RMOL::RMOL_ServicePtr_T ioRMOL_ServicePtr) {
129 _rmolService = ioRMOL_ServicePtr;
130 }
131
135 void setAIRRAC_Service (AIRRAC::AIRRAC_ServicePtr_T ioAIRRAC_ServicePtr) {
136 _airracService = ioAIRRAC_ServicePtr;
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
148 private:
149 // //////////////////// Display Methods /////////////////////
153 const std::string shortDisplay() const;
154
158 const std::string display() const;
159
163 const std::string describe() const;
164
165
166 private:
168
171 AIRINV_ServiceContext (const stdair::AirlineCode_T&);
175 AIRINV_ServiceContext();
179 AIRINV_ServiceContext (const AIRINV_ServiceContext&);
180
184 ~AIRINV_ServiceContext();
185
189 void reset();
190
191
192 private:
193 // /////////////// Children ///////////////
197 stdair::STDAIR_ServicePtr_T _stdairService;
198
202 bool _ownStdairService;
203
207 RMOL::RMOL_ServicePtr_T _rmolService;
208
212 SEVMGR::SEVMGR_ServicePtr_T _sevmgrService;
213
217 bool _ownSEVMGRService;
218
222 AIRRAC::AIRRAC_ServicePtr_T _airracService;
223
224 private:
225 // //////////// Attributes ////////////
230 stdair::AirlineCode_T _airlineCode;
231 };
232
233}
234#endif // __AIRINV_SVC_AIRINVSERVICECONTEXT_HPP
Class holding the context of the AirInv services.
Interface for the AIRINV Services.