PortProfileHelper.cpp
Go to the documentation of this file.
00001 // -*- C++ -*-
00019 #include "rtm/PortProfileHelper.h"
00020 
00021 namespace RTC
00022 {
00023   PortProfileHelper::PortProfileHelper()
00024   {
00025     ;
00026   }
00027 
00028 
00029   PortProfileHelper::~PortProfileHelper()
00030   {
00031     ;
00032   }
00033 
00034 
00042   void PortProfileHelper::setPortProfile(const PortProfile& profile)
00043   {
00044     Guard guard(m_mutex);
00045 
00046     m_name         = profile.name;
00047     m_ifProfiles   = profile.interfaces;
00048     m_portRef      = RTC::PortService::_duplicate(profile.port_ref);
00049     m_connProfiles = profile.connector_profiles;
00050     m_owner        = RTC::RTObject::_duplicate(profile.owner);
00051     m_properties   = profile.properties;
00052 
00053     return;
00054   }
00055 
00056 
00064   PortProfile* PortProfileHelper::getPortProfile()
00065   {
00066     Guard guard(m_mutex);
00067 
00068     PortProfile_var profile(new PortProfile());
00069     profile->name               = CORBA::string_dup(m_name.c_str());
00070     profile->interfaces         = m_ifProfiles;
00071     profile->port_ref           = m_portRef;
00072     profile->connector_profiles = m_connProfiles;
00073     profile->owner              = m_owner;
00074     profile->properties         = m_properties;
00075 
00076     return profile._retn();
00077   }
00078 
00079 
00087   void PortProfileHelper::setName(const char* name)
00088   {
00089     Guard guard(m_mutex);
00090 
00091     m_name = name;
00092   }
00093 
00094 
00102   const char* PortProfileHelper::getName() const
00103   {
00104     Guard guard(m_mutex);
00105 
00106     return m_name.c_str();
00107   }
00108   
00109 
00117   void
00118   PortProfileHelper::appendPortInterfaceProfile(PortInterfaceProfile if_prof)
00119   {
00120     Guard guard(m_mutex);
00121 
00122     m_ifProfiles.push_back(if_prof);
00123     return;
00124   }
00125 
00126 
00134   const PortInterfaceProfileList&
00135   PortProfileHelper::getPortInterfaceProfiles() const
00136   {
00137     Guard guard(m_mutex);
00138 
00139     return m_ifProfiles;
00140   }
00141 
00142 
00150   const PortInterfaceProfile
00151   PortProfileHelper::getPortInterfaceProfile(const char* instance_name) const
00152   {
00153     Guard guard(m_mutex);
00154 
00155     return m_ifProfiles.find(if_name(instance_name));
00156   }
00157 
00158 
00166   void PortProfileHelper::erasePortInterfaceProfile(const char* instance_name)
00167   {
00168     Guard guard(m_mutex);
00169 
00170     m_ifProfiles.erase_if(if_name(instance_name));
00171     return;
00172   }
00173 
00174 
00182   void PortProfileHelper::setPortRef(PortService_ptr port)
00183   {
00184     Guard guard(m_mutex);
00185 
00186     m_portRef = RTC::PortService::_duplicate(port);
00187   }
00188 
00189 
00197   PortService_ptr PortProfileHelper::getPortRef() const
00198   {
00199     Guard guard(m_mutex);
00200 
00201     return m_portRef;
00202   }
00203 
00204 
00212   void PortProfileHelper::appendConnectorProfile(ConnectorProfile conn_profile)
00213   {
00214     Guard guard(m_mutex);
00215 
00216     m_connProfiles.push_back(conn_profile);
00217   }
00218 
00219 
00227   const ConnectorProfileList PortProfileHelper::getConnectorProfiles() const
00228   {
00229     Guard guard(m_mutex);
00230 
00231     return m_connProfiles;
00232   }
00233 
00234 
00235 
00243   const ConnectorProfile
00244   PortProfileHelper::getConnectorProfile(const char* name) const
00245   {
00246     Guard guard(m_mutex);
00247 
00248     return m_connProfiles.find(conn_name(name));
00249   }
00250 
00251 
00259   const ConnectorProfile
00260   PortProfileHelper::getConnectorProfileById(const char* id) const
00261   {
00262     Guard guard(m_mutex);
00263 
00264     return m_connProfiles.find(conn_id(id));
00265   }
00266 
00267 
00276   void PortProfileHelper::eraseConnectorProfile(const char* name)
00277   {
00278     Guard guard(m_mutex);
00279 
00280     m_connProfiles.erase_if(conn_name(name));
00281     return;
00282   }
00283 
00284 
00292   void PortProfileHelper::eraseConnectorProfileById(const char* id)
00293   {
00294     Guard guard(m_mutex);
00295 
00296     m_connProfiles.erase_if(conn_id(id));
00297     return;
00298   }
00299 
00300 
00308   void PortProfileHelper::setOwner(RTObject_ptr owner)
00309   {
00310     Guard guard(m_mutex);
00311 
00312     m_owner = RTC::RTObject::_duplicate(owner);
00313   }
00314 
00315 
00322   RTObject_ptr PortProfileHelper::getOwner() const
00323   {
00324     Guard guard(m_mutex);
00325 
00326     return m_owner;
00327   }
00328 
00329 
00337   void PortProfileHelper::setProperties(NVList& prop)
00338   {
00339     Guard guard(m_mutex);
00340 
00341     m_properties = prop;
00342   }
00343 
00344 
00352   const NVList& PortProfileHelper::getProperties() const
00353   {
00354     Guard guard(m_mutex);
00355 
00356     return m_properties;
00357   }
00358 
00359 };


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Sat Jun 8 2019 18:49:06