WPILibC++
2018.4.1-20181002134759-1212-g7b471d8
|
This is a simple circular buffer so we don't need to "bucket brigade" copy old values. More...
#include <circular_buffer.h>
Public Member Functions | |
circular_buffer (size_t size) | |
size_type | size () const |
Returns number of elements in buffer. | |
T & | front () |
Returns value at front of buffer. | |
const T & | front () const |
Returns value at front of buffer. | |
T & | back () |
Returns value at back of buffer. | |
const T & | back () const |
Returns value at back of buffer. | |
void | push_front (T value) |
Push new value onto front of the buffer. More... | |
void | push_back (T value) |
Push new value onto back of the buffer. More... | |
T | pop_front () |
Pop value at front of buffer. | |
T | pop_back () |
Pop value at back of buffer. | |
void | resize (size_t size) |
Resizes internal buffer to given size. | |
void | reset () |
Sets internal buffer contents to zero. | |
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 & frc::circular_buffer< T >::operator[] | ( | size_t | index | ) |
const T & frc::circular_buffer< T >::operator[] | ( | size_t | index | ) | const |
void frc::circular_buffer< T >::push_back | ( | T | value | ) |
Push new value onto back of the buffer.
The value at the front is overwritten if the buffer is full.
void frc::circular_buffer< T >::push_front | ( | T | value | ) |
Push new value onto front of the buffer.
The value at the back is overwritten if the buffer is full.