Template Class FiFo

Class Documentation

template<typename ValueType, uint64_t Capacity>
class FiFo

single pusher single pop’er thread safe fifo

Public Functions

bool push(const ValueType &f_value) noexcept

pushes a value into the fifo

Returns:

if the values was pushed successfully into the fifo it returns true, otherwise false

cxx::optional<ValueType> pop() noexcept

returns the oldest value from the fifo and removes it

Returns:

if the fifo was not empty the optional contains the value, otherwise it contains a nullopt

bool empty() const noexcept

returns true when the fifo is empty, otherwise false

uint64_t size() const noexcept

returns the size of the fifo

Public Static Functions

static constexpr uint64_t capacity() noexcept

returns the capacity of the fifo