coral
A C++ library for distributed co-simulation
Public Types | List of all members
coral::async::CommThreadTask< StackData, Result > Struct Template Reference

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

Detailed Description

template<typename StackData, typename Result>
struct coral::async::CommThreadTask< StackData, Result >

Contains the Type member alias, which defines the signature for functions executed asynchronously by CommThread.

Template Parameters
StackDataThe type used for the StackData parameter of the CommThread template.
ResultThe type of value returned by the task function (by means of the future/promise mechanism).

Member Typedef Documentation

template<typename StackData, typename Result>
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:

void fun(
StackData& data,

And if StackData is void, the signature is defined like this:

void fun(

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


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