coral
A C++ library for distributed co-simulation
|
A class which contains the state of the slave and takes care of responding to requests from the master node in an appropriate manner. More...
#include "coral/bus/slave_agent.hpp"
Public Member Functions | |
SlaveAgent (coral::net::Reactor &reactor, coral::slave::Instance &slaveInstance, const coral::net::Endpoint &controlEndpoint, const coral::net::Endpoint &dataPubEndpoint, std::chrono::milliseconds masterInactivityTimeout) | |
Constructs a new SlaveAgent. More... | |
coral::net::Endpoint | BoundControlEndpoint () const |
The endpoint on which the slave is listening for incoming messages from the master. More... | |
coral::net::Endpoint | BoundDataPubEndpoint () const |
The endpoint to which the slave is publishing its output data. More... | |
A class which contains the state of the slave and takes care of responding to requests from the master node in an appropriate manner.
coral::bus::SlaveAgent::SlaveAgent | ( | coral::net::Reactor & | reactor, |
coral::slave::Instance & | slaveInstance, | ||
const coral::net::Endpoint & | controlEndpoint, | ||
const coral::net::Endpoint & | dataPubEndpoint, | ||
std::chrono::milliseconds | masterInactivityTimeout | ||
) |
Constructs a new SlaveAgent.
[in] | reactor | The Reactor which should be used to listen for incoming messages. |
[in] | slaveInstance | The slave itself. |
[in] | controlEndpoint | The endpoint to which the slave should bind to receive an incoming connection from a master. |
[in] | dataPubEndpoint | The endpoint to which the slave should bind and publish its output data. |
[in] | masterInactivityTimeout | How long to wait for commands from a master before assuming that the connection is broken. If the timeout is reached, a coral::slave::TimeoutException will be thrown (and propagate out through coral::net::Reactor::Run()). |
coral::net::Endpoint coral::bus::SlaveAgent::BoundControlEndpoint | ( | ) | const |
The endpoint on which the slave is listening for incoming messages from the master.
This is useful if the controlEndpoint
argument passed to the constructor contains a wildcard port number, in which case this function will return the actual port used.
coral::net::Endpoint coral::bus::SlaveAgent::BoundDataPubEndpoint | ( | ) | const |
The endpoint to which the slave is publishing its output data.
This is useful if the dataPubEndpoint
argument passed to the constructor contains a wildcard port number, in which case this function will return the actual port used.