coral
A C++ library for distributed co-simulation
|
A common communication interface to a cluster of slave providers. More...
#include "coral/master/cluster.hpp"
Classes | |
struct | SlaveType |
Information about a slave type. More... | |
Public Member Functions | |
ProviderCluster (const coral::net::ip::Address &networkInterface, coral::net::ip::Port discoveryPort) | |
Constructor. More... | |
~ProviderCluster () CORAL_NOEXCEPT | |
Destructor. | |
ProviderCluster (ProviderCluster &&) CORAL_NOEXCEPT | |
Move constructor. | |
ProviderCluster & | operator= (ProviderCluster &&) CORAL_NOEXCEPT |
Move assignment operator. | |
std::vector< SlaveType > | GetSlaveTypes (std::chrono::milliseconds timeout) |
Returns available slave types. More... | |
coral::net::SlaveLocator | InstantiateSlave (const std::string &slaveProviderID, const std::string &slaveTypeUUID, std::chrono::milliseconds timeout) |
Instantiates a slave. More... | |
A common communication interface to a cluster of slave providers.
This class represents a common interface to several slave providers in a network. It can be used to get information about the available slave types and to instantiate slaves on specific providers.
coral::master::ProviderCluster::ProviderCluster | ( | const coral::net::ip::Address & | networkInterface, |
coral::net::ip::Port | discoveryPort | ||
) |
Constructor.
[in] | networkInterface | The name or IP address of the network interface that should be used, or "*" for all available interfaces. |
[in] | discoveryPort | The UDP port used for discovering other entities such as slave providers. |
std::vector<SlaveType> coral::master::ProviderCluster::GetSlaveTypes | ( | std::chrono::milliseconds | timeout | ) |
Returns available slave types.
[in] | timeout | Maximum time to wait for replies from known slave providers. |
coral::net::SlaveLocator coral::master::ProviderCluster::InstantiateSlave | ( | const std::string & | slaveProviderID, |
const std::string & | slaveTypeUUID, | ||
std::chrono::milliseconds | timeout | ||
) |
Instantiates a slave.
timeout
specifies how long the slave provider should wait for the slave to start up before assuming it has crashed or frozen. The master will wait twice as long as this for the slave provider to report that the slave has been successfully instantiated before it assumes the slave provider itself has crashed or the connection has been lost. In both cases, an exception is thrown.
[in] | slaveProviderID | The ID of the slave provider that should instantiate the slave. |
[in] | slaveTypeUUID | The UUID that identifies the type of the slave that is to be instantiated. |
[in] | timeout | How much time the slave gets to start up. |