#include <Active.h>
template<class RT>
class Active< RT >
An active object implementation.
I got most of the stuff from Herb Sutters column in Dr. Dobbs: http://www.drdobbs.com/parallel/prefer-using-active-objects-instead-of-n/225700095 .
I did some pimping with packaged tasks and futures...
Definition at line 11 of file Active.h.
The thread execution loop is created from a lambda.
Definition at line 42 of file Active.h.
Sends a worker function/packaged task to the queue to be executed in the Active's thread.
- Parameters
-
[in] | _cmd | The worker function/packaged task to be queued |
- Returns
- the future for the return value of the worker function
Definition at line 59 of file Active.h.
template<class RT>
void Active< RT >::AbortCurrent |
( |
| ) |
|
|
inline |
Aborts the currently executed worker function.
Definition at line 75 of file Active.h.
Send lambda with done=true to the worker, join the worker thread, and clear the packaged task queue.
Definition at line 80 of file Active.h.
the abort signal
Definition at line 20 of file Active.h.
this is set to quit the worker thread
Definition at line 23 of file Active.h.
synchronized queue of worker functions/packaged tasks that are executed in the Active' thread (see lambda in constructor).
Definition at line 26 of file Active.h.
template<class RT>
std::thread Active< RT >::thread |
|
protected |
a thread in which Run runs
Definition at line 29 of file Active.h.
The documentation for this class was generated from the following file: