arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
audio_tools::RingBuffer< T > Class Template Reference

Implements a typed Ringbuffer. More...

#include <Buffers.h>

Inheritance diagram for audio_tools::RingBuffer< T >:
audio_tools::BaseBuffer< T >

Public Member Functions

 RingBuffer (int size)
 
virtual T * address ()
 
virtual int available ()
 
virtual int availableForWrite ()
 
bool isEmpty ()
 
virtual bool isFull ()
 
virtual T peek ()
 
virtual T read ()
 
virtual void reset ()
 
virtual void resize (int len)
 
virtual int size ()
 Returns the maximum capacity of the buffer.
 
virtual bool write (T data)
 
- Public Member Functions inherited from audio_tools::BaseBuffer< T >
 BaseBuffer (BaseBuffer const &)=delete
 
virtual T * address ()=0
 
virtual int available ()=0
 
virtual int availableForWrite ()=0
 
bool isEmpty ()
 
virtual bool isFull ()=0
 
BaseBufferoperator= (BaseBuffer const &)=delete
 
virtual T peek ()=0
 
virtual T read ()=0
 
int readArray (T data[], int len)
 
int readFrames (T data[][2], int len)
 
template<int rows, int channels>
int readFrames (T(&data)[rows][channels])
 
virtual void reset ()=0
 
virtual bool write (T data)=0
 
int writeArray (const T data[], int len)
 

Protected Member Functions

int nextIndex (int index)
 
- Protected Member Functions inherited from audio_tools::BaseBuffer< T >
void setWritePos (int pos)
 

Protected Attributes

T * _aucBuffer = nullptr
 
int _iHead
 
int _iTail
 
int _numElems
 
int max_size = 0
 
- Protected Attributes inherited from audio_tools::BaseBuffer< T >
friend NBuffer< T >
 

Detailed Description

template<typename T>
class audio_tools::RingBuffer< T >

Implements a typed Ringbuffer.

Template Parameters
T

Member Function Documentation

◆ address()

template<typename T >
virtual T * audio_tools::RingBuffer< T >::address ( )
inlinevirtual

◆ available()

template<typename T >
virtual int audio_tools::RingBuffer< T >::available ( )
inlinevirtual

◆ availableForWrite()

template<typename T >
virtual int audio_tools::RingBuffer< T >::availableForWrite ( )
inlinevirtual

◆ isFull()

template<typename T >
virtual bool audio_tools::RingBuffer< T >::isFull ( )
inlinevirtual

◆ peek()

template<typename T >
virtual T audio_tools::RingBuffer< T >::peek ( )
inlinevirtual

◆ read()

template<typename T >
virtual T audio_tools::RingBuffer< T >::read ( )
inlinevirtual

◆ reset()

template<typename T >
virtual void audio_tools::RingBuffer< T >::reset ( )
inlinevirtual

◆ write()

template<typename T >
virtual bool audio_tools::RingBuffer< T >::write ( data)
inlinevirtual

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