NMEA2000 Library
0.1
Library to handle NMEA 2000 Communication written in C++
|
Simple tRingBuffer and tPriorityRingBuffer template classes. More...
#include <cstdint>
#include "RingBuffer.tpp"
Go to the source code of this file.
Classes | |
class | tPriorityRingBuffer< T > |
Template Class that holds values with given priorities in a ring buffer. More... | |
struct | tPriorityRingBuffer< T >::tPriorityRef |
Structure handles meta data for each priority. More... | |
struct | tPriorityRingBuffer< T >::tValueSlot |
Structure that holds the actual value and meta data. More... | |
class | tRingBuffer< T > |
Template Class that holds values in a ring buffer. More... | |
Macros | |
#define | INVALID_PRIORITY_REF (uint8_t)(-1) |
Constant for an invalid priority reference. More... | |
#define | INVALID_RING_REF (uint16_t)(-1) |
Constant for an invalid index reference for the buffer. More... | |
Simple tRingBuffer and tPriorityRingBuffer template classes.
With tRingBuffer one can save values to a ring buffer. Value can be simple value or data structure.
As an alternative if you want to avoid data copying twice, you can request pointer to next value to be saved and copy data directly to it.
tPriorityRingBuffer is similar as tRingBuffer, but it extends functionality with value priority. When you add values to buffer, you can give them priority and when during read you can define which priority value should be read out or read highest priority value.
To improve the debugging of the module there is the possibility to enable some print out to the DebugStream
Definition in file RingBuffer.h.
#define INVALID_PRIORITY_REF (uint8_t)(-1) |
Constant for an invalid priority reference.
Definition at line 260 of file RingBuffer.h.
#define INVALID_RING_REF (uint16_t)(-1) |
Constant for an invalid index reference for the buffer.
Definition at line 258 of file RingBuffer.h.