|
XenevaOS
|
A simple Buffer implementation which just uses a (dynamically sized) array. More...
#include <Buffers.h>


Public Member Functions | |
| SingleBuffer (int size) | |
| Construct a new Single Buffer object. | |
| SingleBuffer () | |
| Construct a new Single Buffer w/o allocating any memory. | |
| void | onExternalBufferRefilled (void *data, int len) |
| notifies that the external buffer has been refilled | |
| bool | write (T sample) override |
| write add an entry to the buffer | |
| T | read () override |
| reads a single value | |
| T | peek () override |
| peeks the actual entry from the buffer | |
| int | available () override |
| provides the number of entries that are available to read | |
| int | availableForWrite () override |
| provides the number of entries that are available to write | |
| bool | isFull () override |
| checks if the buffer is full | |
| int | clearArray (int len) override |
| consumes len bytes and moves current data to the beginning | |
| T * | address () override |
| Provides address to beginning of the buffer. | |
| T * | data () |
| Provides address of actual data. | |
| void | reset () override |
| clears the buffer | |
| size_t | setAvailable (size_t available_size) |
| size_t | size () override |
| void | resize (int size) |
| void | setClearWithZero (bool flag) |
| Sets the buffer to 0 on clear. | |
Public Member Functions inherited from libhelix::BaseBuffer< T > | |
| BaseBuffer ()=default | |
| virtual | ~BaseBuffer ()=default |
| BaseBuffer (BaseBuffer const &)=delete | |
| BaseBuffer & | operator= (BaseBuffer const &)=delete |
| virtual int | readArray (T data[], int len) |
| reads multiple values | |
| 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. | |
| 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]) |
| bool | isEmpty () |
| void | clear () |
| same as reset | |
Protected Member Functions | |
| void | setWritePos (int pos) |
Protected Member Functions inherited from libhelix::BaseBuffer< T > | |
| void | setWritePos (int pos) |
Protected Attributes | |
| int | max_size = 0 |
| int | current_read_pos = 0 |
| int | current_write_pos = 0 |
| bool | owns_buffer = true |
| bool | is_clear_with_zero = false |
| Vector< T > | buffer {0} |
A simple Buffer implementation which just uses a (dynamically sized) array.
|
inline |
Construct a new Single Buffer object.
| size |
|
inline |
Construct a new Single Buffer w/o allocating any memory.
|
inlineoverridevirtual |
Provides address to beginning of the buffer.
Implements libhelix::BaseBuffer< T >.
|
inlineoverridevirtual |
provides the number of entries that are available to read
Implements libhelix::BaseBuffer< T >.
|
inlineoverridevirtual |
provides the number of entries that are available to write
Implements libhelix::BaseBuffer< T >.
|
inlineoverridevirtual |
consumes len bytes and moves current data to the beginning
Reimplemented from libhelix::BaseBuffer< T >.
|
inline |
Provides address of actual data.
|
inlineoverridevirtual |
checks if the buffer is full
Implements libhelix::BaseBuffer< T >.
|
inline |
notifies that the external buffer has been refilled
|
inlineoverridevirtual |
peeks the actual entry from the buffer
Implements libhelix::BaseBuffer< T >.
|
inlineoverridevirtual |
reads a single value
Implements libhelix::BaseBuffer< T >.
|
inlineoverridevirtual |
clears the buffer
Implements libhelix::BaseBuffer< T >.
|
inline |
|
inline |
If we load values directly into the address we need to set the avialeble size
|
inline |
Sets the buffer to 0 on clear.
|
inlineprotected |
|
inlineoverridevirtual |
Implements libhelix::BaseBuffer< T >.
|
inlineoverridevirtual |
write add an entry to the buffer
Implements libhelix::BaseBuffer< T >.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |