AceSmartSoft API Documentation
Public Member Functions | List of all members
SmartACE::WiringMaster Class Reference

Master part of wiring pattern. More...

#include <smartWiring.hh>

Public Member Functions

 WiringMaster (SmartComponent *component)
 Constructor. More...
 
virtual ~WiringMaster ()
 Destructor. More...
 
Smart::StatusCode connect (const std::string &slavecmpt, const std::string &slaveprt, const std::string &servercmpt, const std::string &serversvc)
 Blocking call to connect port of the slave component to a service of a server component. More...
 
Smart::StatusCode disconnect (const std::string &slavecmpt, const std::string &slaveprt)
 Blocking call to disconnect port of a slave component from a service of a server. More...
 

Detailed Description

Master part of wiring pattern.

Provides dynamic wiring of components. Client parts of the communication patterns can be dynamically wired to appropriate servers if they register themself as ports. Dynamic wiring allows context dependent configuration of data flow between components as is often needed at the skill level of robotic architectures. The master part of the wiring pattern is visible to the user and allows to specify to which service of a server component a specific port of a component should connect to. Connections can be changed at any time since all communication patterns provide status information to cope with modified connections.

Demonstrated in ninth example

Constructor & Destructor Documentation

◆ WiringMaster()

SmartACE::WiringMaster::WiringMaster ( SmartComponent component)

Constructor.

Parameters
componentmanagement class of the component

(Currently exception not thrown)

◆ ~WiringMaster()

virtual SmartACE::WiringMaster::~WiringMaster ( )
virtual

Destructor.

Member Function Documentation

◆ connect()

Smart::StatusCode SmartACE::WiringMaster::connect ( const std::string &  slavecmpt,
const std::string &  slaveprt,
const std::string &  servercmpt,
const std::string &  serversvc 
)

Blocking call to connect port of the slave component to a service of a server component.

Connect the port slaveprt of the slave component slavecmpt to the service serversvc of the component servercmpt.

Warning
This method must not be called concurrently from several threads nor concurrently with the disconnect() method.
Parameters
slavecmptname of the slave component
slaveprtname of the port to be connected
servercmptname of the component to connect to
serversvcname of the service in component servercmpt to connect to
Returns
status code:
  • SMART_OK : everything is ok and the requested connection has been established successfully. An old connection is first removed before a new connection is established.
  • SMART_CANCELLED : blocking is not allowed or is not allowed anymore and therefore blocking call is aborted. The port of the slave component can now be either unchanged, disconnected or properly connected to the specified service provider.
  • SMART_UNKNOWNCOMPONENT : the addressed slave component is either not known or does not provide a wiring service. The requested connection can not be established.
  • SMART_UNKNOWNPORT : the specified port name is not known at the slave component. The requested connection can not be established.
  • SMART_SERVICEUNAVAILABLE : the slave component can not connect to the specified service of the specified server since the server and/or the service to be connected to from the slave component is not available.
  • SMART_INCOMPATIBLESERVICE : The service behind the specified port is not compatible with the service to be connected to. The requested connection can not be established.
  • SMART_ERROR_COMMUNICATION : communication problems either while connecting to the slave or at the slave component while it tried to establish the requested connection to the requested service provider. The port of the slave component can now either be unchanged, disconnected or already properly connected to the specified service provider.
  • SMART_ERROR : something went completely wrong, see SMART_ERROR_COMMUNICATION

◆ disconnect()

Smart::StatusCode SmartACE::WiringMaster::disconnect ( const std::string &  slavecmpt,
const std::string &  slaveprt 
)

Blocking call to disconnect port of a slave component from a service of a server.

Disconnect the port slaveprt of the slave component slavecmpt from any server connection.

Warning
This method must not be called concurrently from several threads nor concurrently with the connect() method.
Parameters
slavecmptname of the slave component
slaveprtname of the port to be disconnected
Returns
status code:
  • SMART_OK : everything is ok and the port is disconnected
  • SMART_CANCELLED : blocking is not allowed or is not allowed anymore and therefore blocking call is aborted. The port of the slave component now can either be unchanged or disconnected.
  • SMART_UNKNOWNCOMPONENT : the addressed slave component is either not known or does not provide a wiring service. The requested disconnect is not performed.
  • SMART_UNKNOWNPORT : the specified port name is not known at the slave component. The requested disconnect is not performed.
  • SMART_ERROR_COMMUNICATION : communication problems either while connecting to the slave or at the slave component while it tried to perform the disconnect. The port of the slave component can now either be unchanged or disconnected.
  • SMART_ERROR : something went completely wrong, see SMART_ERROR_COMMUNICATION

The documentation for this class was generated from the following file: