Class that is implementing a circular buffer (for queue functionality).
More...
#include <CircularBuffer.h>
|
uint8_t | empty () |
| Check if the circular buffer is empty.
|
|
uint8_t | full () |
| Check if the circular buffer is full.
|
|
void | enqueue (T *data) |
| Enqueue the data at the given pointer into the queue.
|
|
T * | dequeue () |
| Dequeue data from the queue and return a pointer to the data dequeue() should never be called on an empty queue.
|
|
|
T | queue [MaxElements] |
| Array holding the circular buffer data.
|
|
volatile uint16_t | head |
| Head index of the circular buffer.
|
|
volatile uint16_t | tail |
| Tail index of the circular buffer.
|
|
template<class T, size_t MaxElements>
class CircularBuffer< T, MaxElements >
Class that is implementing a circular buffer (for queue functionality).
- Template Parameters
-
T | Type of the buffer elements |
MaxElements | Maximum number of elements the buffer can hold |
◆ dequeue()
template<class T, size_t MaxElements>
Dequeue data from the queue and return a pointer to the data dequeue() should never be called on an empty queue.
- Returns
- Pointer to the data element in the queue.
◆ empty()
template<class T, size_t MaxElements>
Check if the circular buffer is empty.
- Returns
- Returns 1 if the queue is empty, 0 otherwise
◆ enqueue()
template<class T, size_t MaxElements>
Enqueue the data at the given pointer into the queue.
enqueue() should never be called on a full queue.
- Parameters
-
data | Pointer to the data that is enqueued. |
◆ full()
template<class T, size_t MaxElements>
Check if the circular buffer is full.
- Returns
- Returns 1 if the queue is full, 0 otherwise
The documentation for this class was generated from the following file: