coral
A C++ library for distributed co-simulation
Public Member Functions | List of all members
coral::bus::SlaveAgent Class Reference

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...
 

Detailed Description

A class which contains the state of the slave and takes care of responding to requests from the master node in an appropriate manner.

Constructor & Destructor Documentation

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.

Parameters
[in]reactorThe Reactor which should be used to listen for incoming messages.
[in]slaveInstanceThe slave itself.
[in]controlEndpointThe endpoint to which the slave should bind to receive an incoming connection from a master.
[in]dataPubEndpointThe endpoint to which the slave should bind and publish its output data.
[in]masterInactivityTimeoutHow 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()).

Member Function Documentation

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.


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