Shared functionality of all buffers.
More...
#include <Buffers.h>
|
| | BaseBuffer ()=default |
| | BaseBuffer (const BaseBuffer &)=default |
| virtual | ~BaseBuffer ()=default |
| 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
|
| 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.
|
| void | clear () |
| | same as reset
|
| virtual int | clearArray (int len) |
| | Removes the next len entries.
|
| virtual void | flush () |
| virtual float | freePercent () |
| | Returns the free space of the buffer in %.
|
| bool | isEmpty () |
| virtual bool | isFull () |
| | checks if the buffer is full
|
| virtual float | levelPercent () |
| | Returns the level of the buffer in %.
|
| BaseBuffer & | operator= (const BaseBuffer &)=default |
| virtual bool | peek (T &result)=0 |
| | peeks the actual entry from the buffer
|
| virtual bool | read (T &result)=0 |
| | reads a single value
|
| virtual int | readArray (T data[], int len) |
| | reads multiple values
|
| 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 size, int count) |
| | Resize the buffer by indicating the size and count (allocated bytes = size * count).
|
| 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.
|
template<typename T = uint8_t>
class audio_tools::BaseBuffer< T >
Shared functionality of all buffers.
- Author
- Phil Schatzmann
- Copyright
- GPLv3
◆ BaseBuffer() [1/2]
template<typename T = uint8_t>
◆ ~BaseBuffer()
template<typename T = uint8_t>
◆ BaseBuffer() [2/2]
template<typename T = uint8_t>
| BaseBuffer |
( |
const BaseBuffer< T > & | | ) |
|
|
default |
◆ address()
template<typename T = uint8_t>
returns the address of the start of the physical read buffer
◆ available()
template<typename T = uint8_t>
| virtual int available |
( |
| ) |
|
|
pure virtual |
provides the number of entries that are available to read
◆ availableForWrite()
template<typename T = uint8_t>
| virtual int availableForWrite |
( |
| ) |
|
|
pure virtual |
provides the number of entries that are available to write
◆ bufferCountEmpty()
template<typename T = uint8_t>
| virtual int bufferCountEmpty |
( |
| ) |
|
|
inlinevirtual |
Provides the number of entries that are available to write: -1 does not apply.
◆ bufferCountFilled()
template<typename T = uint8_t>
| virtual int bufferCountFilled |
( |
| ) |
|
|
inlinevirtual |
Provides the number of entries that are available to read: -1 does not apply.
◆ clear()
template<typename T = uint8_t>
◆ clearArray()
template<typename T = uint8_t>
| virtual int clearArray |
( |
int | len | ) |
|
|
inlinevirtual |
Removes the next len entries.
◆ flush()
template<typename T = uint8_t>
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()
template<typename T = uint8_t>
| virtual float freePercent |
( |
| ) |
|
|
inlinevirtual |
Returns the free space of the buffer in %.
◆ isEmpty()
template<typename T = uint8_t>
◆ isFull()
template<typename T = uint8_t>
checks if the buffer is full
◆ levelPercent()
template<typename T = uint8_t>
| virtual float levelPercent |
( |
| ) |
|
|
inlinevirtual |
Returns the level of the buffer in %.
◆ operator=()
template<typename T = uint8_t>
◆ peek()
template<typename T = uint8_t>
| virtual bool peek |
( |
T & | result | ) |
|
|
pure virtual |
peeks the actual entry from the buffer
◆ read()
template<typename T = uint8_t>
| virtual bool read |
( |
T & | result | ) |
|
|
pure virtual |
◆ readArray()
template<typename T = uint8_t>
| virtual int readArray |
( |
T | data[], |
|
|
int | len ) |
|
inlinevirtual |
◆ reset()
template<typename T = uint8_t>
◆ resize() [1/2]
template<typename T = uint8_t>
| virtual bool resize |
( |
size_t | bytes | ) |
|
|
inlinevirtual |
Resizes the buffer if supported: returns false if not supported.
◆ resize() [2/2]
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()
template<typename T = uint8_t>
◆ write()
template<typename T = uint8_t>
| virtual bool write |
( |
T | data | ) |
|
|
pure virtual |
write add an entry to the buffer
◆ writeArray()
template<typename T = uint8_t>
| virtual int writeArray |
( |
const T | data[], |
|
|
int | len ) |
|
inlinevirtual |
◆ writeArrayOverwrite()
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 file: