|
|
| BlockRingBuffer (int capacity) |
| | Creates a new buffer with given capacity. |
| |
|
| BlockRingBuffer (const BlockRingBuffer &o) |
| | Copies the object, not thread-safe. |
| |
| void | consume (int count) |
| | Consumes exactly count elements from the buffer. More... |
| |
|
BlockRingBuffer & | operator= (const BlockRingBuffer &o) |
| | Copies the object, not thread-safe. |
| |
| void | produce (int count) |
| | Consumes exactly count elements from the buffer. More... |
| |
| int | read (T *output, int count) |
| | Consumes max count elements from the buffer and writes them to output. More... |
| |
|
Reader | read (int count) |
| | Returns a reader object that has continuous memory segment up to count bytes, but it can be less if there isn't enough continuous data available. |
| |
|
int | size () const |
| | Returns the number of elements in the buffer. Can be called from all threads. |
| |
| int | write (const T *input, int count) |
| | Write up to count elements from data to the buffer. More... |
| |
|
Writer | write (int count) |
| |
template<typename T>
class Radiant::BlockRingBuffer< T >
Lock-free and thread-safe ring buffer with one producer and one consumer.
The API is optimized for storing bigger blocks (like float arrays) to the buffer, but it works with all elements that can be copied and default-constructed.