13#ifndef ML_BACKGROUND_TASK_MODULE_HANDLER_H
14#define ML_BACKGROUND_TASK_MODULE_HANDLER_H
26class BackgroundTaskBaseModule;
106 void preTaskFinished();
#define MLBACKGROUNDTASKS_EXPORT
Base class for ML modules that use background tasks.
A handle to a task that has been created by the background task manager.
BoolField * getTaskVerboseLoggingField()
BoolField * getTaskRunningField()
StringField * getTaskStatusField()
void setTaskCanceledField(NotifyField *taskCanceledField)
void startTask()
Starts a task with mode Asynchronous.
virtual void handleTaskFieldNotification(Field *field)
Handles field changes of the field field.
void cancelTask()
Cancels a task if it is currently running.
NotifyField * _taskFinished
void setTaskProgressField(FloatField *progressField)
bool willRestartTask()
Returns whether the task will be restarted after the previous task has been canceled.
virtual void taskFinished(BackgroundTask *task)
Callback for finished or canceled tasks.
NotifyField * _cancelTask
void setRestartTask(bool flag)
Sets whether the task should be restarted after the previous task finishes.
NotifyField * getTaskFinishedField()
virtual void postTaskFinished()
Called after taskFinished() has been called and can be used to handle the restarting of a task.
virtual ~BackgroundTaskModuleHandler()
ExecutionMode
Execution mode of background tasks.
@ Synchronous
Execute the background task synchronously.
void startTask(const ExecutionMode mode)
Starts a task with user specifying the mode (Synchronous or Asynchronous).
NotifyField * _startTaskSynchronous
bool hasRunningTask()
Returns whether a task is currently running and is not yet canceled.
FloatField * getTaskProgressField()
virtual void setupTaskFields(Module *module)
BoolField * _taskVerboseLogging
NotifyField * getTaskCanceledField()
NotifyField * getCancelTaskField()
NotifyField * getStartTaskField()
virtual void updateFinishedTaskStatus(BackgroundTask *task)
Updates the status and progress field of a finished task. This is called by taskFinished and may be r...
virtual ModuleBackgroundTask * createTask()=0
Requests to create a new task.
NotifyField * _taskCanceled
void setTaskRunningField(BoolField *taskRunningField)
void setTaskFinishedField(NotifyField *taskFinishedField)
BackgroundTaskModuleHandler()
NotifyField * getStartTaskSynchronousField()
void setTaskStatusField(StringField *statusField)
Base class for a task that is started in an extra thread.
Field to encapsulate a boolean value.
Base class for all fields used in the ML.
Field to encapsulate a float value.
ModuleBackgroundTask extends the ImagingBackgroundTask with several useful methods that allow asynchr...
Base class for an image processing module of the ML.
Field without value for notifications.
Field to encapsulate a string value.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.