A lock-free RingBuffer. More...
#include <RingBuffer.hpp>
Inherited by Raul::EventRingBuffer [private]
.
Public Member Functions | |
RingBuffer (uint32_t size) | |
void | reset () |
Reset(empty) the ringbuffer. | |
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). | |
bool | full_peek (uint32_t size, void *dst) |
uint32_t | read (uint32_t size, void *dst) |
Read from the ringbuffer. | |
bool | full_read (uint32_t size, void *dst) |
bool | skip (uint32_t size) |
void | write (uint32_t size, const void *src) |
Protected Attributes | |
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.
Raul::RingBuffer::RingBuffer | ( | uint32_t | size | ) | [inline, explicit] |
size | Size in bytes. |
References reset().
void Raul::RingBuffer::reset | ( | ) | [inline] |
uint32_t Raul::RingBuffer::peek | ( | uint32_t | size, | |
void * | dst | |||
) | [inline] |
uint32_t Raul::RingBuffer::read | ( | uint32_t | size, | |
void * | dst | |||
) | [inline] |