AirSched Logo  1.00.0
C++ Simulated Airline Schedule Manager Library
AIRSCHED_ServiceContext.hpp
Go to the documentation of this file.
1 #ifndef __AIRSCHED_SVC_AIRSCHED_SERVICE_CONTEXT_HPP
2 #define __AIRSCHED_SVC_AIRSCHED_SERVICE_CONTEXT_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 // AirSched
16 
17 namespace AIRSCHED {
18 
22  class AIRSCHED_ServiceContext : public stdair::ServiceAbstract {
28  friend class AIRSCHED_Service;
30 
31  private:
32  // ///////////////// Getters ///////////////////
36  stdair::STDAIR_ServicePtr_T getSTDAIR_ServicePtr() const {
37  return _stdairService;
38  }
39 
43  stdair::STDAIR_Service& getSTDAIR_Service() const;
44 
48  const bool getOwnStdairServiceFlag() const {
49  return _ownStdairService;
50  }
51 
52 
53  private:
54  // ///////////////// Setters ///////////////////
58  void setSTDAIR_Service (stdair::STDAIR_ServicePtr_T ioSTDAIR_ServicePtr,
59  const bool iOwnStdairService) {
60  _stdairService = ioSTDAIR_ServicePtr;
61  _ownStdairService = iOwnStdairService;
62  }
63 
64 
65  private:
66  // //////////////////// Display Methods /////////////////////
70  const std::string shortDisplay() const;
71 
75  const std::string display() const;
76 
80  const std::string describe() const;
81 
82 
83  private:
85 
88  AIRSCHED_ServiceContext();
89 
93  AIRSCHED_ServiceContext (const AIRSCHED_ServiceContext&);
94 
98  void init();
99 
103  ~AIRSCHED_ServiceContext();
104 
108  void reset();
109 
110 
111  private:
112  // /////////////// Children ///////////////
116  stdair::STDAIR_ServicePtr_T _stdairService;
117 
121  bool _ownStdairService;
122  };
123 
124 }
125 #endif // __AIRSCHED_SVC_AIRSCHED_SERVICE_CONTEXT_HPP
Factory for the service context.
Class holding the context of the AirSched services.
Interface for the AirSched Services.