coral
A C++ library for distributed co-simulation
|
Contains the Type member alias, which defines the signature for functions executed asynchronously by CommThread. More...
#include "coral/async.hpp"
Public Types | |
using | Type = std::function< void(coral::net::Reactor &, StackData &, std::promise< Result >)> |
An std::function specialisation which defines the signature for functions executed asynchronously by CommThread. More... | |
Contains the Type member alias, which defines the signature for functions executed asynchronously by CommThread.
StackData | The type used for the StackData parameter of the CommThread template. |
Result | The type of value returned by the task function (by means of the future/promise mechanism). |
using coral::async::CommThreadTask< StackData, Result >::Type = std::function<void( coral::net::Reactor&, StackData&, std::promise<Result>)> |
An std::function specialisation which defines the signature for functions executed asynchronously by CommThread.
If StackData
is not void
, the signature is defined as follows:
And if StackData
is void
, the signature is defined like this:
Here, reactor
and data
are the dedicated coral::net::Reactor and StackData
objects associated with the background thread, respectively, and promise
is the std::promise object which the task function should use to return its result (or throw an exception).