#include <mn_task_list.hpp>

+ Inheritance diagram for mn::basic_task_list:
+ Collaboration diagram for mn::basic_task_list:

Public Member Functions

void add_task (basic_task *task)
 
void remove_task (basic_task *task)
 
basic_taskget_task (int id)
 
basic_taskget_task (std::string name)
 

Static Public Member Functions

static basic_task_listinstance ()
 

Private Member Functions

 basic_task_list ()
 
basic_taskget_task (int core, int id)
 
basic_taskget_task (int core, std::string name)
 

Private Attributes

LockType_t m_pLock
 
std::map< int, std::list< basic_task * > > m_mapTaskOnCore
 

Static Private Attributes

static basic_task_listm_pInstance = NULL
 
static mutex_t m_staticInstanceMux
 

Detailed Description

A simple task list

Note
If MN_THREAD_CONFIG_ADD_TASK_TO_TASK_LIST activated then automatic added new basic_tasks to this list. On default is MN_THREAD_CONFIG_ADD_TASK_TO_TASK_LIST deactivated

Constructor & Destructor Documentation

◆ basic_task_list()

mn::basic_task_list::basic_task_list ( )
private

Construtor

Note
This is a signleton class, only one object plaese use basic_task_list::instance()

Member Function Documentation

◆ add_task()

void mn::basic_task_list::add_task ( basic_task task)

Add a task to list

Parameters
taskThe task to add

◆ get_task() [1/4]

basic_task * mn::basic_task_list::get_task ( int  core,
int  id 
)
private

Get a task from the list by id on a specific core

Parameters
idThe id to search
coreThe core
Returns
The finded task, by id. NULL when not finded a task

◆ get_task() [2/4]

basic_task * mn::basic_task_list::get_task ( int  core,
std::string  name 
)
private

Get a task from the list by name on a specific core

Parameters
nameThe name to search
coreThe core
Returns
The finded task, by name. NULL when not finded a task

◆ get_task() [3/4]

basic_task * mn::basic_task_list::get_task ( int  id)

Get a task from the list by id

Parameters
idThe id to search
Returns
The finded task, by id. NULL when not finded a task

◆ get_task() [4/4]

basic_task * mn::basic_task_list::get_task ( std::string  name)

Get a task from the list by name

Parameters
nameThe name to search
Returns
The finded task, by name. NULL when not finded a task

◆ instance()

static basic_task_list& mn::basic_task_list::instance ( )
inlinestatic

Get the singleton instance

Returns
The singleton instance

◆ remove_task()

void mn::basic_task_list::remove_task ( basic_task task)

Remove a task from the list

Parameters
taskThe task to remove

Member Data Documentation

◆ m_mapTaskOnCore

std::map<int, std::list<basic_task*> > mn::basic_task_list::m_mapTaskOnCore
private

The map for this Task list holder

◆ m_pInstance

basic_task_list * mn::basic_task_list::m_pInstance = NULL
staticprivate

The static object of this class

◆ m_pLock

LockType_t mn::basic_task_list::m_pLock
private

Lock Object for this

◆ m_staticInstanceMux

mutex_t mn::basic_task_list::m_staticInstanceMux
staticprivate

The static instance mutex


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