Platinum UPnP SDK
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>

Public Member Functions

 PLT_TaskManager (NPT_Cardinal max_tasks=0)
 Create a new Task Manager.
 
NPT_Cardinal GetMaxTasks ()
 Returns the max number of concurrent tasks allowed.
 
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.
 
NPT_Result StopAllTasks ()
 Stop all tasks associated with this task manager.
 

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 ( 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

NPT_Cardinal PLT_TaskManager::GetMaxTasks ( )
inline

Returns the max number of concurrent tasks allowed.

0 for no limit.

virtual 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.
NPT_Result PLT_TaskManager::StopAllTasks ( )

Stop all tasks associated with this task manager.


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