00001 // -*- C++ -*- 00019 #ifndef RTC_OPENHRPEXECUTIONCONTEXT_H 00020 #define RTC_OPENHRPEXECUTIONCONTEXT_H 00021 00022 #include <coil/Mutex.h> 00023 #include <coil/Guard.h> 00024 #include <rtm/RTC.h> 00025 #include <rtm/ExecutionContextBase.h> 00026 00027 #ifdef WIN32 00028 #pragma warning( disable : 4290 ) 00029 #endif 00030 00031 namespace RTC 00032 { 00051 class OpenHRPExecutionContext 00052 : public virtual POA_OpenRTM::ExtTrigExecutionContextService, 00053 public virtual PortableServer::RefCountServantBase, 00054 public RTC::ExecutionContextBase 00055 { 00056 typedef coil::Mutex Mutex; 00057 typedef coil::Guard<coil::Mutex> Guard; 00058 public: 00066 OpenHRPExecutionContext(); 00067 00075 virtual ~OpenHRPExecutionContext(void); 00076 00077 00078 //============================================================ 00079 // ExtTrigExecutionContextService 00080 //============================================================ 00094 virtual void tick() 00095 throw (CORBA::SystemException); 00096 00097 //============================================================ 00098 // ExecutionContextService 00099 //============================================================ 00124 virtual CORBA::Boolean is_running(void) 00125 throw (CORBA::SystemException); 00126 00154 virtual RTC::ReturnCode_t start(void) 00155 throw (CORBA::SystemException); 00156 00183 virtual RTC::ReturnCode_t stop(void) 00184 throw (CORBA::SystemException); 00185 00206 virtual CORBA::Double get_rate(void) 00207 throw (CORBA::SystemException); 00208 00238 virtual RTC::ReturnCode_t set_rate(CORBA::Double rate) 00239 throw (CORBA::SystemException); 00240 00274 virtual RTC::ReturnCode_t 00275 activate_component(RTC::LightweightRTObject_ptr comp) 00276 throw (CORBA::SystemException); 00277 00310 virtual RTC::ReturnCode_t 00311 deactivate_component(RTC::LightweightRTObject_ptr comp) 00312 throw (CORBA::SystemException); 00313 00345 virtual RTC::ReturnCode_t 00346 reset_component(RTC::LightweightRTObject_ptr comp) 00347 throw (CORBA::SystemException); 00348 00375 virtual RTC::LifeCycleState 00376 get_component_state(RTC::LightweightRTObject_ptr comp) 00377 throw (CORBA::SystemException); 00378 00398 virtual RTC::ExecutionKind get_kind(void) 00399 throw (CORBA::SystemException); 00400 00432 virtual RTC::ReturnCode_t add_component(RTC::LightweightRTObject_ptr comp) 00433 throw (CORBA::SystemException); 00434 00465 virtual RTC::ReturnCode_t 00466 remove_component(RTC::LightweightRTObject_ptr comp) 00467 throw (CORBA::SystemException); 00468 00488 virtual RTC::ExecutionContextProfile* get_profile(void) 00489 throw (CORBA::SystemException); 00490 00491 private: 00499 RTC::Logger rtclog; 00500 00504 unsigned int m_count; 00508 coil::Mutex m_tickmutex; 00509 }; // class OpenHRPExecutionContext 00510 }; // namespace RTC 00511 00512 #ifdef WIN32 00513 #pragma warning( default : 4290 ) 00514 #endif 00515 00516 00517 extern "C" 00518 { 00526 DLL_EXPORT void OpenHRPExecutionContextInit(RTC::Manager* manager); 00527 }; 00528 00529 #endif // RTC_OPENHRPEXECUTIONCONTEXT_H 00530