Template class which implements static queue as ring buffer.
More...
#include <erpc_static_queue.hpp>
template<class T, uint32_t elementCount>
class erpc::StaticQueue< T, elementCount >
Template class which implements static queue as ring buffer.
template<class T, uint32_t elementCount>
Constructor of StaticQueue class.
This function sets capacity of queue, m_head and m_tail indexes to zero.
template<class T, uint32_t elementCount>
Destructor of StaticQueue class.
This function free allocated buffer for m_data.
template<class T, uint32_t elementCount>
This function adds element to queue.
- Parameters
-
[in] | element | Element for adding. |
- Return values
-
true | Element was added. |
false | Element was not added, queue is full. |
template<class T, uint32_t elementCount>
This function returns element from queue.
- Parameters
-
[out] | element | Pointer to element to which will be copied element from queue. |
- Return values
-
true | Element was copied from queue. |
false | Element was not copied, queue is empty. |
template<class T, uint32_t elementCount>
This function returns number of elements in queue.
- Returns
- Number of elements in queue.
template<class T, uint32_t elementCount>
uint64_t erpc::StaticQueue< T, elementCount >::m_storage[elementCount][(sizeof(T)+sizeof(uint64_t)-1U)/sizeof(uint64_t)] |
|
protected |
Preallocated space based on data type size and elements count.
template<class T, uint32_t elementCount>
template<class T, uint32_t elementCount>
template<class T, uint32_t elementCount>
Index to slot with m_data
The documentation for this class was generated from the following file: