Stream class which stores the data in a temporary queue buffer. The queue can be consumed e.g. by a callback function by calling readBytes();.
More...
#include <BaseStream.h>
|
| | QueueStream ()=default |
| | Empty Constructor: call setBuffer() to set the buffer.
|
| |
| | QueueStream (BaseBuffer< T > &buffer) |
| | Create stream from any BaseBuffer subclass.
|
| |
| | QueueStream (int bufferSize, int bufferCount, bool autoRemoveOldestDataIfFull=false) |
| | Default constructor.
|
| |
| virtual | ~QueueStream () |
| |
| int | available () override |
| |
| int | availableForWrite () override |
| |
| virtual bool | begin () override |
| | Activates the output.
|
| |
| virtual bool | begin (size_t activeWhenPercentFilled) |
| | Activate only when filled buffer reached %.
|
| |
| void | clear () |
| | Clears the data in the buffer.
|
| |
| virtual void | end () override |
| | stops the processing
|
| |
| void | flush () override |
| | Clears the data in the buffer and resets the state.
|
| |
| int | levelPercent () |
| | Returns the fill level in percent.
|
| |
| | operator bool () |
| | Returns true if active.
|
| |
| int | peek () override |
| |
| int | read () override |
| |
| virtual size_t | readBytes (uint8_t *data, size_t len) override |
| |
| bool | resize (size_t size) |
| | Resize the buffer.
|
| |
| bool | resize (size_t size, int count) |
| | Resize the buffer by indicating the size and count.
|
| |
| void | setBuffer (BaseBuffer< T > &buffer) |
| |
| void | setWriteBufferSize (int size) |
| |
| virtual size_t | write (const uint8_t *data, size_t len) override |
| |
| virtual size_t | write (uint8_t ch) override |
| |
|
| void | refillReadBuffer () |
| | Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read()
|
| |
template<class T>
class audio_tools::QueueStream< T >
Stream class which stores the data in a temporary queue buffer. The queue can be consumed e.g. by a callback function by calling readBytes();.
- Author
- Phil Schatzmann
- Copyright
- GPLv3
◆ QueueStream() [1/3]
◆ QueueStream() [2/3]
template<class T >
| QueueStream |
( |
int |
bufferSize, |
|
|
int |
bufferCount, |
|
|
bool |
autoRemoveOldestDataIfFull = false |
|
) |
| |
|
inline |
◆ QueueStream() [3/3]
◆ ~QueueStream()
◆ available()
◆ availableForWrite()
template<class T >
| int availableForWrite |
( |
| ) |
|
|
inlineoverridevirtual |
◆ begin() [1/2]
Activates the output.
Reimplemented from BaseStream.
◆ begin() [2/2]
template<class T >
| virtual bool begin |
( |
size_t |
activeWhenPercentFilled | ) |
|
|
inlinevirtual |
Activate only when filled buffer reached %.
◆ clear()
Clears the data in the buffer.
◆ end()
stops the processing
Reimplemented from BaseStream.
◆ flush()
Clears the data in the buffer and resets the state.
Reimplemented from BaseStream.
◆ levelPercent()
Returns the fill level in percent.
◆ operator bool()
◆ peek()
◆ read()
◆ readBytes()
template<class T >
| virtual size_t readBytes |
( |
uint8_t * |
data, |
|
|
size_t |
len |
|
) |
| |
|
inlineoverridevirtual |
◆ refillReadBuffer()
| void refillReadBuffer |
( |
| ) |
|
|
inlineprotectedinherited |
Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read()
◆ resize() [1/2]
template<class T >
| bool resize |
( |
size_t |
size | ) |
|
|
inline |
◆ resize() [2/2]
template<class T >
| bool resize |
( |
size_t |
size, |
|
|
int |
count |
|
) |
| |
|
inline |
Resize the buffer by indicating the size and count.
◆ setBuffer()
◆ setWriteBufferSize()
| void setWriteBufferSize |
( |
int |
size | ) |
|
|
inlineinherited |
◆ write() [1/2]
template<class T >
| virtual size_t write |
( |
const uint8_t * |
data, |
|
|
size_t |
len |
|
) |
| |
|
inlineoverridevirtual |
◆ write() [2/2]
| virtual size_t write |
( |
uint8_t |
ch | ) |
|
|
inlineoverridevirtualinherited |
◆ _timeout
◆ active
◆ active_limit
◆ owns_buffer
◆ p_buffer
◆ remove_oldest_data
template<class T >
| bool remove_oldest_data = false |
|
protected |
◆ tmp_in
◆ tmp_out
◆ total_written
◆ write_buffer_size
The documentation for this class was generated from the following file: