|
| Buffer ()=default |
|
| Buffer (T buffer[], size_t bufferSize) |
| Constructor with data array initialization. More...
|
|
virtual | ~Buffer ()=default |
|
void | setBuffer (T buffer[], size_t bufferSize) |
| Sets the data array. More...
|
|
virtual T & | operator[] (size_t pos) const |
| Returns the entry from a specific position in the buffer. More...
|
|
size_t | size () const |
| Returns the size of the buffer. More...
|
|
virtual size_t | count () const |
| Returns the number of entries stored in the buffer. More...
|
|
T * | data () const |
| Returns the pointer to the first element of the data array. More...
|
|
template<typename T>
class semf::Buffer< T >
Buffer
is a base class for buffer implementations.
The data base is an array with the data type defined by the template parameter T
. To use the Buffer
set the array in the constructor or by the function setData()
.
The data can be accessed by the functions
data()
to get the pointer to the data array and
at()
to get the element on a specific position.
Buffer
itself has no function to put data in the buffer.
See also RingBuffer
, LastInBuffer
, LastInDmaBuffer
and Average
.
- Note
- For using
RingBuffer
a global CriticalSection
object is required.
- Attention
- If
USE_SEMF_DEBUG
or DEBUG
is defined Buffer
uses nullptr
dereferencing instead of an error
signal.
- Template Parameters
-
Definition at line 41 of file buffer.h.