kodi
Public Member Functions | Friends | List of all members
PLT_TaskManager Class Reference

The PLT_TaskManager class maintains a list of runnable tasks. More...

#include <PltTaskManager.h>

Inheritance diagram for PLT_TaskManager:
Inheritance graph
[legend]

Public Member Functions

 PLT_TaskManager (NPT_Cardinal max_tasks=0)
 Create a new Task Manager. More...
 
virtual NPT_Result StartTask (PLT_ThreadTask *task, NPT_TimeInterval *delay=NULL, bool auto_destroy=true)
 Start a new new task and associates it with this task manager. More...
 
NPT_Result Abort ()
 Stop all tasks associated with this task manager.
 
NPT_Result Reset ()
 Reset task manager after an Abort so new tasks can be queued.
 
NPT_Cardinal GetMaxTasks ()
 Returns the max number of concurrent tasks allowed. More...
 

Friends

class PLT_ThreadTask
 

Detailed Description

The PLT_TaskManager class maintains a list of runnable tasks.

During shutdown, it can stop all running tasks. Additionally, it can limit the number of tasks that can run at any given time.

Constructor & Destructor Documentation

◆ PLT_TaskManager()

PLT_TaskManager::PLT_TaskManager ( NPT_Cardinal  max_tasks = 0)

Create a new Task Manager.

Parameters
max_tasksMaximum number of concurrent tasks that the task manager will allow. When the value is reached, a thread calling AddTask will block until a task has finished.

Member Function Documentation

◆ GetMaxTasks()

NPT_Cardinal PLT_TaskManager::GetMaxTasks ( )
inline

Returns the max number of concurrent tasks allowed.

0 for no limit.

◆ StartTask()

NPT_Result PLT_TaskManager::StartTask ( PLT_ThreadTask task,
NPT_TimeInterval delay = NULL,
bool  auto_destroy = true 
)
virtual

Start a new new task and associates it with this task manager.

Parameters
tasknew task
delayoptional time interval to wait before launching the new task
auto_destroya flag to indicate if the task is owned by someone else and thus should not destroy itself when done.

The documentation for this class was generated from the following files: