mn_task_list.hpp
Go to the documentation of this file.
1 
19 #ifndef MINLIB_ESP32_THREAD_LIST_
20 #define MINLIB_ESP32_THREAD_LIST_
21 
22 #include "mn_config.hpp"
23 
24 class basic_task;
25 
26 #include <list>
27 #include <map>
28 
29 #include "mn_copyable.hpp"
30 
31 namespace mn {
32 
46 
55  public:
61  void add_task(basic_task* task);
67  void remove_task(basic_task* task);
68 
75  basic_task* get_task(int id);
82  basic_task* get_task(std::string name);
83  private:
91  basic_task* get_task(int core, int id);
99  basic_task* get_task(int core, std::string name);
100  public:
107  if(m_pInstance != NULL)
109  return *m_pInstance;
110  }
111  private:
119  std::map<int, std::list<basic_task*> > m_mapTaskOnCore;
120  };
121 
123 }
124 
125 #endif
Definition: mn_lock.hpp:122
Definition: mn_binary_semaphore.hpp:29
Definition: mn_mutex.hpp:37
Definition: mn_task_list.hpp:39
static mutex_t m_staticInstanceMux
Definition: mn_task_list.hpp:54
static basic_task_list & instance()
Definition: mn_task_list.hpp:105
basic_task_list()
Definition: mn_task_list.cpp:30
LockType_t m_pLock
Definition: mn_task_list.hpp:115
void remove_task(basic_task *task)
Definition: mn_task_list.cpp:48
std::map< int, std::list< basic_task * > > m_mapTaskOnCore
Definition: mn_task_list.hpp:119
static basic_task_list * m_pInstance
Definition: mn_task_list.hpp:50
basic_task * get_task(int id)
Definition: mn_task_list.cpp:60
void add_task(basic_task *task)
Definition: mn_task_list.cpp:36
Wrapper class around FreeRTOS's implementation of a task.
Definition: mn_task.hpp:88
#define MN_ONSIGLETN_CLASS
Definition: mn_copyable.hpp:27
Definition: mn_allocator_typetraits.hpp:25
int lock(TLOCK &m1, unsigned int timeout)
Definition: mn_autolock.hpp:70