A lock-free RingBuffer.
More...
#include <RingBuffer.hpp>
|
| RingBuffer (uint32_t size) |
|
void | reset () |
| Reset(empty) the ringbuffer. More...
|
|
uint32_t | write_space () const |
|
uint32_t | read_space () const |
|
uint32_t | capacity () const |
|
uint32_t | peek (uint32_t size, void *dst) |
| Peek at the ringbuffer (read w/o advancing read pointer). More...
|
|
bool | full_peek (uint32_t size, void *dst) |
|
uint32_t | read (uint32_t size, void *dst) |
| Read from the ringbuffer. More...
|
|
bool | full_read (uint32_t size, void *dst) |
|
bool | skip (uint32_t size) |
|
void | write (uint32_t size, const void *src) |
|
|
uint32_t | _write_ptr |
|
uint32_t | _read_ptr |
|
char *const | _buf |
| Contents.
|
|
const uint32_t | _size |
| Size (capacity) in bytes.
|
|
A lock-free RingBuffer.
Read/Write realtime safe. Single-reader Single-writer thread safe.
◆ RingBuffer()
Raul::RingBuffer::RingBuffer |
( |
uint32_t |
size | ) |
|
|
inlineexplicit |
◆ reset()
void Raul::RingBuffer::reset |
( |
| ) |
|
|
inline |
Reset(empty) the ringbuffer.
NOT thread safe.
Referenced by RingBuffer().
◆ peek()
uint32_t Raul::RingBuffer::peek |
( |
uint32_t |
size, |
|
|
void * |
dst |
|
) |
| |
|
inline |
Peek at the ringbuffer (read w/o advancing read pointer).
Note that a full read may not be done if the data wraps around. Caller must check return value and call again if necessary, or use the full_peek method which does this automatically.
References _buf, and _size.
◆ read()
uint32_t Raul::RingBuffer::read |
( |
uint32_t |
size, |
|
|
void * |
dst |
|
) |
| |
|
inline |
Read from the ringbuffer.
Note that a full read may not be done if the data wraps around. Caller must check return value and call again if necessary, or use the full_read method which does this automatically.
References _buf, and _size.
The documentation for this class was generated from the following file: