OpenRTM  1.0.0
PortProfileHelper.h
[詳解]
1 // -*- C++ -*-
19 #ifndef RTC_PORTPROFILEHELPER_H
20 #define RTC_PORTPROFILEHELPER_H
21 
22 
23 // RTC header include
24 #include <rtm/RTC.h>
25 #include <rtm/Util.h>
26 
27 // ACE includes
28 #include <coil/Mutex.h>
29 
30 // CORBA header include
31 #include <rtm/idl/RTCSkel.h>
32 
33 
34 
35 
36 namespace RTC
37 {
58  {
59  typedef coil::Mutex Mutex;
60 
61  public:
91  virtual ~PortProfileHelper(void);
92 
93 
115  void setPortProfile(const PortProfile& profile);
116 
117 
137  PortProfile* getPortProfile();
138 
139 
160  void setName(const char* name);
161 
162 
182  const char* getName() const;
183 
184 
204  void appendPortInterfaceProfile(PortInterfaceProfile if_prof);
205 
206 
226  const PortInterfaceProfileList& getPortInterfaceProfiles() const;
227 
228 
252  const PortInterfaceProfile
253  getPortInterfaceProfile(const char* instance_name) const;
254 
255 
278  void erasePortInterfaceProfile(const char* instance_name);
279 
280 
301  void setPortRef(PortService_ptr port);
302 
303 
324  PortService_ptr getPortRef() const;
325 
326 
346  void appendConnectorProfile(ConnectorProfile conn_profile);
347 
348 
369  const ConnectorProfileList getConnectorProfiles() const;
370 
371 
393  const ConnectorProfile getConnectorProfile(const char* name) const;
394 
395 
417  const ConnectorProfile getConnectorProfileById(const char* id) const;
418 
419 
440  void eraseConnectorProfile(const char* name);
441 
442 
463  void eraseConnectorProfileById(const char* id);
464 
465 
485  void setOwner(RTObject_ptr owner);
486 
487 
507  RTObject_ptr getOwner() const;
508 
509 
529  void setProperties(NVList& prop);
530 
531 
551  const NVList& getProperties() const;
552 
553 
554 
555  private:
556  // Specialization of SequenceEx template class
557 
558 
559  // PortProfile.name
560  std::string m_name;
561 
562  // PortProfile.interfaces
563  typedef SequenceEx<PortInterfaceProfileList,
564  PortInterfaceProfile,
565  Mutex> IfProfiles;
566  IfProfiles m_ifProfiles;
567 
568  // PortProfile.port_ref
569  PortService_var m_portRef;
570 
571  // PortProfile.connector_profile
572  typedef SequenceEx<ConnectorProfileList,
573  ConnectorProfile,
574  Mutex> ConnProfiles;
575  ConnProfiles m_connProfiles ;
576 
577  // PortProfile.owner
578  RTObject_var m_owner;
579 
580  // PortProfile.properties
581  NVList m_properties;
582 
583  // Mutex
584  mutable Mutex m_mutex;
585 
586 
587  // Functor to find PortInterfaceProfile by name
588  struct if_name
589  {
590  if_name(const char* name) : m_name(name) {};
591  bool operator()(const PortInterfaceProfile& p)
592  {
593  std::string name(p.instance_name);
594  return m_name == name;
595  }
596  const std::string m_name;
597  };
598 
599  // Functor to find ConnectorProfile by name
600  struct conn_name
601  {
602  conn_name(const char* name) : m_name(name) {};
603  bool operator()(const ConnectorProfile& c)
604  {
605  std::string name(c.name);
606  return m_name == name;
607  }
608  const std::string m_name;
609  };
610 
611  // Functor to find ConnectorProfile by id
612  struct conn_id
613  {
614  conn_id(const char* id) : m_id(id) {};
615  bool operator()(const ConnectorProfile& c)
616  {
617  std::string id(c.connector_id);
618  return m_id == id;
619  }
620  const std::string m_id;
621  };
622 
623  }; // class PortProfileHelper
624 }; // namespace RTC
625 #endif // RTC_PORTPROFILEHELPER_H
const char * getName() const
PortProfile.name を取得する
void setProperties(NVList &prop)
PortProfile の properties を設定する
RTObject_ptr getOwner() const
PortProfile の owner を取得する
PortProfileHelper()
コンストラクタ
const PortInterfaceProfile getPortInterfaceProfile(const char *instance_name) const
PortInterfaceProfile を取得する
Mutex クラス
Definition: Mutex.h:40
void appendPortInterfaceProfile(PortInterfaceProfile if_prof)
PortInterfaceProfile を追加する
virtual ~PortProfileHelper(void)
デストラクタ
void appendConnectorProfile(ConnectorProfile conn_profile)
ConnectorProfile を追加する
const ConnectorProfileList getConnectorProfiles() const
ConnectorProfileList を取得する
void setPortRef(PortService_ptr port)
Port のオブジェクト参照をセットする
void setName(const char *name)
PortProfile.name を設定する
void erasePortInterfaceProfile(const char *instance_name)
PortInterfaceProfile を削除する
const NVList & getProperties() const
PortProfile の properties を取得する
void setPortProfile(const PortProfile &profile)
PortProfile を設定する
PortProfile ヘルパークラス
Definition: PortProfileHelper.h:57
RTComponent header.
void eraseConnectorProfileById(const char *id)
ConnectorProfile を削除する
const ConnectorProfile getConnectorProfileById(const char *id) const
ConnectorProfile を取得する
void setOwner(RTObject_ptr owner)
PortProfile の owner を設定する
PortService_ptr getPortRef() const
Port のオブジェクト参照を取得する
PortProfile * getPortProfile()
PortProfile を取得する
void eraseConnectorProfile(const char *name)
ConnectorProfile を削除する
const ConnectorProfile getConnectorProfile(const char *name) const
ConnectorProfile を取得する
const PortInterfaceProfileList & getPortInterfaceProfiles() const
PortInterfaceProfileList を取得する