The PLT_ThreadTask class is a base class for executing a given task in a worker thread.
More...
#include <PltThreadTask.h>
|
NPT_Result | Kill () |
| When a task is not managed by a PLT_TaskManager, the owner must call this to stop and destroy it.
|
|
|
virtual bool | IsAborting (NPT_Timeout timeout) |
| Return whether this task is in the process of stopping. More...
|
|
NPT_Result | Start (PLT_TaskManager *task_manager=NULL, NPT_TimeInterval *delay=NULL, bool auto_destroy=true) |
| Start a task by associating it with a task manager. More...
|
|
NPT_Result | Stop (bool blocking=true) |
| Stop the task. More...
|
|
virtual void | DoInit () |
| This method to override in derived classes is called when the task is about to start.
|
|
virtual void | DoAbort () |
| This method to override in derived classes is called when the task is about to stop.
|
|
virtual void | DoRun () |
| This method to override in derived classes is the main task loop.
|
|
| PLT_ThreadTask () |
| A PLT_ThreadTask base class is never instantiated directly.
|
|
| ~PLT_ThreadTask () override |
| The task manager will destroy the task when finished if m_AutoDestroy is true otherwise the owner of this task must use the Kill method.
|
|
The PLT_ThreadTask class is a base class for executing a given task in a worker thread.
A PLT_ThreadTask is usually always associated to a PLT_TaskManager which maintains a list to stop and destroy tasks when finished.
◆ IsAborting()
virtual bool PLT_ThreadTask::IsAborting |
( |
NPT_Timeout |
timeout | ) |
|
|
inlineprotectedvirtual |
Return whether this task is in the process of stopping.
- Parameters
-
timeout | number of milliseconds to wait |
- Returns
- boolean indicating if the task is stopping
◆ Start()
Start a task by associating it with a task manager.
- Parameters
-
task_manager | PLT_TaskManager pointer |
delay | optional time interval to wait before launching the new task |
auto_destroy | a flag to indicate if the task is owned by someone else and thus should not destroy itself when done. |
◆ Stop()
NPT_Result PLT_ThreadTask::Stop |
( |
bool |
blocking = true | ) |
|
|
protected |
Stop the task.
This is either called by a task manager or the Kill method.
- Parameters
-
blocking | Whether the method should block until the task has finished. |
The documentation for this class was generated from the following files:
- lib/libUPnP/Platinum/Source/Core/PltThreadTask.h
- lib/libUPnP/Platinum/Source/Core/PltThreadTask.cpp