tec::RingBuffer

More...

#include <ring-buffer.hpp>

Public Functions

Name
const T & operator[](std::size_t pos) const
T & back()
const T & back() const
void pop_back()
void push_front(const T & value)
bool empty() const
bool full() const
std::size_t size() const
std::size_t max_size() const
void clear()

Detailed Description

template <class T ,
std::size_t N>
class tec::RingBuffer;

Public Functions Documentation

function operator[]

inline const T & operator[](
    std::size_t pos
) const

Return element pos of the buffer. Not bounds checks

function back

inline T & back()

Returns the last element on the container (ie, the most older)

function back

inline const T & back() const

Returns the last element on the container (ie, the most older)

function pop_back

inline void pop_back()

Remove the last element on the ring buffer

function push_front

inline void push_front(
    const T & value
)

Prepends the given element value to the beginning of the buffer

function empty

inline bool empty() const

Returns true if there is not any element stored

function full

inline bool full() const

Returns true if there is not any element stored

function size

inline std::size_t size() const

Returns the number of items stored

function max_size

inline std::size_t max_size() const

Returns the max number of elements that can be stored (ie N)

function clear

inline void clear()

Removes all elements of the buffer


Updated on 2022-07-24 at 19:27:35 +0000