Non allocating buffer class holds a maximum of given entries and allows an endless insert by overrinding previous elements in the buffer.
More...
#include <ringbuffer.h>
|
iterator | begin () |
|
iterator | end () |
|
iterator | begin () const |
|
iterator | end () const |
|
size_t | size () const |
|
constexpr size_t | capacity () const |
|
bool | empty () const |
|
const TYPE & | front () const |
| Access to the first element in the buffer. More...
|
|
TYPE & | front () |
| Access to the first element in the buffer. More...
|
|
const TYPE & | back () const |
| Access to the last element in the buffer. More...
|
|
TYPE & | back () |
| Access to the last element in the buffer. More...
|
|
void | clear () |
| Clears the whole ring buffer. More...
|
|
void | push_back (const TYPE &x) |
| Pushes an element to the end of the buffer.
|
|
template<typename... _Args> |
void | emplace_back (_Args &&...args) |
| Pushes an elements to the end of the buffer. More...
|
|
void | pop () |
| Removes element from the beginning of the buffer.
|
|
void | erase_back (const size_t n) |
| Erase the given amount of elements from the end of the buffer.
|
|
void | erase_front (const size_t n) |
| Erase the given amount of elements from the beginning of the buffer.
|
|
TYPE & | operator[] (size_t i) |
|
const TYPE & | operator[] (size_t i) const |
|
|
size_t | _size |
|
size_t | _front |
|
size_t | _back |
|
TYPE | _buffer [SIZE] |
|
template<typename TYPE, size_t SIZE = 64u>
class TwinE::RingBuffer< TYPE, SIZE >
Non allocating buffer class holds a maximum of given entries and allows an endless insert by overrinding previous elements in the buffer.
◆ front() [1/2]
template<typename TYPE, size_t SIZE = 64u>
Access to the first element in the buffer.
- Note
- This is not the same as accessing the index 0 element
◆ front() [2/2]
template<typename TYPE, size_t SIZE = 64u>
Access to the first element in the buffer.
- Note
- This is not the same as accessing the index 0 element
◆ back() [1/2]
template<typename TYPE, size_t SIZE = 64u>
Access to the last element in the buffer.
- Note
- This is not the same as accessing the index
size-1
element
◆ back() [2/2]
template<typename TYPE, size_t SIZE = 64u>
Access to the last element in the buffer.
- Note
- This is not the same as accessing the index
size-1
element
◆ clear()
template<typename TYPE, size_t SIZE = 64u>
Clears the whole ring buffer.
- Note
- Does not call any destructors - they are called when the buffer itself gets destroyed
◆ emplace_back()
template<typename TYPE, size_t SIZE = 64u>
template<typename... _Args>
Pushes an elements to the end of the buffer.
- Note
- Performs a move operation
The documentation for this class was generated from the following file: