#include <mn_workqueue.hpp>
This abstract class is the base "engine" class for all work_queues. basic_work_queue pull work_queue_item off of a FIFO queue and run them sequentially.
This is an abstract base class. To use this, you need to subclass it. All of your basic_work_queue should be derived from the basic_work_queue class. Then implement the virtual create_engine and destroy_engine functions.
◆ basic_work_queue()
mn::queue::basic_work_queue::basic_work_queue |
( |
basic_task::priority |
uiPriority, |
|
|
uint16_t |
usStackDepth, |
|
|
uint8_t |
uiMaxWorkItems |
|
) |
| |
Our constructor.
- Parameters
-
Name | Name of the task internal to the WorkQueue. |
uiPriority | FreeRTOS priority of this WorkQueue task. |
usStackDepth | Number of "words" allocated for the WorkQueue task stack. |
◆ ~basic_work_queue()
mn::queue::basic_work_queue::~basic_work_queue |
( |
| ) |
|
|
virtual |
◆ create()
Create and start the work queue engine
- Returns
- 'ERR_WORKQUEUE_OK' The workqueue are created, 'ERR_WORKQUEUE_ALREADYINIT' the workqueue was allready created, 'ERR_WORKQUEUE_CANTCREATE' error to create the workqueue and 'ERR_WORKQUEUE_WARNING' not all threads are created in the multi engine workqueue
- Note
- call internal on_create, for your real engine creating
◆ create_engine()
virtual int mn::queue::basic_work_queue::create_engine |
( |
int |
iCore | ) |
|
|
protectedpure virtual |
◆ destroy()
void mn::queue::basic_work_queue::destroy |
( |
| ) |
|
|
virtual |
Destroy and set the running flag to false
- Note
- call internal on_destroy, for your real engine creating
◆ destroy_engine()
virtual void mn::queue::basic_work_queue::destroy_engine |
( |
| ) |
|
|
protectedpure virtual |
◆ get_next_item()
work_queue_item * mn::queue::basic_work_queue::get_next_item |
( |
unsigned int |
timeout | ) |
|
|
protectedvirtual |
Get the next item / job from queue
- Parameters
-
timeout | How long to wait to get an item / job from the queue. |
- Returns
- The next item / job from list and NULL when list empty or timeout
◆ get_num_items_error()
uint8_t mn::queue::basic_work_queue::get_num_items_error |
( |
| ) |
|
How many items/jobs are not sucessfull worked
◆ get_num_items_worked()
uint8_t mn::queue::basic_work_queue::get_num_items_worked |
( |
| ) |
|
How many items / jobs are sucessfull worked
◆ is_ready()
bool mn::queue::basic_work_queue::is_ready |
( |
| ) |
|
Is the workqueue ready, all jobs/items are worked?
- Returns
- true If workqueue is ready, false If not
◆ queue()
Send a work_queue_item_t off to be executed.
- Parameters
-
work | Pointer to a work_queue_item_t. |
- Note
- This function may block if the basic_work_queue is presently full.
- Returns
- ERR_WORKQUEUE_OK The work_queue_item_t are added
- ERR_WORKQUEUE_ADD If The work_queue_item_t are not added
◆ running()
volatile bool& mn::queue::basic_work_queue::running |
( |
| ) |
|
|
inline |
Is the workqueue running?
- Returns
- true If the workqueue running, false If not
◆ work_queue_task
◆ m_bRunning
volatile bool mn::queue::basic_work_queue::m_bRunning |
|
protected |
Flag whether or not the workqueue was started.
◆ m_pWorkItemQueue
queue_t* mn::queue::basic_work_queue::m_pWorkItemQueue |
|
protected |
The job queue for all workqueues
◆ m_ThreadJob
mutex_t mn::queue::basic_work_queue::m_ThreadJob |
|
protected |
Lock Objekt for thread safty Mutex lock for the job queue
◆ m_ThreadStatus
mutex_t mn::queue::basic_work_queue::m_ThreadStatus |
|
protected |
Lock Objekt for thread safty Mutex lock for status and flags changes
◆ m_uiErrorsNumWorks
volatile uint8_t mn::queue::basic_work_queue::m_uiErrorsNumWorks |
|
protected |
Holder of num works are not successfull run
◆ m_uiMaxWorkItems
uint8_t mn::queue::basic_work_queue::m_uiMaxWorkItems |
|
protected |
◆ m_uiNumWorks
volatile uint8_t mn::queue::basic_work_queue::m_uiNumWorks |
|
protected |
Holder of num works are successfull run
◆ m_uiPriority
◆ m_usStackDepth
uint16_t mn::queue::basic_work_queue::m_usStackDepth |
|
protected |
The documentation for this class was generated from the following files: