coral
A C++ library for distributed co-simulation
|
A class which handles publishing of variable values on the network. More...
#include "coral/bus/variable_io.hpp"
Public Member Functions | |
VariablePublisher () | |
Default constructor. More... | |
void | Bind (const coral::net::Endpoint &endpoint) |
Binds to a local endpoint. More... | |
coral::net::Endpoint | BoundEndpoint () const |
Returns the endpoint bound to by the last Bind() call. More... | |
void | Publish (coral::model::StepID stepID, coral::model::SlaveID slaveID, coral::model::VariableID variableID, coral::model::ScalarValue value) |
Publishes the value of a single variable. More... | |
A class which handles publishing of variable values on the network.
coral::bus::VariablePublisher::VariablePublisher | ( | ) |
Default constructor.
Note that Bind() must be called before any variables may be published.
void coral::bus::VariablePublisher::Bind | ( | const coral::net::Endpoint & | endpoint | ) |
Binds to a local endpoint.
[in] | endpoint | The endpoint, in the format tcp://<interface>:<port> , where "interface" may be "*" to signify all network interfaces, and "port" may be "*" to signify an OS-assigned (ephemeral) port. |
coral::net::Endpoint coral::bus::VariablePublisher::BoundEndpoint | ( | ) | const |
void coral::bus::VariablePublisher::Publish | ( | coral::model::StepID | stepID, |
coral::model::SlaveID | slaveID, | ||
coral::model::VariableID | variableID, | ||
coral::model::ScalarValue | value | ||
) |
Publishes the value of a single variable.
While this is not enforced by the present function, the recipient (i.e., the VariableSubscriber) requires that all subscribed-to variables be published for any given time step, and that the time step ID never decreases.
[in] | stepID | Time step ID |
[in] | slaveID | Slave ID |
[in] | variableID | Variable ID (which is paired with the slave ID to form a "global" variable ID before sending) |
[in] | value | The variable value |