arduino-audio-tools
Loading...
Searching...
No Matches
BaseBuffer< T > Class Template Referenceabstract

Shared functionality of all buffers. More...

#include <CodecOpusOgg.h>

Public Member Functions

 BaseBuffer ()=default
 BaseBuffer ()=default
 BaseBuffer (const BaseBuffer &)=default
 BaseBuffer (const BaseBuffer &)=default
virtual ~BaseBuffer ()=default
virtual ~BaseBuffer ()=default
virtual T * address ()=0
 returns the address of the start of the physical read buffer
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 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
virtual int availableForWrite ()=0
 provides the number of entries that are available to write
virtual int bufferCountEmpty ()
 Provides the number of entries that are available to write: -1 does not apply.
virtual int bufferCountEmpty ()
 Provides the number of entries that are available to write: -1 does not apply.
virtual int bufferCountFilled ()
 Provides the number of entries that are available to read: -1 does not apply.
virtual int bufferCountFilled ()
 Provides the number of entries that are available to read: -1 does not apply.
void clear ()
 same as reset
void clear ()
 same as reset
virtual int clearArray (int len)
 Removes the next len entries.
virtual int clearArray (int len)
 Removes the next len entries.
virtual void flush ()
virtual void flush ()
virtual float freePercent ()
 Returns the free space of the buffer in %.
virtual float freePercent ()
 Returns the free space of the buffer in %.
bool isEmpty ()
bool isEmpty ()
virtual bool isFull ()
 checks if the buffer is full
virtual bool isFull ()
 checks if the buffer is full
virtual float levelPercent ()
 Returns the level of the buffer in %.
virtual float levelPercent ()
 Returns the level of the buffer in %.
BaseBuffer & operator= (const BaseBuffer &)=default
BaseBuffer & operator= (const BaseBuffer &)=default
virtual bool peek (T &result)=0
 peeks the actual entry from the buffer
virtual bool peek (T &result)=0
 peeks the actual entry from the buffer
virtual bool read (T &result)=0
 reads a single value
virtual bool read (T &result)=0
 reads a single value
virtual int readArray (T data[], int len)
 reads multiple values
virtual int readArray (T data[], int len)
 reads multiple values
virtual void reset ()=0
 clears the buffer
virtual void reset ()=0
 clears the buffer
virtual bool resize (size_t bytes)
 Resizes the buffer if supported: returns false if not supported.
virtual bool resize (size_t bytes)
 Resizes the buffer if supported: returns false if not supported.
virtual bool resize (size_t size, int count)
 Resize the buffer by indicating the size and count (allocated bytes = size * count).
virtual bool resize (size_t size, int count)
 Resize the buffer by indicating the size and count (allocated bytes = size * count).
virtual size_t size ()=0
virtual size_t size ()=0
virtual bool write (T data)=0
 write add an entry to the buffer
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 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.
virtual int writeArrayOverwrite (const T data[], int len)
 Fills the buffer data and overwrites the oldest data if the buffer is full.

Detailed Description

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

Shared functionality of all buffers.

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ BaseBuffer() [1/4]

template<typename T = uint8_t>
BaseBuffer ( )
default

◆ ~BaseBuffer() [1/2]

template<typename T = uint8_t>
virtual ~BaseBuffer ( )
virtualdefault

◆ BaseBuffer() [2/4]

template<typename T = uint8_t>
BaseBuffer ( const BaseBuffer< T > & )
default

◆ BaseBuffer() [3/4]

template<typename T = uint8_t>
BaseBuffer ( )
default

◆ ~BaseBuffer() [2/2]

template<typename T = uint8_t>
virtual ~BaseBuffer ( )
virtualdefault

◆ BaseBuffer() [4/4]

template<typename T = uint8_t>
BaseBuffer ( const BaseBuffer< T > & )
default

Member Function Documentation

◆ address() [1/2]

◆ address() [2/2]

template<typename T = uint8_t>
virtual T * address ( )
pure virtual

returns the address of the start of the physical read buffer

◆ available() [1/2]

◆ available() [2/2]

template<typename T = uint8_t>
virtual int available ( )
pure virtual

provides the number of entries that are available to read

◆ availableForWrite() [1/2]

◆ availableForWrite() [2/2]

template<typename T = uint8_t>
virtual int availableForWrite ( )
pure virtual

provides the number of entries that are available to write

◆ bufferCountEmpty() [1/2]

template<typename T = uint8_t>
virtual int bufferCountEmpty ( )
inlinevirtual

◆ bufferCountEmpty() [2/2]

template<typename T = uint8_t>
virtual int bufferCountEmpty ( )
inlinevirtual

Provides the number of entries that are available to write: -1 does not apply.

◆ bufferCountFilled() [1/2]

template<typename T = uint8_t>
virtual int bufferCountFilled ( )
inlinevirtual

◆ bufferCountFilled() [2/2]

template<typename T = uint8_t>
virtual int bufferCountFilled ( )
inlinevirtual

Provides the number of entries that are available to read: -1 does not apply.

◆ clear() [1/2]

template<typename T = uint8_t>
void clear ( )
inline

same as reset

◆ clear() [2/2]

template<typename T = uint8_t>
void clear ( )
inline

same as reset

◆ clearArray() [1/2]

template<typename T = uint8_t>
virtual int clearArray ( int len)
inlinevirtual

◆ clearArray() [2/2]

template<typename T = uint8_t>
virtual int clearArray ( int len)
inlinevirtual

Removes the next len entries.

◆ flush() [1/2]

template<typename T = uint8_t>
virtual void flush ( )
inlinevirtual

Submit any partially-filled write buffer so the reader can access it. Only meaningful for NBuffer-style block pools; no-op for ring buffers.

Reimplemented in NBuffer< T >, NBuffer< T >, NBuffer< Frame >, NBuffer< T >, NBuffer< uint8_t >, and NBuffer< T >.

◆ flush() [2/2]

template<typename T = uint8_t>
virtual void flush ( )
inlinevirtual

Submit any partially-filled write buffer so the reader can access it. Only meaningful for NBuffer-style block pools; no-op for ring buffers.

◆ freePercent() [1/2]

template<typename T = uint8_t>
virtual float freePercent ( )
inlinevirtual

Returns the free space of the buffer in %.

◆ freePercent() [2/2]

template<typename T = uint8_t>
virtual float freePercent ( )
inlinevirtual

Returns the free space of the buffer in %.

◆ isEmpty() [1/2]

template<typename T = uint8_t>
bool isEmpty ( )
inline

◆ isEmpty() [2/2]

template<typename T = uint8_t>
bool isEmpty ( )
inline

◆ isFull() [1/2]

◆ isFull() [2/2]

template<typename T = uint8_t>
virtual bool isFull ( )
inlinevirtual

checks if the buffer is full

◆ levelPercent() [1/2]

template<typename T = uint8_t>
virtual float levelPercent ( )
inlinevirtual

Returns the level of the buffer in %.

Reimplemented in AdaptiveResamplingBuffer.

◆ levelPercent() [2/2]

template<typename T = uint8_t>
virtual float levelPercent ( )
inlinevirtual

Returns the level of the buffer in %.

◆ operator=() [1/2]

template<typename T = uint8_t>
BaseBuffer & operator= ( const BaseBuffer< T > & )
default

◆ operator=() [2/2]

template<typename T = uint8_t>
BaseBuffer & operator= ( const BaseBuffer< T > & )
default

◆ peek() [1/2]

◆ peek() [2/2]

template<typename T = uint8_t>
virtual bool peek ( T & result)
pure virtual

peeks the actual entry from the buffer

◆ read() [1/2]

◆ read() [2/2]

template<typename T = uint8_t>
virtual bool read ( T & result)
pure virtual

reads a single value

◆ readArray() [1/2]

◆ readArray() [2/2]

template<typename T = uint8_t>
virtual int readArray ( T data[],
int len )
inlinevirtual

reads multiple values

◆ reset() [1/2]

◆ reset() [2/2]

template<typename T = uint8_t>
virtual void reset ( )
pure virtual

clears the buffer

◆ resize() [1/4]

◆ resize() [2/4]

template<typename T = uint8_t>
virtual bool resize ( size_t bytes)
inlinevirtual

Resizes the buffer if supported: returns false if not supported.

◆ resize() [3/4]

template<typename T = uint8_t>
virtual bool resize ( size_t size,
int count )
inlinevirtual

Resize the buffer by indicating the size and count (allocated bytes = size * count).

◆ resize() [4/4]

template<typename T = uint8_t>
virtual bool resize ( size_t size,
int count )
inlinevirtual

Resize the buffer by indicating the size and count (allocated bytes = size * count).

◆ size() [1/2]

◆ size() [2/2]

template<typename T = uint8_t>
virtual size_t size ( )
pure virtual

◆ write() [1/2]

◆ write() [2/2]

template<typename T = uint8_t>
virtual bool write ( T data)
pure virtual

write add an entry to the buffer

◆ writeArray() [1/2]

◆ writeArray() [2/2]

template<typename T = uint8_t>
virtual int writeArray ( const T data[],
int len )
inlinevirtual

Fills the buffer data.

◆ writeArrayOverwrite() [1/2]

template<typename T = uint8_t>
virtual int writeArrayOverwrite ( const T data[],
int len )
inlinevirtual

Fills the buffer data and overwrites the oldest data if the buffer is full.

◆ writeArrayOverwrite() [2/2]

template<typename T = uint8_t>
virtual int writeArrayOverwrite ( const T data[],
int len )
inlinevirtual

Fills the buffer data and overwrites the oldest data if the buffer is full.


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