arduino-audio-tools
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
BaseBuffer< T > Class Template Referenceabstract

Shared functionality of all buffers. More...

#include <Buffers.h>

Inheritance diagram for BaseBuffer< T >:
NBuffer< Frame > RingBuffer< int16_t > RingBuffer< Sample > RingBuffer< int32_t > RingBuffer< uint16_t > SingleBuffer< int16_t > VariableSpeedRingBuffer< int16_t > BufferRTOS< T > NBuffer< T > RingBuffer< T > RingBufferFile< File, T > SingleBuffer< T > SynchronizedBuffer< T > VariableSpeedRingBuffer< T > VariableSpeedRingBuffer180< T > VariableSpeedRingBufferSimple< T >

Public Member Functions

 BaseBuffer (BaseBuffer const &)=delete
 
virtual T * address ()=0
 returns the address of the start of the physical read buffer
 
virtual int available ()=0
 provides the number of entries that are available to read
 
virtual int availableForWrite ()=0
 provides the number of entries that are available to write
 
void clear ()
 same as reset
 
virtual int clearArray (int len)
 Removes the next len entries.
 
bool isEmpty ()
 
virtual bool isFull ()=0
 checks if the buffer is full
 
virtual float levelPercent ()
 Returns the level of the buffer in %.
 
virtual T peek ()=0
 peeks the actual entry from the buffer
 
virtual T read ()=0
 reads a single value
 
virtual int readArray (T data[], int len)
 reads multiple values
 
int readFrames (T data[][2], int len)
 reads multiple values for array of 2 dimensional frames
 
template<int rows, int channels>
int readFrames (T(&data)[rows][channels])
 
virtual void reset ()=0
 clears the buffer
 
virtual size_t size ()=0
 
virtual bool write (T data)=0
 write add an entry to the buffer
 
virtual int writeArray (const T data[], int len)
 Fills the buffer data.
 
virtual int writeArrayOverwrite (const T data[], int len)
 Fills the buffer data and overwrites the oldest data if the buffer is full.
 

Protected Member Functions

void setWritePos (int pos)
 

Protected Attributes

friend NBuffer< T >
 

Detailed Description

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

Shared functionality of all buffers.

Author
Phil Schatzmann

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