CircularBuffer_

Provides a growing container. It will overwrite the oldest entries as soon as the maxLength is reached.

Members

Functions

get
T* get(size_t offset)

Returns the offset-newest element. Defaults to 0 (the newest)

push
void push(T element)

Pushes an element on the Cache. If maxLength isn't reached, resizes the cache. If it is reached, overwrites the oldest element

Variables

elements
T[] elements;

growing array of elements

maxLength
size_t maxLength;

maximum allowed size of the array

write
size_t write;

current write position

Meta