AirInv Logo  0.1.2
C++ Simulated Airline Inventory Management System library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 // AirInv
19 #include <airinv/AIRINV_Types.hpp>
20 
21 namespace AIRINV {
22 
26  class AIRINV_ServiceContext : public stdair::ServiceAbstract {
32  friend class AIRINV_Service;
34 
35  private:
36  // ///////////////// Getters ///////////////////
40  stdair::AirlineCode_T getAirlineCode() const {
41  return _airlineCode;
42  }
43 
47  stdair::STDAIR_ServicePtr_T getSTDAIR_ServicePtr() const {
48  return _stdairService;
49  }
50 
54  stdair::STDAIR_Service& getSTDAIR_Service() const {
55  assert (_stdairService != NULL);
56  return *_stdairService;
57  }
58 
62  const bool getOwnStdairServiceFlag() const {
63  return _ownStdairService;
64  }
65 
69  RMOL::RMOL_Service& getRMOL_Service() const {
70  assert (_rmolService != NULL);
71  return *_rmolService;
72  }
73 
77  AIRRAC::AIRRAC_Service& getAIRRAC_Service() const {
78  assert (_airracService != NULL);
79  return *_airracService;
80  }
81 
82 
83  private:
84  // ///////////////// Setters ///////////////////
88  void setAirlineCode (const stdair::AirlineCode_T& iAirlineCode) {
89  _airlineCode = iAirlineCode;
90  }
91 
95  void setSTDAIR_Service (stdair::STDAIR_ServicePtr_T ioSTDAIR_ServicePtr,
96  const bool iOwnStdairService) {
97  _stdairService = ioSTDAIR_ServicePtr;
98  _ownStdairService = iOwnStdairService;
99  }
100 
104  void setRMOL_Service (RMOL::RMOL_ServicePtr_T ioRMOL_ServicePtr) {
105  _rmolService = ioRMOL_ServicePtr;
106  }
107 
111  void setAIRRAC_Service (AIRRAC::AIRRAC_ServicePtr_T ioAIRRAC_ServicePtr) {
112  _airracService = ioAIRRAC_ServicePtr;
113  }
114 
115 
116  private:
117  // //////////////////// Display Methods /////////////////////
121  const std::string shortDisplay() const;
122 
126  const std::string display() const;
127 
131  const std::string describe() const;
132 
133 
134  private:
136 
139  AIRINV_ServiceContext (const stdair::AirlineCode_T&);
143  AIRINV_ServiceContext();
147  AIRINV_ServiceContext (const AIRINV_ServiceContext&);
148 
152  ~AIRINV_ServiceContext();
153 
157  void reset();
158 
159 
160  private:
161  // /////////////// Children ///////////////
165  stdair::STDAIR_ServicePtr_T _stdairService;
166 
170  bool _ownStdairService;
171 
175  RMOL::RMOL_ServicePtr_T _rmolService;
176 
180  AIRRAC::AIRRAC_ServicePtr_T _airracService;
181 
182  private:
183  // //////////// Attributes ////////////
188  stdair::AirlineCode_T _airlineCode;
189  };
190 
191 }
192 #endif // __AIRINV_SVC_AIRINVSERVICECONTEXT_HPP