PortProfileHelper.cpp
Go to the documentation of this file.
1 // -*- C++ -*-
19 #include "rtm/PortProfileHelper.h"
20 
21 namespace RTC
22 {
24  {
25  ;
26  }
27 
28 
30  {
31  ;
32  }
33 
34 
42  void PortProfileHelper::setPortProfile(const PortProfile& profile)
43  {
44  Guard guard(m_mutex);
45 
46  m_name = profile.name;
47  m_ifProfiles = profile.interfaces;
48  m_portRef = RTC::PortService::_duplicate(profile.port_ref);
49  m_connProfiles = profile.connector_profiles;
50  m_owner = RTC::RTObject::_duplicate(profile.owner);
51  m_properties = profile.properties;
52 
53  return;
54  }
55 
56 
65  {
66  Guard guard(m_mutex);
67 
68  PortProfile_var profile(new PortProfile());
69  profile->name = CORBA::string_dup(m_name.c_str());
70  profile->interfaces = m_ifProfiles;
71  profile->port_ref = m_portRef;
72  profile->connector_profiles = m_connProfiles;
73  profile->owner = m_owner;
74  profile->properties = m_properties;
75 
76  return profile._retn();
77  }
78 
79 
87  void PortProfileHelper::setName(const char* name)
88  {
89  Guard guard(m_mutex);
90 
91  m_name = name;
92  }
93 
94 
102  const char* PortProfileHelper::getName() const
103  {
104  Guard guard(m_mutex);
105 
106  return m_name.c_str();
107  }
108 
109 
117  void
118  PortProfileHelper::appendPortInterfaceProfile(PortInterfaceProfile if_prof)
119  {
120  Guard guard(m_mutex);
121 
122  m_ifProfiles.push_back(if_prof);
123  return;
124  }
125 
126 
136  {
137  Guard guard(m_mutex);
138 
139  return m_ifProfiles;
140  }
141 
142 
150  const PortInterfaceProfile
151  PortProfileHelper::getPortInterfaceProfile(const char* instance_name) const
152  {
153  Guard guard(m_mutex);
154 
155  return m_ifProfiles.find(if_name(instance_name));
156  }
157 
158 
166  void PortProfileHelper::erasePortInterfaceProfile(const char* instance_name)
167  {
168  Guard guard(m_mutex);
169 
170  m_ifProfiles.erase_if(if_name(instance_name));
171  return;
172  }
173 
174 
182  void PortProfileHelper::setPortRef(PortService_ptr port)
183  {
184  Guard guard(m_mutex);
185 
186  m_portRef = RTC::PortService::_duplicate(port);
187  }
188 
189 
197  PortService_ptr PortProfileHelper::getPortRef() const
198  {
199  Guard guard(m_mutex);
200 
201  return m_portRef;
202  }
203 
204 
212  void PortProfileHelper::appendConnectorProfile(ConnectorProfile conn_profile)
213  {
214  Guard guard(m_mutex);
215 
216  m_connProfiles.push_back(conn_profile);
217  }
218 
219 
228  {
229  Guard guard(m_mutex);
230 
231  return m_connProfiles;
232  }
233 
234 
235 
243  const ConnectorProfile
245  {
246  Guard guard(m_mutex);
247 
248  return m_connProfiles.find(conn_name(name));
249  }
250 
251 
259  const ConnectorProfile
261  {
262  Guard guard(m_mutex);
263 
264  return m_connProfiles.find(conn_id(id));
265  }
266 
267 
277  {
278  Guard guard(m_mutex);
279 
280  m_connProfiles.erase_if(conn_name(name));
281  return;
282  }
283 
284 
293  {
294  Guard guard(m_mutex);
295 
296  m_connProfiles.erase_if(conn_id(id));
297  return;
298  }
299 
300 
308  void PortProfileHelper::setOwner(RTObject_ptr owner)
309  {
310  Guard guard(m_mutex);
311 
312  m_owner = RTC::RTObject::_duplicate(owner);
313  }
314 
315 
322  RTObject_ptr PortProfileHelper::getOwner() const
323  {
324  Guard guard(m_mutex);
325 
326  return m_owner;
327  }
328 
329 
338  {
339  Guard guard(m_mutex);
340 
341  m_properties = prop;
342  }
343 
344 
353  {
354  Guard guard(m_mutex);
355 
356  return m_properties;
357  }
358 
359 };
void setProperties(NVList &prop)
Set properties to the PortProfile.
const NVList & getProperties() const
Get properties of the PortProfile.
RTObject_ptr getOwner() const
Get owner's object reference from the PortProfile.
PortProfile * getPortProfile()
Get PortProfile.
RT-Component.
PortProfileHelper()
Constructor.
const PortInterfaceProfile getPortInterfaceProfile(const char *instance_name) const
Get PortInterfaceProfile.
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.
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.
RTC&#39;s PortProfile helper class.
const PortInterfaceProfileList & getPortInterfaceProfiles() const
Get PortInterfaceProfileList.
void setPortProfile(const PortProfile &profile)
Set PortProfile.
prop
Organization::get_organization_property ();.
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.
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.


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Mon Jun 10 2019 14:07:54