tbx  0.7.6
Classes | Public Member Functions | List of all members
tbx::TaskManager Class Reference

Class to find and enumerate running tasks. More...

#include <taskmanager.h>

Public Member Functions

bool running (const std::string &task_name) const
 Check if a task is running. More...
 
std::string name (TaskHandle handle) const
 Return name of task from a handle. More...
 
TaskHandle find_first (const std::string &task_name) const
 Find the first running task with the given name. More...
 
bool find_first (TaskInfo &info, const std::string &task_name) const
 Find first running task with given name and return full info. More...
 
bool find_all (std::vector< TaskInfo > &infos, const std::string &task_name) const
 Find all running tasks with given name and return full info. More...
 
void list (std::vector< TaskInfo > &infos) const
 Get list of all running tasks. More...
 

Detailed Description

Class to find and enumerate running tasks.

Member Function Documentation

◆ find_all()

bool tbx::TaskManager::find_all ( std::vector< TaskInfo > &  infos,
const std::string &  task_name 
) const

Find all running tasks with given name and return full info.

Parameters
infosvector of task information for found tasks
task_namename of task to find
Returns
true if on or more tasks were.

◆ find_first() [1/2]

TaskHandle tbx::TaskManager::find_first ( const std::string &  task_name) const

Find the first running task with the given name.

Parameters
task_namename of task to find
Returns
Handle to task or 0 if not found

◆ find_first() [2/2]

bool tbx::TaskManager::find_first ( TaskInfo info,
const std::string &  task_name 
) const

Find first running task with given name and return full info.

Parameters
infotask information filled in if task name found
task_namename of task to find
Returns
true if task is found in which case info is valid.

◆ list()

void tbx::TaskManager::list ( std::vector< TaskInfo > &  infos) const

Get list of all running tasks.

Parameters
infotask information for all tasks

◆ name()

std::string tbx::TaskManager::name ( TaskHandle  handle) const

Return name of task from a handle.

Parameters
handleTaskHandle to get name for
Returns
name of task
Exceptions
tbx::OsErrorinvalid task handle

◆ running()

bool tbx::TaskManager::running ( const std::string &  task_name) const

Check if a task is running.

Parameters
task_namename of task to search for
Returns
true if the task is running

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