|
ESPHome 2026.3.0
|
Fixed-size circular buffer with FIFO semantics and iteration support. More...
#include <helpers.h>
Data Structures | |
| class | ConstIterator |
| class | Iterator |
Public Member Functions | |
| bool | push (const T &value) |
| void | pop () |
| T & | front () |
| const T & | front () const |
| index_type | size () const |
| bool | empty () const |
| Iterator | begin () |
| Iterator | end () |
| ConstIterator | begin () const |
| ConstIterator | end () const |
Protected Attributes | |
| T | data_ [N] |
| index_type | head_ {0} |
| index_type | tail_ {0} |
| index_type | count_ {0} |
Fixed-size circular buffer with FIFO semantics and iteration support.
A tiny ring buffer that avoids dynamic allocations from std::deque/std::queue (which can be wasteful on MCUs), while supporting iteration over queued elements.
Not thread-safe. All access (push/pop/iteration) must occur from a single context, or the caller must provide external synchronization.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |