Components/Libraries/XF/FreeRTOS/Queue
Sara.chalokh (Talk | contribs) (→bool push(void* opEl, timeSize oTimeToWait)) |
Sara.chalokh (Talk | contribs) (→bool pushCopy(void* opEl, TickType_t oTimeToWait)) |
||
Line 45: | Line 45: | ||
== bool pushCopy(void* opEl, TickType_t oTimeToWait) == | == bool pushCopy(void* opEl, TickType_t oTimeToWait) == | ||
+ | === Description === | ||
+ | Add a copy of the element to the queue. | ||
+ | |||
+ | IMPORTANT do not use this function if elements to add are pointers. | ||
+ | === Parameters === | ||
+ | opEl : a pointer to the element to add | ||
+ | oTimeToWait : maximal amount of time (in ms) that thread should wait if queue is full | ||
+ | === Return === | ||
+ | Return true if a copy of the element has been pushed successfully in the Queue | ||
+ | |||
== bool pushFromISR(void* opEl) == | == bool pushFromISR(void* opEl) == | ||
== bool pushCopyFromISR(void* opEl) == | == bool pushCopyFromISR(void* opEl) == |
Revision as of 13:28, 10 August 2017
Queue
The class Queue is a C++ interface that manage a FreeRTOS queue.
Member Attibuts
Queue()
Description
The constructor of the queue. It will create an uninitialized FreeRTOS queue. It mean that the queue is created but could not be used. Call initQueue to initialize it.
Parameters
oSizeofObject : the size of the element that must be contained by the Queue
Queue(baseUInt oSizeofObject)
Description
The constructor of the queue. It will create a free RTOS queue and initialize it for the given object size.
Parameters
oSizeofObject : the size of the element that must be contained by the Queue
~Queue()
Description
The destructor of the Queue. It will delete the free RTOS queue.
Not that if the queue contains pointer, the objects must be deleted manually
bool initQueue(baseUInt oSizeofObject)
Description
Initialize the queue for the given size of object
Parameters
oSizeofObject : the size of the element that must be contained by the queue
Return
Return true if the Queue has been initialized correctly, else false
bool push(void* opEl, timeSize oTimeToWait)
Description
Add an element to the queue.
This will just push a pointer to the element and not a copy. see pushCopy if you want to add a copy of the element
Parameters
opEl : a pointer to the element to add oTimeToWait : maximal amount of time (in ms) that thread should wait if queue is full
Return
Return true if the element has been pushed successfully, else false.
bool pushCopy(void* opEl, TickType_t oTimeToWait)
Description
Add a copy of the element to the queue.
IMPORTANT do not use this function if elements to add are pointers.
Parameters
opEl : a pointer to the element to add oTimeToWait : maximal amount of time (in ms) that thread should wait if queue is full
Return
Return true if a copy of the element has been pushed successfully in the Queue