Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
RingBuffer Class Reference

This class is a simple ring buffer in RAM which is 32 Byte aligned and provides functionality for concurrent reading and writting without locks. More...

#include <RingBuffer.h>

Public Member Functions

 RingBuffer (int size=0)
 Creates a new ring buffer.
 
sample_tgetBuffer () const
 Returns the pointer to the ring buffer in memory.
 
int getSize () const
 Returns the size of the ring buffer in bytes.
 
size_t getReadSize () const
 
size_t getWriteSize () const
 
size_t read (data_t *target, size_t size)
 
size_t write (data_t *source, size_t size)
 
void clear ()
 
void reset ()
 Resets the ring buffer to a state where nothing has been written or read.
 
void resize (int size)
 Resizes the ring buffer.
 
void assureSize (int size)
 Makes sure the ring buffer has a minimum size.
 

Detailed Description

This class is a simple ring buffer in RAM which is 32 Byte aligned and provides functionality for concurrent reading and writting without locks.

Constructor & Destructor Documentation

◆ RingBuffer()

RingBuffer::RingBuffer ( int size = 0)

Creates a new ring buffer.

Parameters
sizeThe size of the buffer in bytes.

Member Function Documentation

◆ assureSize()

void RingBuffer::assureSize ( int size)

Makes sure the ring buffer has a minimum size.

If size is >= current size, nothing will happen. Otherwise the ring buffer is resized with keep as parameter.

Parameters
sizeThe new minimum size of the ring buffer, measured in bytes.

◆ resize()

void RingBuffer::resize ( int size)

Resizes the ring buffer.

Parameters
sizeThe new size of the ring buffer, measured in bytes.

The documentation for this class was generated from the following file: