WPILibC++ 2024.3.2
|
This is a simple circular buffer so we don't need to "bucket brigade" copy old values. More...
#include <wpi/circular_buffer.h>
Classes | |
class | const_iterator |
class | iterator |
Public Member Functions | |
circular_buffer (size_t size) | |
Constructs a circular buffer. More... | |
circular_buffer (const circular_buffer &)=default | |
circular_buffer & | operator= (const circular_buffer &)=default |
circular_buffer (circular_buffer &&)=default | |
circular_buffer & | operator= (circular_buffer &&)=default |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
size_t | size () const |
Returns number of elements in buffer. More... | |
T & | front () |
Returns value at front of buffer. More... | |
const T & | front () const |
Returns value at front of buffer. More... | |
T & | back () |
Returns value at back of buffer. More... | |
const T & | back () const |
Returns value at back of buffer. More... | |
void | push_front (T value) |
Push a new value onto the front of the buffer. More... | |
void | push_back (T value) |
Push a new value onto the back of the buffer. More... | |
template<class... Args> | |
void | emplace_front (Args &&... args) |
Push a new value onto the front of the buffer that is constructed with the provided constructor arguments. More... | |
template<class... Args> | |
void | emplace_back (Args &&... args) |
Push a new value onto the back of the buffer that is constructed with the provided constructor arguments. More... | |
T | pop_front () |
Pop value at front of buffer. More... | |
T | pop_back () |
Pop value at back of buffer. More... | |
void | resize (size_t size) |
Resizes internal buffer to given size. More... | |
void | reset () |
Empties internal buffer. More... | |
T & | operator[] (size_t index) |
const T & | operator[] (size_t index) const |
This is a simple circular buffer so we don't need to "bucket brigade" copy old values.
T | Buffer element type. |
|
inlineexplicit |
Constructs a circular buffer.
size | Maximum number of buffer elements. |
|
default |
|
default |
|
inline |
Returns value at back of buffer.
If there are no elements in the buffer, calling this function results in undefined behavior.
|
inline |
Returns value at back of buffer.
If there are no elements in the buffer, calling this function results in undefined behavior.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Push a new value onto the back of the buffer that is constructed with the provided constructor arguments.
The value at the front is overwritten if the buffer is full.
|
inline |
Push a new value onto the front of the buffer that is constructed with the provided constructor arguments.
The value at the back is overwritten if the buffer is full.
|
inline |
|
inline |
|
inline |
Returns value at front of buffer.
|
inline |
Returns value at front of buffer.
|
default |
|
default |
|
inline |
|
inline |
|
inline |
Pop value at back of buffer.
If there are no elements in the buffer, calling this function results in undefined behavior.
|
inline |
Pop value at front of buffer.
If there are no elements in the buffer, calling this function results in undefined behavior.
|
inline |
Push a new value onto the back of the buffer.
The value at the front is overwritten if the buffer is full.
|
inline |
Push a new value onto the front of the buffer.
The value at the back is overwritten if the buffer is full.
|
inline |
Empties internal buffer.
void wpi::circular_buffer< T >::resize | ( | size_t | size | ) |
Resizes internal buffer to given size.
|
inline |
Returns number of elements in buffer.