|
Formula Student Autonomous Systems
The code for the main driverless system
|
#include <circular_buffer.hpp>

Public Member Functions | |
| CircularBuffer (size_t capacity=0) | |
| void | set_capacity (size_t capacity) |
| void | clear () |
| size_t | size () const |
| size_t | capacity () const |
| bool | empty () const |
| bool | full () const |
| void | push (const T &item) |
| Add item into circular buffer. | |
| const T & | latest () const |
| Access the most recent item. | |
| const T & | from_end (size_t i) const |
| Access i-th element from the end (0 = latest, 1 = previous, ...) | |
| const T & | operator[] (size_t index) const |
| Iterate raw access. | |
Private Attributes | |
| size_t | capacity_ |
| size_t | head_ |
| size_t | size_ |
| std::vector< T > | buffer_ |
Definition at line 8 of file circular_buffer.hpp.
|
inlineexplicit |
Definition at line 10 of file circular_buffer.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 26 of file circular_buffer.hpp.
|
inline |
Access i-th element from the end (0 = latest, 1 = previous, ...)
Definition at line 48 of file circular_buffer.hpp.
|
inline |
Definition at line 27 of file circular_buffer.hpp.
|
inline |
Access the most recent item.
Definition at line 40 of file circular_buffer.hpp.
|
inline |
Iterate raw access.
Definition at line 56 of file circular_buffer.hpp.
|
inline |
Add item into circular buffer.
Definition at line 30 of file circular_buffer.hpp.
|
inline |
|
inline |
|
private |
Definition at line 67 of file circular_buffer.hpp.
|
private |
Definition at line 64 of file circular_buffer.hpp.
|
private |
Definition at line 65 of file circular_buffer.hpp.
|
private |
Definition at line 66 of file circular_buffer.hpp.