OpenRTM-aist  2.1.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 
29 // CORBA header include
30 #include <rtm/idl/RTCSkel.h>
31 
32 #include <string>
33 
34 
35 
36 namespace RTC
37 {
58  {
59 
60  public:
90  virtual ~PortProfileHelper(void);
91 
92 
114  void setPortProfile(const PortProfile& profile);
115 
116 
136  PortProfile* getPortProfile();
137 
138 
159  void setName(const char* name);
160 
161 
181  const char* getName() const;
182 
183 
203  void appendPortInterfaceProfile(PortInterfaceProfile if_prof);
204 
205 
225  const PortInterfaceProfileList& getPortInterfaceProfiles() const;
226 
227 
251  const PortInterfaceProfile
252  getPortInterfaceProfile(const char* instance_name) const;
253 
254 
277  void erasePortInterfaceProfile(const char* instance_name);
278 
279 
300  void setPortRef(PortService_ptr port);
301 
302 
323  PortService_ptr getPortRef() const;
324 
325 
345  void appendConnectorProfile(ConnectorProfile conn_profile);
346 
347 
368  const ConnectorProfileList getConnectorProfiles() const;
369 
370 
392  const ConnectorProfile getConnectorProfile(const char* name) const;
393 
394 
416  const ConnectorProfile getConnectorProfileById(const char* id) const;
417 
418 
439  void eraseConnectorProfile(const char* name);
440 
441 
462  void eraseConnectorProfileById(const char* id);
463 
464 
484  void setOwner(RTObject_ptr owner);
485 
486 
506  RTObject_ptr getOwner() const;
507 
508 
528  void setProperties(NVList& prop);
529 
530 
550  const NVList& getProperties() const;
551 
552 
553 
554  private:
555  // Specialization of SequenceEx template class
556 
557 
558  // PortProfile.name
559  std::string m_name;
560 
561  // PortProfile.interfaces
562  using IfProfiles = SequenceEx<PortInterfaceProfileList,
563  PortInterfaceProfile,
564  std::mutex>;
565  IfProfiles m_ifProfiles;
566 
567  // PortProfile.port_ref
568  PortService_var m_portRef;
569 
570  // PortProfile.connector_profile
571  using ConnProfiles = SequenceEx<ConnectorProfileList,
572  ConnectorProfile,
573  std::mutex>;
574  ConnProfiles m_connProfiles;
575 
576  // PortProfile.owner
577  RTObject_var m_owner;
578 
579  // PortProfile.properties
580  NVList m_properties;
581 
582  mutable std::mutex m_mutex;
583 
584 
585  // Functor to find PortInterfaceProfile by name
586  struct if_name
587  {
588  explicit if_name(const char* name) : m_name(name) {}
589  bool operator()(const PortInterfaceProfile& p)
590  {
591  std::string name(p.instance_name);
592  return m_name == name;
593  }
594  const std::string m_name;
595  };
596 
597  // Functor to find ConnectorProfile by name
598  struct conn_name
599  {
600  explicit conn_name(const char* name) : m_name(name) {}
601  bool operator()(const ConnectorProfile& c)
602  {
603  std::string name(c.name);
604  return m_name == name;
605  }
606  const std::string m_name;
607  };
608 
609  // Functor to find ConnectorProfile by id
610  struct conn_id
611  {
612  explicit conn_id(const char* id) : m_id(id) {}
613  bool operator()(const ConnectorProfile& c)
614  {
615  std::string id(c.connector_id);
616  return m_id == id;
617  }
618  const std::string m_id;
619  };
620 
621  }; // class PortProfileHelper
622 } // namespace RTC
623 #endif // RTC_PORTPROFILEHELPER_H
RTComponent header
PortProfile ヘルパークラス
Definition: PortProfileHelper.h:58
void eraseConnectorProfile(const char *name)
ConnectorProfile を削除する
const ConnectorProfileList getConnectorProfiles() const
ConnectorProfileList を取得する
void erasePortInterfaceProfile(const char *instance_name)
PortInterfaceProfile を削除する
void appendPortInterfaceProfile(PortInterfaceProfile if_prof)
PortInterfaceProfile を追加する
const PortInterfaceProfileList & getPortInterfaceProfiles() const
PortInterfaceProfileList を取得する
RTObject_ptr getOwner() const
PortProfile の owner を取得する
const char * getName() const
PortProfile.name を取得する
void eraseConnectorProfileById(const char *id)
ConnectorProfile を削除する
const NVList & getProperties() const
PortProfile の properties を取得する
void setPortRef(PortService_ptr port)
Port のオブジェクト参照をセットする
const ConnectorProfile getConnectorProfileById(const char *id) const
ConnectorProfile を取得する
PortProfileHelper()
コンストラクタ
PortProfile * getPortProfile()
PortProfile を取得する
virtual ~PortProfileHelper(void)
デストラクタ
const ConnectorProfile getConnectorProfile(const char *name) const
ConnectorProfile を取得する
void setOwner(RTObject_ptr owner)
PortProfile の owner を設定する
void setName(const char *name)
PortProfile.name を設定する
void setPortProfile(const PortProfile &profile)
PortProfile を設定する
void setProperties(NVList &prop)
PortProfile の properties を設定する
const PortInterfaceProfile getPortInterfaceProfile(const char *instance_name) const
PortInterfaceProfile を取得する
PortService_ptr getPortRef() const
Port のオブジェクト参照を取得する
void appendConnectorProfile(ConnectorProfile conn_profile)
ConnectorProfile を追加する
RTコンポーネント