#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 |
( |
| ) |
|
Cancel a task if it is currently running.
◆ createTask()
Request a new task to be created, reimplement this method and make sure that you keep no reference to your task, because 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 |
Handle field changes of the field field
.
◆ hasRunningTask()
bool ml::BackgroundTaskModuleHandler::hasRunningTask |
( |
| ) |
|
Returns if a task is currently running (and 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 don't allow to set fields that trigger or cancel a process because that could easily lead to double notifications when old code already handles those fields.
Definition at line 46 of file mlBackgroundTaskModuleHandler.h.
References mlrange_cast().
◆ setTaskStatusField()
void ml::BackgroundTaskModuleHandler::setTaskStatusField |
( |
StringField * | statusField | ) |
|
|
inline |
◆ setupTaskFields()
◆ startTask() [1/2]
void ml::BackgroundTaskModuleHandler::startTask |
( |
| ) |
|
|
inline |
◆ startTask() [2/2]
Start 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 if a restart was scheduled by using willRestartTask().
◆ taskFinished()
Callback for finished/canceled tasks (to be derived, make sure to call parent method).
◆ updateFinishedTaskStatus()
Updates the status and progress field of a finished task, 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: