Blue Brain BioExplorer
|
#include <Task.h>
Public Member Functions | |
virtual | ~AbstractTask ()=default |
void | cancel (std::function< void()> done={}) |
void | finishCancel () |
bool | canceled () const |
virtual void | schedule ()=0 |
Public Attributes | |
Progress | progress {"Scheduling task ..."} |
Protected Attributes | |
async::cancellation_token | _cancelToken |
std::function< void()> | _cancelDone |
std::atomic_bool | _cancelled {false} |
A task is an operation that can be scheduled (directly, async, ...) and has support for progress reporting during the execution and cancellation of the execution.
|
virtualdefault |
|
inline |
Cancels the task if is either waiting to be scheduled or already running. Will have no effect if the task already finished.
done | for asynchronous cancel processing, this function will be remembered and can be called via finishCancel() |
|
inline |
|
inline |
|
pure virtual |
Schedule the execution of the task. Depending on the concrete task type, the task could still be running though after construction.
Implemented in core::Task< T >, core::Task< ModelDescriptorPtr >, and core::DeferredTask< T >.
|
protected |
|
protected |
|
protected |
Progress core::AbstractTask::progress {"Scheduling task ..."} |