turbo::RotativeBuffer< T > Class Template Reference
Simple cirular buffer implementation. More...
#include <RotativeBuffer.hpp>
Public Member Functions | |
| RotativeBuffer (T initial_value, unsigned short size) | |
| Initialize the cirular buffer. More... | |
| RotativeBuffer () | |
| Initialize a cirular buffer of size 10 and the default value of the type as memset. | |
| T & | get_data (unsigned short position) const |
| get an item of the circular buffer More... | |
| T * | get_array () const |
| get the buffer rotated by the buffer position | |
| void | turn () |
| void | set_first (const T &val) |
| void | set_last (const T &val) |
| unsigned short | get_size () const |
| const T & | operator[] (unsigned short pos) |
| operator const char * () | |
Protected Attributes | |
| T * | buffer = nullptr |
| unsigned short | size |
| unsigned short | position = 0 |
Detailed Description
template<typename T = unsigned char>
class turbo::RotativeBuffer< T >
Simple cirular buffer implementation.
- Template Parameters
-
T content type
Constructor & Destructor Documentation
◆ RotativeBuffer()
template<typename T = unsigned char>
|
inline |
Initialize the cirular buffer.
- Parameters
-
initial_value value to memset size size of the circular buffer
Member Function Documentation
◆ get_data()
template<typename T = unsigned char>
|
inline |
get an item of the circular buffer
- Parameters
-
position position in the buffer
The documentation for this class was generated from the following file:
- include/turbo/RotativeBuffer.hpp
1.9.1