AirSched Logo  0.1.4
C++ Simulated Airline Schedule Manager Library
AIRSCHED_ServiceContext.hpp
Go to the documentation of this file.
00001 #ifndef __AIRSCHED_SVC_AIRSCHED_SERVICE_CONTEXT_HPP
00002 #define __AIRSCHED_SVC_AIRSCHED_SERVICE_CONTEXT_HPP
00003 
00004 // //////////////////////////////////////////////////////////////////////
00005 // Import section
00006 // //////////////////////////////////////////////////////////////////////
00007 // STL
00008 #include <string>
00009 // Boost
00010 #include <boost/shared_ptr.hpp>
00011 // StdAir
00012 #include <stdair/stdair_service_types.hpp>
00013 #include <stdair/service/ServiceAbstract.hpp>
00014 // AirSched
00015 #include <airsched/AIRSCHED_Types.hpp>
00016 
00017 namespace AIRSCHED {
00018 
00022   class AIRSCHED_ServiceContext : public stdair::ServiceAbstract {
00028     friend class AIRSCHED_Service;
00029     friend class FacAIRSCHEDServiceContext;
00030 
00031   private:
00032     // ///////////////// Getters ///////////////////
00036     stdair::STDAIR_ServicePtr_T getSTDAIR_ServicePtr() const {
00037       return _stdairService;
00038     }
00039 
00043     stdair::STDAIR_Service& getSTDAIR_Service() const;
00044 
00048     const bool getOwnStdairServiceFlag() const {
00049       return _ownStdairService;
00050     }
00051 
00052 
00053   private:
00054     // ///////////////// Setters ///////////////////
00058     void setSTDAIR_Service (stdair::STDAIR_ServicePtr_T ioSTDAIR_ServicePtr,
00059                             const bool iOwnStdairService) {
00060       _stdairService = ioSTDAIR_ServicePtr;
00061       _ownStdairService = iOwnStdairService;
00062     }
00063 
00064 
00065   private:
00066     // //////////////////// Display Methods /////////////////////
00070     const std::string shortDisplay() const;
00071     
00075     const std::string display() const;
00076     
00080     const std::string describe() const;
00081 
00082 
00083   private:
00085 
00088     AIRSCHED_ServiceContext();
00089 
00093     AIRSCHED_ServiceContext (const AIRSCHED_ServiceContext&);
00094 
00098     void init();
00099 
00103     ~AIRSCHED_ServiceContext();
00104 
00108     void reset();
00109 
00110 
00111   private:
00112     // /////////////// Children ///////////////
00116     stdair::STDAIR_ServicePtr_T _stdairService;
00117 
00121     bool _ownStdairService;
00122   };
00123 
00124 }
00125 #endif // __AIRSCHED_SVC_AIRSCHED_SERVICE_CONTEXT_HPP