WPILibC++  unspecified
frc::CircularBuffer< T > Class Template Reference

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...
 
PopFront ()
 Pop value at front of buffer.
 
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
 

Detailed Description

template<class T>
class frc::CircularBuffer< T >

This is a simple circular buffer so we don't need to "bucket brigade" copy old values.

Member Function Documentation

template<class T >
T & frc::CircularBuffer< T >::operator[] ( size_t  index)
Returns
Element at index starting from front of buffer.
template<class T >
const T & frc::CircularBuffer< T >::operator[] ( size_t  index) const
Returns
Element at index starting from front of buffer.
template<class T>
void frc::CircularBuffer< T >::PushBack ( value)

Push new value onto back of the buffer.

The value at the front is overwritten if the buffer is full.

template<class T>
void frc::CircularBuffer< T >::PushFront ( value)

Push new value onto front of the buffer.

The value at the back is overwritten if the buffer is full.


The documentation for this class was generated from the following files: