coral
A C++ library for distributed co-simulation
|
An interface for classes that create slaves of a specific type. More...
#include "coral/provider/slave_creator.hpp"
Public Member Functions | |
virtual const coral::model::SlaveTypeDescription & | Description () const =0 |
A description of this slave type. | |
virtual bool | Instantiate (std::chrono::milliseconds timeout, coral::net::SlaveLocator &slaveLocator)=0 |
Creates a new instance of this slave type. More... | |
virtual std::string | InstantiationFailureDescription () const =0 |
A textual description of why a previous Instantiate() call failed. More... | |
An interface for classes that create slaves of a specific type.
|
pure virtual |
Creates a new instance of this slave type.
This function must report whether a slave was successfully instantiated. For example, the slave may represent a particular piece of hardware (e.g. a human interface device), of which there is only one. The function would then return false
if multiple instantiations are attempted.
If the function returns true
, it must also update slaveLocator
with information about the new slave. slaveLocator.Endpoint()
may then have one of three forms:
transport://address
:12345
. This may be used if the slave provider is bound to a TCP endpoint, and the slave is accessible on the same hostname but with a different port number.If the function returns false
, InstantiationFailureDescription() must return a textual description of the reasons for this. slaveLocator
must then be left untouched.
[in] | timeout | How long the master will wait for the slave to start up. If possible, instantiation should be aborted and considered "failed" after this time has passed. A negative value means that there is no timeout, the slave gets as much time as it needs. |
[out] | slaveLocator | An object that describes how to connect to the slave. See the list above for different endpoint formats. |
true
if a slave was successfully instantiated, false
otherwise.
|
pure virtual |
A textual description of why a previous Instantiate() call failed.
This function is only called if Instantiate() has returned false
.