PortProfileHelper.h
Go to the documentation of this file.
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 
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 
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
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
void setProperties(NVList &prop)
Set properties to the PortProfile.
const NVList & getProperties() const
Get properties of the PortProfile.
RTObject_ptr getOwner() const
Get owner&#39;s object reference from the PortProfile.
PortProfile * getPortProfile()
Get PortProfile.
RT-Component.
PortProfileHelper()
Constructor.
const PortInterfaceProfile getPortInterfaceProfile(const char *instance_name) const
Get PortInterfaceProfile.
Mutex class.
std::vector< std::pair< std::string, std::string > > NVList
Definition: IRTC.h:67
void appendPortInterfaceProfile(PortInterfaceProfile if_prof)
Append PortInterfaceProfile to the PortProfile.
void appendConnectorProfile(ConnectorProfile conn_profile)
Append ConnectorProfile.
const ConnectorProfileList getConnectorProfiles() const
Get ConnectorProfileList.
void setPortRef(PortService_ptr port)
Set Port&#39;s object reference.
virtual ~PortProfileHelper(void)
Destructor.
void setName(const char *name)
Set PortProfile.name.
bool operator()(const ConnectorProfile &c)
std::vector< PortInterfaceProfile * > PortInterfaceProfileList
Definition: IPortService.h:38
std::vector< ConnectorProfile * > ConnectorProfileList
Definition: IPortService.h:50
void erasePortInterfaceProfile(const char *instance_name)
Erase PortInterfaceProfile from the PortProfile.
const char * getName() const
Get PortProfile.name.
const PortInterfaceProfileList & getPortInterfaceProfiles() const
Get PortInterfaceProfileList.
SequenceEx< ConnectorProfileList, ConnectorProfile, Mutex > ConnProfiles
void setPortProfile(const PortProfile &profile)
Set PortProfile.
prop
Organization::get_organization_property ();.
bool operator()(const PortInterfaceProfile &p)
PortProfile helper class.
RTComponent header.
void eraseConnectorProfileById(const char *id)
Erase ConnectorProfile.
const ConnectorProfile getConnectorProfileById(const char *id) const
Get ConnectorProfile.
void setOwner(RTObject_ptr owner)
Set owner&#39;s object reference to the PortProfile.
SequenceEx< PortInterfaceProfileList, PortInterfaceProfile, Mutex > IfProfiles
PortService_ptr getPortRef() const
Get Port&#39;s object reference.
void eraseConnectorProfile(const char *name)
Erase ConnectorProfile.
const ConnectorProfile getConnectorProfile(const char *name) const
Get ConnectorProfile.
bool operator()(const ConnectorProfile &c)


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Thu Jun 6 2019 19:25:59