Changeset 91:16104eff1b99 in finroc_plugins_runtime_construction


Ignore:
Timestamp:
14.05.2017 13:29:00 (20 months ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
17.03
Phase:
public
Message:

Changes tAdministrationService::DeleteUriConnector to be more suitable for use with finstruct

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tAdministrationService.cpp

    r90 r91  
    302302} 
    303303 
    304 bool tAdministrationService::DeleteUriConnector(int local_port_handle, const rrlib::uri::tURI& uri) 
     304bool tAdministrationService::DeleteUriConnector(int local_port_handle, uint index) 
    305305{ 
    306306  core::tAbstractPort* port = core::tRuntimeEnvironment::GetInstance().GetPort(local_port_handle); 
     
    308308  if (port && port->IsReady()) 
    309309  { 
    310     for (auto & connector : port->UriConnectors()) 
    311     { 
    312       if (connector->Uri() == uri) 
    313       { 
    314         connector->Disconnect(); 
    315         return true; 
    316       } 
    317     } 
    318     result << "No connector with URI " << uri.ToString() << " found"; 
     310    if (port->UriConnectors().size() > index && port->UriConnectors()[index]) 
     311    { 
     312      port->UriConnectors()[index]->Disconnect(); 
     313      return true; 
     314    } 
     315    result << "No URI connector with index " << index << " found"; 
    319316  } 
    320317  else 
  • tAdministrationService.h

    r90 r91  
    154154   * 
    155155   * \param local_port_handle Handle of local owner port 
    156    * \param uri URI of partner port 
     156   * \param index Index of URI connector in owner port's list 
    157157   * \return Whether any connector was deleted 
    158158   */ 
    159   bool DeleteUriConnector(int local_port_handle, const rrlib::uri::tURI& uri); 
     159  bool DeleteUriConnector(int local_port_handle, uint index); 
    160160 
    161161  /*! 
Note: See TracChangeset for help on using the changeset viewer.