VCV Rack API v2
|
A cyclic buffer which maintains a valid linear array of size S by keeping a copy of the buffer in adjacent memory. More...
#include <ringbuffer.hpp>
Public Member Functions | |
void | push (T t) |
T | shift () |
void | clear () |
bool | empty () const |
bool | full () const |
size_t | size () const |
size_t | capacity () const |
T * | endData () |
Returns a pointer to S consecutive elements for appending. | |
void | endIncr (size_t n) |
const T * | startData () const |
Returns a pointer to S consecutive elements for consumption If any data is consumed, call startIncr afterwards. | |
void | startIncr (size_t n) |
Public Attributes | |
std::atomic< size_t > | start {0} |
std::atomic< size_t > | end {0} |
T | data [2 *S] |
A cyclic buffer which maintains a valid linear array of size S by keeping a copy of the buffer in adjacent memory.
This is not thread-safe.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns a pointer to S consecutive elements for appending.
If any data is appended, you must call endIncr afterwards. Pointer is invalidated when any other method is called.
|
inline |
|
inline |
Returns a pointer to S consecutive elements for consumption If any data is consumed, call startIncr afterwards.
|
inline |
std::atomic<size_t> rack::dsp::DoubleRingBuffer< T, S >::start {0} |
std::atomic<size_t> rack::dsp::DoubleRingBuffer< T, S >::end {0} |
T rack::dsp::DoubleRingBuffer< T, S >::data[2 *S] |