|
| | SingleBuffer (int size) |
| | Construct a new Single Buffer object.
|
| |
|
| SingleBuffer (SingleBuffer &)=default |
| |
|
SingleBuffer & | operator= (SingleBuffer &)=default |
| |
|
| 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
|
| |
| int | writeArray (const T data[], int len) override |
| | Fills the buffer data.
|
| |
| bool | write (T sample) override |
| | write add an entry to the buffer
|
| |
| bool | read (T &result) override |
| | reads a single value
|
| |
| bool | peek (T &result) 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 | peekArray (uint8_t *data, int len) |
| |
| int | clearArray (int len) override |
| | consumes len bytes and moves current data to the beginning
|
| |
|
void | trim () |
| | Moves the unprocessed data to the beginning of the buffer.
|
| |
| 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 |
| |
| bool | resize (int size) |
| | Resizes the buffer if supported: returns false if not supported.
|
| |
|
void | setClearWithZero (bool flag) |
| | Sets the buffer to 0 on clear.
|
| |
|
void | setWritePos (int pos) |
| | Updates the actual available data size.
|
| |
|
| BaseBuffer (BaseBuffer &)=default |
| |
|
BaseBuffer & | operator= (BaseBuffer &)=default |
| |
| virtual bool | read (T &result)=0 |
| | reads a single value
|
| |
| virtual int | readArray (T data[], int len) |
| | reads multiple values
|
| |
| virtual int | clearArray (int len) |
| | Removes the next len entries.
|
| |
| 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 bool | peek (T &result)=0 |
| | peeks the actual entry from the buffer
|
| |
| virtual bool | isFull () |
| | checks if the buffer is full
|
| |
|
bool | isEmpty () |
| |
| virtual bool | write (T data)=0 |
| | write add an entry to the buffer
|
| |
| virtual void | reset ()=0 |
| | clears the buffer
|
| |
|
void | clear () |
| | same as reset
|
| |
| 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 T * | address ()=0 |
| | returns the address of the start of the physical read buffer
|
| |
| virtual size_t | size ()=0 |
| |
|
virtual float | levelPercent () |
| | Returns the level of the buffer in %.
|
| |
| virtual bool | resize (int bytes) |
| | Resizes the buffer if supported: returns false if not supported.
|
| |
template<typename T = int16_t>
class tinyrobotics::SingleBuffer< T >
A simple Buffer implementation which just uses a (dynamically sized) array.
- Author
- Phil Schatzmann