#include <RingBuffer.hpp>
Inherited by Raul::StampedChunkRingBuffer [private]
.
Public Member Functions | ||||
RingBuffer (size_t size) | ||||
| ||||
void | reset () | |||
Reset(empty) the ringbuffer. | ||||
size_t | write_space () const | |||
size_t | read_space () const | |||
size_t | capacity () const | |||
size_t | read (size_t size, T *dst) | |||
Read from the ringbuffer. | ||||
void | write (size_t size, const T *src) | |||
bool | full_read (size_t size, T *dst) | |||
Protected Attributes | ||||
gint | _write_ptr | |||
gint | _read_ptr | |||
size_t | _size | |||
Size (capacity) in bytes. | ||||
T * | _buf | |||
size, event, size, event... |
Read/Write realtime safe. Single-reader Single-writer thread safe.
void Raul::RingBuffer< T >::reset | ( | ) | [inline] |
Reset(empty) the ringbuffer.
NOT thread safe.
size_t Raul::RingBuffer< T >::read | ( | size_t | size, | |
T * | dst | |||
) |
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.