|
template<typename R , typename F > |
void | thenWithResult (F functor) |
| Connects to a functor to which will be passed the result when the task is finished. More...
|
|
template<typename R , typename T , typename F > |
void | thenWithResult (T *context, F functor) |
| Connects to a functor or method to which will be passed the result when the task is finished. More...
|
|
template<typename R > |
R | result () |
| Returns the result of the task, waiting for it to finish if necessary. More...
|
|
template<typename T , typename F > |
void | then (T *context, F functor) |
| Connects to a functor or method which will be called when the task is finished. More...
|
|
template<typename F > |
void | then (F functor) |
| Connects to a functor which will be called when the task is finished. More...
|
|
bool | isFinished () const |
| Returns true if the task has finished. More...
|
|
template<typename F > |
void | doIfFinished (F functor) const |
| Executes some code (in the caller's thread) if the task has finished. More...
|
|
template<typename F > |
void | doIfNotFinished (F functor) const |
| Executes some code (in the caller's thread) if the task has not finished. More...
|
|
template<typename F1 , typename F2 > |
void | doIfFinishedElse (F1 ifFunctor, F2 elseFunctor) const |
| Executes some code (in the caller's thread) if the task has finished and some different code if it has not finished. More...
|
|
void | waitForFinished () noexcept |
| Blocks until the task is finished. More...
|
|
void | abandon () noexcept |
| Notify the task that its result is no longer needed, so it can finish early. More...
|
|
void | abandonAndWait () noexcept |
| Convenience to call abandon() followed by waitForFinished().
|
|
Class for doing some arbitrary parcel of work in its own thread.
The task is exposed as a function object, so could be a lambda or a hand-written closure. CWorker can not be subclassed, instead it can be extended with rich callable task objects.
Definition at line 187 of file worker.h.