00001 // -*- C++ -*- 00019 #ifndef RTC_CORBA_EXECUTIONCONTEXTADAPTER_H 00020 #define RTC_CORBA_EXECUTIONCONTEXTADAPTER_H 00021 00022 #include <doil/ImplBase.h> 00023 #include <rtc/IExecutionContext.h> 00024 #include <rtc/ILightweightRTObject.h> 00025 #include <rtc/corba/idl/RTCSkel.h> 00026 00027 namespace RTC 00028 { 00029 namespace CORBA 00030 { 00031 typedef RTC::Local::ReturnCode_t ReturnCode_t; 00032 typedef RTC::Local::ExecutionKind ExecutionKind; 00033 typedef RTC::Local::LifeCycleState LifeCycleState; 00034 typedef RTC::Local::ExecutionContextProfile ExecutionContextProfile; 00035 typedef RTC::Local::ILightweightRTObject ILightweightRTObject; 00036 class ExecutionContextAdapter 00037 : public doil::ImplBase, 00038 public RTC::Local::IExecutionContext 00039 { 00040 public: 00041 ExecutionContextAdapter(RTC::ExecutionContext_ptr obj); 00042 00043 virtual ~ExecutionContextAdapter(); 00044 00045 virtual bool is_running() const; 00046 00047 virtual ReturnCode_t start(); 00048 00049 virtual ReturnCode_t stop(); 00050 00051 virtual double get_rate() const; 00052 00053 virtual ReturnCode_t set_rate(double rate); 00054 00055 virtual ReturnCode_t 00056 add_component(RTC::Local::ILightweightRTObject& comp); 00057 00058 virtual ReturnCode_t 00059 remove_component(RTC::Local::ILightweightRTObject& comp); 00060 00061 virtual ReturnCode_t 00062 activate_component(RTC::Local::ILightweightRTObject& comp); 00063 00064 virtual ReturnCode_t 00065 deactivate_component(RTC::Local::ILightweightRTObject& comp); 00066 00067 virtual ReturnCode_t 00068 reset_component(RTC::Local::ILightweightRTObject& comp); 00069 00070 virtual LifeCycleState 00071 get_component_state(RTC::Local::ILightweightRTObject& comp); 00072 00073 virtual ExecutionKind 00074 get_kind() const; 00075 00076 virtual const ExecutionContextProfile& 00077 get_profile() const; 00078 private: 00079 RTC::ExecutionContext_ptr m_obj; 00080 ExecutionContextProfile m_profile; 00081 }; 00082 00083 }; // namespace CORBA 00084 }; // namespace RTC 00085 #endif // RTC_CORBA_EXECUTIONCONTEXTADAPTER_H