Skip to content

daisy::FIFOBase

More...

#include <FIFO.h>

Inherited by daisy::FIFO< Event, 256 >, daisy::FIFO< daisy::MidiEvent, 256 >, daisy::FIFO< T, capacity >

Public Functions

Name
FIFOBase< T > & operator=(const FIFOBase< T > & other)
~FIFOBase()
void Clear()
bool PushBack(const T & elementToAdd)
int PushBack(std::initializer_list< T > valuesToAdd)
T & Back()
const T & Back() const
T PopFront()
T & Front()
const T & Front() const
bool Contains(const T & element)
size_t CountEqualTo(const T & element)
bool IsEmpty() const
bool IsFull() const
size_t GetNumElements() const
bool Insert(size_t idx, const T & element)
bool Remove(size_t idx)
size_t RemoveAllEqualTo(const T & element)
T & operator[](size_t idx)
const T & operator[](size_t idx) const
size_t GetCapacity() const

Protected Functions

Name
FIFOBase(T * buffer, size_t bufferSize)
FIFOBase(T * buffer, size_t bufferSize, std::initializer_list< T > valuesToAdd)

Detailed Description

template <typename T >
class daisy::FIFOBase;

Capacity-independent base class for FIFO. Use FIFO instead.

Public Functions Documentation

function operator=

inline FIFOBase< T > & operator=(
    const FIFOBase< T > & other
)

Copies all elements from another FIFO


function ~FIFOBase

inline ~FIFOBase()

function Clear

inline void Clear()

Removes all elements from the FIFO


function PushBack

inline bool PushBack(
    const T & elementToAdd
)

Adds an element to the back of the buffer, returning true on success


function PushBack

inline int PushBack(
    std::initializer_list< T > valuesToAdd
)

Adds multiple elements and returns the number of elements that were added


function Back

inline T & Back()

returns a reference to the last element


function Back

inline const T & Back() const

returns a reference to the last element


function PopFront

inline T PopFront()

removes and returns an element from the front of the buffer


function Front

inline T & Front()

returns a copy of the first element


function Front

inline const T & Front() const

returns a reference to the first element


function Contains

inline bool Contains(
    const T & element
)

Returns true if the buffer contains an element equal to the provided value


function CountEqualTo

inline size_t CountEqualTo(
    const T & element
)

Returns the number of elements in the buffer that are equal to the provided value


function IsEmpty

inline bool IsEmpty() const

returns true, if the buffer is empty


function IsFull

inline bool IsFull() const

returns true, if the buffer is Full


function GetNumElements

inline size_t GetNumElements() const

returns the number of elements in the buffer


function Insert

inline bool Insert(
    size_t idx,
    const T & element
)

inserts an element "idx" positions behind the first element and returns true if successful


function Remove

inline bool Remove(
    size_t idx
)

removes the element "idx" positions behind the first element and returns true if successful


function RemoveAllEqualTo

inline size_t RemoveAllEqualTo(
    const T & element
)

removes all elements from the buffer for which (buffer(index) == element) returns true and returns the number of elements that were removed.


function operator[]

inline T & operator[](
    size_t idx
)

returns the element "idx" positions behind the first element


function operator[]

inline const T & operator[](
    size_t idx
) const

returns the element "idx" positions behind the first element


function GetCapacity

inline size_t GetCapacity() const

returns the total capacity


Protected Functions Documentation

function FIFOBase

inline FIFOBase(
    T * buffer,
    size_t bufferSize
)

function FIFOBase

inline FIFOBase(
    T * buffer,
    size_t bufferSize,
    std::initializer_list< T > valuesToAdd
)

Updated on 2024-01-03 at 19:41:00 +0000