OpenRTM-aist  1.2.1
ExecutionContextProfile.h
[詳解]
1 // -*- C++ -*-
19 #ifndef RTC_EXECUTIONCONTEXTPROFILE_H
20 #define RTC_EXECUTIONCONTEXTPROFILE_H
21 
22 #include <coil/Mutex.h>
23 #include <coil/Guard.h>
24 #include <coil/Properties.h>
25 #include <coil/TimeValue.h>
26 
27 #include <rtm/idl/RTCStub.h>
28 #include <rtm/SystemLogger.h>
29 
30 #ifdef WIN32
31 #pragma warning( disable : 4290 )
32 #endif
33 
34 namespace RTC_impl
35 {
57  {
59  public:
79  ExecutionContextProfile(RTC::ExecutionKind kind = RTC::PERIODIC);
80 
94  virtual ~ExecutionContextProfile(void);
95 
119  void setObjRef(RTC::ExecutionContextService_ptr ec_ptr);
120 
140  RTC::ExecutionContextService_ptr getObjRef(void) const;
141 
175  RTC::ReturnCode_t setRate(double rate);
176  RTC::ReturnCode_t setPeriod(double period);
177  RTC::ReturnCode_t setPeriod(coil::TimeValue period);
178 
199  double getRate(void) const;
200  coil::TimeValue getPeriod(void) const;
201 
224  const char* getKindString(RTC::ExecutionKind kind) const;
225  const char* getKindString() const
226  {
227  return getKindString(m_profile.kind);
228  }
229 
248  RTC::ReturnCode_t setKind(RTC::ExecutionKind kind);
249 
269  RTC::ExecutionKind getKind(void) const;
270 
288  RTC::ReturnCode_t setOwner(RTC::LightweightRTObject_ptr comp);
289 
306  const RTC::RTObject_ptr getOwner() const;
307 
339  RTC::ReturnCode_t addComponent(RTC::LightweightRTObject_ptr comp);
340 
371  RTC::ReturnCode_t removeComponent(RTC::LightweightRTObject_ptr comp);
372 
400  const RTC::RTCList& getComponentList() const;
401 
422  void setProperties(coil::Properties& props);
423 
443  const coil::Properties getProperties() const;
444 
467  RTC::ExecutionContextProfile* getProfile(void);
468 
486  const RTC::ExecutionContextProfile& getProfile(void) const;
487 
503  void lock() const;
504 
520  void unlock() const;
521 
522  private:
530  mutable RTC::Logger rtclog;
538  RTC::ExecutionContextProfile m_profile;
539 
547  mutable coil::Mutex m_profileMutex;
548 
556  coil::TimeValue m_period;
557 
565  RTC::ExecutionContextService_var m_ref;
566 
567  class find_participant
568  {
569  RTC::RTObject_var m_comp;
570  public:
571  find_participant(RTC::RTObject_ptr comp)
572  : m_comp(RTC::RTObject::_duplicate(comp)) {}
573  bool operator()(RTC::RTObject_ptr comp)
574  {
575  return m_comp->_is_equivalent(comp);
576  }
577  };
578  }; // class ExecutionContextProfile
579 }; // namespace RTC
580 
581 #ifdef WIN32
582 #pragma warning( default : 4290 )
583 #endif
584 
585 #endif // RTC_EXECUTIONCONTEXTPROFILE_H
RTC::ExecutionContextService_ptr getObjRef(void) const
CORBA オブジェクト参照の取得
RTC::ExecutionKind getKind(void) const
ExecutionKind を取得する
Mutex クラス
Definition: Mutex.h:40
RT component logger class.
Definition: ExecutionContextProfile.h:34
const RTC::RTObject_ptr getOwner() const
Ownerコンポーネントの参照を取得する
RTC::ReturnCode_t removeComponent(RTC::LightweightRTObject_ptr comp)
RTコンポーネントを参加者リストから削除する
TimeValue クラス
Definition: TimeValue.h:40
const coil::Properties getProperties() const
Propertiesを取得する
double getRate(void) const
ExecutionContext の実行周期(Hz)を取得する
ExecutionContextProfile(RTC::ExecutionKind kind=RTC::PERIODIC)
デフォルトコンストラクタ
Guard template class.
const char * getKindString() const
Definition: ExecutionContextProfile.h:225
RTC::ExecutionContextProfile * getProfile(void)
Profileを取得する
Logger クラス
Definition: SystemLogger.h:99
RTC::ReturnCode_t setOwner(RTC::LightweightRTObject_ptr comp)
Ownerコンポーネントをセットする。
RTC::ReturnCode_t setKind(RTC::ExecutionKind kind)
ExecutionKind を設定する
プロパティセットを表現するクラス
Definition: Properties.h:101
ExecutionContextProfile クラス
Definition: ExecutionContextProfile.h:56
coil::TimeValue getPeriod(void) const
void setProperties(coil::Properties &props)
Propertiesをセットする
void setObjRef(RTC::ExecutionContextService_ptr ec_ptr)
CORBA オブジェクト参照のセット
void lock() const
ExecutionContextProfileをロックする
Property list class (derived from Java Properties)
RTC::LightweightRTObject_ptr LightweightRTObject_ptr
Definition: ExecutionContextWorker.h:43
const RTC::RTCList & getComponentList() const
RTコンポーネントの参加者リストを取得する
virtual ~ExecutionContextProfile(void)
デストラクタ
RTC::ReturnCode_t addComponent(RTC::LightweightRTObject_ptr comp)
RTコンポーネントを追加する
void unlock() const
ExecutionContextProfileをアンロックする
RTC::ReturnCode_t setRate(double rate)
ExecutionContext の実行周期(Hz)を設定する
RTC::ReturnCode_t setPeriod(double period)