NBuffer which uses some RTOS queues to manage the available and filled buffers.
More...
#include <SynchronizedNBufferRTOS.h>
|
| SynchronizedNBufferRTOST (int bufferSize, int bufferCount, int writeMaxWait=portMAX_DELAY, int readMaxWait=portMAX_DELAY) |
|
T * | address () |
| returns the address of the start of the phsical read buffer
|
|
int | available () |
| determines the available entries for the current read buffer
|
|
int | availableForWrite () |
| determines the available entries for the write buffer
|
|
int | bufferCountEmpty () |
| Provides the number of entries that are available to write.
|
|
int | bufferCountFilled () |
| Provides the number of entries that are available to read.
|
|
void | clear () |
| same as reset
|
|
virtual int | clearArray (int len) |
| Removes the next len entries.
|
|
bool | isEmpty () |
|
bool | isFull () |
| checks if the buffer is full
|
|
virtual float | levelPercent () |
| Returns the level of the buffer in %.
|
|
bool | peek (T &result) override |
| peeks the actual entry from the buffer
|
|
bool | read (T &result) override |
| reads an entry from the buffer
|
|
virtual int | readArray (T data[], int len) |
| reads multiple values
|
|
void | reset () |
| resets all buffers
|
|
void | resize (int bufferSize, int bufferCount) |
| Resize the buffers by defining a new buffer size and buffer count.
|
|
unsigned long | sampleRate () |
| provides the actual sample rate
|
|
void | setReadMaxWait (TickType_t ticks) |
|
void | setWriteMaxWait (TickType_t ticks) |
|
size_t | size () |
| Provides the total capacity (=buffer size * buffer count)
|
|
bool | write (T data) |
| 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.
|
|
|
BaseBuffer< T > * | actual_read_buffer = nullptr |
|
BaseBuffer< T > * | actual_write_buffer = nullptr |
|
QueueRTOS< BaseBuffer< T > * > | available_buffers {0,portMAX_DELAY,0} |
|
int | buffer_count = 0 |
|
int | buffer_size = 0 |
|
QueueRTOS< BaseBuffer< T > * > | filled_buffers {0,portMAX_DELAY,0} |
|
size_t | max_size |
|
size_t | read_max_wait |
|
unsigned long | sample_count = 0 |
|
unsigned long | start_time = 0 |
|
size_t | write_max_wait |
|
template<typename T>
class audio_tools::SynchronizedNBufferRTOST< T >
NBuffer which uses some RTOS queues to manage the available and filled buffers.
- Template Parameters
-
◆ addAvailableBuffer()
template<typename T >
bool addAvailableBuffer |
( |
BaseBuffer< T > * |
buffer | ) |
|
|
inlineprotectedvirtual |
◆ addFilledBuffer()
◆ address()
returns the address of the start of the phsical read buffer
Implements BaseBuffer< T >.
◆ available()
determines the available entries for the current read buffer
Implements BaseBuffer< T >.
◆ availableForWrite()
template<typename T >
int availableForWrite |
( |
| ) |
|
|
inlinevirtualinherited |
determines the available entries for the write buffer
Implements BaseBuffer< T >.
◆ bufferCountEmpty()
Provides the number of entries that are available to write.
Reimplemented from NBuffer< T >.
◆ bufferCountFilled()
template<typename T >
int bufferCountFilled |
( |
| ) |
|
|
inlinevirtual |
Provides the number of entries that are available to read.
Reimplemented from NBuffer< T >.
◆ clearArray()
template<typename T >
virtual int clearArray |
( |
int |
len | ) |
|
|
inlinevirtualinherited |
◆ getNextAvailableBuffer()
◆ getNextFilledBuffer()
◆ isFull()
◆ peek()
template<typename T >
|
inlineoverridevirtualinherited |
◆ read()
template<typename T >
|
inlineoverridevirtualinherited |
◆ readArray()
template<typename T >
virtual int readArray |
( |
T |
data[], |
|
|
int |
len |
|
) |
| |
|
inlinevirtualinherited |
◆ reset()
◆ resize()
template<typename T >
void resize |
( |
int |
size, |
|
|
int |
count |
|
) |
| |
|
inlinevirtual |
Resize the buffers by defining a new buffer size and buffer count.
Reimplemented from NBuffer< T >.
◆ size()
Provides the total capacity (=buffer size * buffer count)
Reimplemented from NBuffer< T >.
◆ write()
◆ writeArray()
template<typename T >
virtual int writeArray |
( |
const T |
data[], |
|
|
int |
len |
|
) |
| |
|
inlinevirtualinherited |
The documentation for this class was generated from the following file: