13#ifndef ML_BACKGROUND_TASK_MODULE_HANDLER_H
14#define ML_BACKGROUND_TASK_MODULE_HANDLER_H
26class BackgroundTaskBaseModule;
106 void preTaskFinished();
#define MLBACKGROUNDTASKS_EXPORT
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)
NotifyField * _cancelTask
void setRestartTask(bool flag)
Sets whether the task should be restarted after the previous task finishes.
NotifyField * getTaskFinishedField()
virtual void postTaskFinished()
virtual ~BackgroundTaskModuleHandler()
ExecutionMode
Execution mode of background tasks.
@ Synchronous
Execute the background task synchronously.
@ Asynchronous
Execute the background task asynchronously.
void startTask(const ExecutionMode mode)
friend class BackgroundTaskBaseModule
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
NotifyField * _taskCanceled
void setTaskRunningField(BoolField *taskRunningField)
void setTaskFinishedField(NotifyField *taskFinishedField)
BackgroundTaskModuleHandler()
NotifyField * getStartTaskSynchronousField()
void setTaskStatusField(StringField *statusField)