mn_workqueue_multi.hpp
Go to the documentation of this file.
1 /*
2 *This file is part of the Mini Thread Library (https://github.com/RoseLeBlood/MiniThread ).
3 *Copyright (c) 2020 Amber-Sophia Schroeck
4 *
5 *The Mini Thread Library is free software; you can redistribute it and/or modify
6 *it under the terms of the GNU Lesser General Public License as published by
7 *the Free Software Foundation, version 3, or (at your option) any later version.
8 
9 *The Mini Thread Library is distributed in the hope that it will be useful, but
10 *WITHOUT ANY WARRANTY; without even the implied warranty of
11 *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 *General Public License for more details.
13 *
14 *You should have received a copy of the GNU Lesser General Public
15 *License along with the Mini Thread Library; if not, see
16 *<https://www.gnu.org/licenses/>.
17 */
18 #ifndef MINLIB_ESP32_WORK_QUEUE_MULTI_
19 #define MINLIB_ESP32_WORK_QUEUE_MULTI_
20 
21 #include "mn_workqueue.hpp"
22 #include <vector>
23 
24 namespace mn {
25  namespace queue {
32  public:
42  uint16_t usStackDepth = MN_THREAD_CONFIG_WORKQUEUE_MULTI_STACKSIZE,
43  uint8_t uiMaxWorkItems = MN_THREAD_CONFIG_WORKQUEUE_MULTI_MAXITEMS,
44  uint8_t uiMaxWorkers = MN_THREAD_CONFIG_WORKQUEUE_MULTI_WORKER);
45 
50 
55  uint8_t get_num_worker() const;
60  uint8_t get_num_max_worker() const;
64  std::vector<work_queue_task*>& workers();
65  protected:
75  int create_engine(int iCore);
76 
80  void destroy_engine();
81 
82  private:
86  std::vector<work_queue_task*> m_Workers;
90  uint8_t m_uiMaxWorkers;
91  };
92 
94  }
95 }
96 
97 #endif
priority
Task priority.
Definition: mn_task.hpp:93
Definition: mn_workqueue_multi.hpp:31
basic_work_queue_multi(basic_task::priority uiPriority=MN_THREAD_CONFIG_WORKQUEUE_MULTI_PRIORITY, uint16_t usStackDepth=MN_THREAD_CONFIG_WORKQUEUE_MULTI_STACKSIZE, uint8_t uiMaxWorkItems=MN_THREAD_CONFIG_WORKQUEUE_MULTI_MAXITEMS, uint8_t uiMaxWorkers=MN_THREAD_CONFIG_WORKQUEUE_MULTI_WORKER)
Definition: mn_workqueue_multi.cpp:26
void destroy_engine()
Definition: mn_workqueue_multi.cpp:85
std::vector< work_queue_task * > & workers()
Definition: mn_workqueue_multi.cpp:110
uint8_t m_uiMaxWorkers
Definition: mn_workqueue_multi.hpp:90
std::vector< work_queue_task * > m_Workers
Definition: mn_workqueue_multi.hpp:86
int create_engine(int iCore)
Definition: mn_workqueue_multi.cpp:51
uint8_t get_num_max_worker() const
Definition: mn_workqueue_multi.cpp:103
uint8_t get_num_worker() const
Definition: mn_workqueue_multi.cpp:96
Definition: mn_workqueue.hpp:40
#define MN_THREAD_CONFIG_WORKQUEUE_MULTI_WORKER
Definition: mn_config.hpp:304
#define MN_THREAD_CONFIG_WORKQUEUE_MULTI_STACKSIZE
Definition: mn_config.hpp:320
#define MN_THREAD_CONFIG_WORKQUEUE_MULTI_MAXITEMS
Definition: mn_config.hpp:312
#define MN_THREAD_CONFIG_WORKQUEUE_MULTI_PRIORITY
Definition: mn_config.hpp:328
basic_queue< T, TMAXITEMS, TITEMSIZE > queue
Definition: container/mn_queue.hpp:239
Definition: mn_allocator_typetraits.hpp:25