AceSmartSoft API Documentation
|
Client part of one-way communication pattern. More...
#include <smartSend.hh>
Public Member Functions | |
SendClient (SmartComponent *component, const std::string &port, SmartACE::WiringSlave *slave) | |
Constructor (port wireable from outside by other components). More... | |
SendClient (SmartComponent *component) | |
Constructor (not wired with service provider and not exposed as port). More... | |
SendClient (SmartComponent *component, const std::string &server, const std::string &service) | |
Constructor (wired with specified service provider). More... | |
virtual | ~SendClient () |
Destructor. More... | |
Smart::StatusCode | add (SmartACE::WiringSlave *slave, const std::string &port) |
Add this instance to the set of ports wireable via the wiring pattern from outside the component. More... | |
Smart::StatusCode | remove () |
Remove this service requestor from the set of ports wireable via the wiring pattern from outside the component. More... | |
Smart::StatusCode | connect (const std::string &server, const std::string &service) |
Connect this service requestor to the denoted service provider. More... | |
Smart::StatusCode | disconnect () |
Disconnect the service requestor from the service provider. More... | |
Smart::StatusCode | blocking (const bool b) |
Allow or abort and reject blocking calls. More... | |
Smart::StatusCode | send (const C &c) |
Perform a one-way communication. More... | |
Client part of one-way communication pattern.
Template parameters
Demonstrated in sixth example
SmartACE::SendClient< C >::SendClient | ( | SmartComponent * | component, |
const std::string & | port, | ||
SmartACE::WiringSlave * | slave | ||
) |
Constructor (port wireable from outside by other components).
add()/remove() and connect()/disconnect() can always be used to change the status of the client object. Client is not connected to a server.
Throws exception if port name is already in use.
component | management class of the component |
port | name of the wireable port |
slave | wiring slave of this component |
SmartACE::SendClient< C >::SendClient | ( | SmartComponent * | component | ) |
Constructor (not wired with service provider and not exposed as port).
add()/remove() and connect()/disconnect() can always be used to change the status of the instance. Instance is not connected to a service provider and is not exposed as port wireable from outside the component.
(Currently exception not thrown)
component | management class of the component |
SmartACE::SendClient< C >::SendClient | ( | SmartComponent * | component, |
const std::string & | server, | ||
const std::string & | service | ||
) |
Constructor (wired with specified service provider).
Connects to the denoted service and blocks until the connection has been established. Blocks infinitely if denoted service becomes not available since constructor performs retries. Blocking is useful to simplify startup of components which have mutual dependencies. add()/remove() and connect()/disconnect() can always be used to change the status of the instance.
Throws exception if denoted service is incompatible (wrong communication pattern or wrong communication objects).
component | management class of the component |
server | name of the server |
service | name of the service |
|
virtual |
Destructor.
The destructor calls remove() and disconnect() and therefore properly cleans up.
Smart::StatusCode SmartACE::SendClient< C >::add | ( | SmartACE::WiringSlave * | slave, |
const std::string & | port | ||
) |
Add this instance to the set of ports wireable via the wiring pattern from outside the component.
Already established connections keep valid. If this service requestor is already exposed as port, it is first removed and then added with the new port name. add()/remove() and connect()/disconnect() can always be used to change the status of this instance.
slave | wiring slave of this component |
port | name of port used for wiring |
Smart::StatusCode SmartACE::SendClient< C >::blocking | ( | const bool | b | ) |
Allow or abort and reject blocking calls.
If blocking is set to false all blocking calls return with SMART_CANCELLED. This can be used to abort blocking calls. Since this pattern currently does not have any blocking member functions, currently without effect.
b | (blocking) true/false |
Smart::StatusCode SmartACE::SendClient< C >::connect | ( | const std::string & | server, |
const std::string & | service | ||
) |
Connect this service requestor to the denoted service provider.
An already established connection is first disconnected.
It is no problem to change the connection to a service provider at any point of time irrespective of any calls to send().
server | name of the server |
service | name of the service |
Smart::StatusCode SmartACE::SendClient< C >::disconnect | ( | ) |
Disconnect the service requestor from the service provider.
It is no problem to change the connection to a service provider at any point of time irrespective of any calls to send().
Smart::StatusCode SmartACE::SendClient< C >::remove | ( | ) |
Remove this service requestor from the set of ports wireable via the wiring pattern from outside the component.
Already established connections keep valid but can now be changed only from inside and not from outside this component anymore.
Smart::StatusCode SmartACE::SendClient< C >::send | ( | const C & | c | ) |
Perform a one-way communication.
Appropriate status codes make sure that the information has been transferred.
c | the object to be sent (Communication Object) |