WPILibC++
unspecified
|
This is a simple circular buffer so we don't need to "bucket brigade" copy old values. More...
#include <CircularBuffer.h>
Public Member Functions | |
CircularBuffer (size_t size) | |
void | PushFront (T value) |
Push new value onto front of the buffer. More... | |
void | PushBack (T value) |
Push new value onto back of the buffer. More... | |
T | PopFront () |
Pop value at front of buffer. | |
T | PopBack () |
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::CircularBuffer< T >::operator[] | ( | size_t | index | ) |
const T & frc::CircularBuffer< T >::operator[] | ( | size_t | index | ) | const |
void frc::CircularBuffer< T >::PushBack | ( | T | value | ) |
Push new value onto back of the buffer.
The value at the front is overwritten if the buffer is full.
void frc::CircularBuffer< T >::PushFront | ( | T | value | ) |
Push new value onto front of the buffer.
The value at the back is overwritten if the buffer is full.