#include <mlBackgroundTaskModuleHandler.h>
◆ ExecutionMode
Execution mode of background tasks.
Enumerator |
---|
Synchronous | Execute the background task synchronously.
|
Asynchronous | Execute the background task asynchronously.
|
Definition at line 33 of file mlBackgroundTaskModuleHandler.h.
◆ BackgroundTaskModuleHandler()
ml::BackgroundTaskModuleHandler::BackgroundTaskModuleHandler |
( |
| ) |
|
◆ ~BackgroundTaskModuleHandler()
virtual ml::BackgroundTaskModuleHandler::~BackgroundTaskModuleHandler |
( |
| ) |
|
|
virtual |
◆ cancelTask()
void ml::BackgroundTaskModuleHandler::cancelTask |
( |
| ) |
|
Cancels a task if it is currently running.
◆ createTask()
Requests to create a new task.
Reimplement this method and make sure that you keep no reference to your task, as it will be handed to the BackgroundTaskManager. The ownership of the pointer is passed to the caller. Note: only return a new task if all preconditions are met!
◆ getCancelTaskField()
NotifyField* ml::BackgroundTaskModuleHandler::getCancelTaskField |
( |
| ) |
|
|
inline |
◆ getStartTaskField()
NotifyField* ml::BackgroundTaskModuleHandler::getStartTaskField |
( |
| ) |
|
|
inline |
◆ getStartTaskSynchronousField()
NotifyField* ml::BackgroundTaskModuleHandler::getStartTaskSynchronousField |
( |
| ) |
|
|
inline |
◆ getTaskCanceledField()
NotifyField* ml::BackgroundTaskModuleHandler::getTaskCanceledField |
( |
| ) |
|
|
inline |
◆ getTaskFinishedField()
NotifyField* ml::BackgroundTaskModuleHandler::getTaskFinishedField |
( |
| ) |
|
|
inline |
◆ getTaskProgressField()
FloatField* ml::BackgroundTaskModuleHandler::getTaskProgressField |
( |
| ) |
|
|
inline |
◆ getTaskRunningField()
BoolField* ml::BackgroundTaskModuleHandler::getTaskRunningField |
( |
| ) |
|
|
inline |
◆ getTaskStatusField()
StringField* ml::BackgroundTaskModuleHandler::getTaskStatusField |
( |
| ) |
|
|
inline |
◆ getTaskVerboseLoggingField()
BoolField* ml::BackgroundTaskModuleHandler::getTaskVerboseLoggingField |
( |
| ) |
|
|
inline |
◆ handleTaskFieldNotification()
virtual void ml::BackgroundTaskModuleHandler::handleTaskFieldNotification |
( |
Field * |
field | ) |
|
|
virtual |
Handles field changes of the field field
.
◆ hasRunningTask()
bool ml::BackgroundTaskModuleHandler::hasRunningTask |
( |
| ) |
|
Returns whether a task is currently running and is not yet canceled.
◆ postTaskFinished()
virtual void ml::BackgroundTaskModuleHandler::postTaskFinished |
( |
| ) |
|
|
virtual |
Called after taskFinished() has been called and can be used to handle the restarting of a task.
Note: The previous task will already be deleted when this method is called.
◆ setRestartTask()
void ml::BackgroundTaskModuleHandler::setRestartTask |
( |
bool |
flag | ) |
|
|
inline |
◆ setTaskCanceledField()
void ml::BackgroundTaskModuleHandler::setTaskCanceledField |
( |
NotifyField * |
taskCanceledField | ) |
|
|
inline |
◆ setTaskFinishedField()
void ml::BackgroundTaskModuleHandler::setTaskFinishedField |
( |
NotifyField * |
taskFinishedField | ) |
|
|
inline |
◆ setTaskProgressField()
void ml::BackgroundTaskModuleHandler::setTaskProgressField |
( |
FloatField * |
progressField | ) |
|
|
inline |
◆ setTaskRunningField()
void ml::BackgroundTaskModuleHandler::setTaskRunningField |
( |
BoolField * |
taskRunningField | ) |
|
|
inline |
Optionally set output fields from outside before calling setupTaskFields. We do not allow to set fields that trigger or cancel a process, as that could easily lead to double notifications when old code already handles those fields.
Definition at line 46 of file mlBackgroundTaskModuleHandler.h.
◆ setTaskStatusField()
void ml::BackgroundTaskModuleHandler::setTaskStatusField |
( |
StringField * |
statusField | ) |
|
|
inline |
◆ setupTaskFields()
virtual void ml::BackgroundTaskModuleHandler::setupTaskFields |
( |
Module * |
module | ) |
|
|
virtual |
◆ startTask() [1/2]
void ml::BackgroundTaskModuleHandler::startTask |
( |
| ) |
|
|
inline |
◆ startTask() [2/2]
void ml::BackgroundTaskModuleHandler::startTask |
( |
const ExecutionMode |
mode | ) |
|
Starts a task with user specifying the mode (Synchronous or Asynchronous).
If a task is already running, it is canceled and a new task is started after it has finished. This will not happen within startTask, it will happen at a later time. You can check whether a restart was scheduled by using willRestartTask().
◆ taskFinished()
virtual void ml::BackgroundTaskModuleHandler::taskFinished |
( |
BackgroundTask * |
task | ) |
|
|
virtual |
Callback for finished or canceled tasks.
If overriding this, make sure to call the parent method.
◆ updateFinishedTaskStatus()
virtual void ml::BackgroundTaskModuleHandler::updateFinishedTaskStatus |
( |
BackgroundTask * |
task | ) |
|
|
virtual |
Updates the status and progress field of a finished task. This is called by taskFinished and may be reimplemented.
◆ willRestartTask()
bool ml::BackgroundTaskModuleHandler::willRestartTask |
( |
| ) |
|
|
inline |
◆ BackgroundTaskBaseModule
◆ Module
◆ _cancelTask
NotifyField* ml::BackgroundTaskModuleHandler::_cancelTask |
|
protected |
◆ _progress
FloatField* ml::BackgroundTaskModuleHandler::_progress |
|
protected |
◆ _startTask
NotifyField* ml::BackgroundTaskModuleHandler::_startTask |
|
protected |
◆ _startTaskSynchronous
NotifyField* ml::BackgroundTaskModuleHandler::_startTaskSynchronous |
|
protected |
◆ _status
◆ _taskCanceled
NotifyField* ml::BackgroundTaskModuleHandler::_taskCanceled |
|
protected |
◆ _taskFinished
NotifyField* ml::BackgroundTaskModuleHandler::_taskFinished |
|
protected |
◆ _taskRunning
BoolField* ml::BackgroundTaskModuleHandler::_taskRunning |
|
protected |
◆ _taskVerboseLogging
BoolField* ml::BackgroundTaskModuleHandler::_taskVerboseLogging |
|
protected |
The documentation for this class was generated from the following file: