libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
daisy::FIFOBase< T > Class Template Reference

Detailed Description

template<typename T>
class daisy::FIFOBase< T >

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

#include <FIFO.h>

Inheritance diagram for daisy::FIFOBase< T >:
daisy::FIFO< daisy::MidiEvent, 256 > daisy::FIFO< Event, 256 > daisy::FIFO< T, capacity >

Public Member Functions

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
 
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 Member Functions

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

Constructor & Destructor Documentation

◆ FIFOBase() [1/2]

template<typename T >
daisy::FIFOBase< T >::FIFOBase ( T *  buffer,
size_t  bufferSize 
)
inlineprotected

◆ FIFOBase() [2/2]

template<typename T >
daisy::FIFOBase< T >::FIFOBase ( T *  buffer,
size_t  bufferSize,
std::initializer_list< T >  valuesToAdd 
)
inlineprotected

◆ ~FIFOBase()

template<typename T >
daisy::FIFOBase< T >::~FIFOBase ( )
inline

Member Function Documentation

◆ Back() [1/2]

template<typename T >
T & daisy::FIFOBase< T >::Back ( )
inline

returns a reference to the last element

◆ Back() [2/2]

template<typename T >
const T & daisy::FIFOBase< T >::Back ( ) const
inline

returns a reference to the last element

◆ Clear()

template<typename T >
void daisy::FIFOBase< T >::Clear ( )
inline

Removes all elements from the FIFO

◆ Contains()

template<typename T >
bool daisy::FIFOBase< T >::Contains ( const T &  element)
inline

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

◆ CountEqualTo()

template<typename T >
size_t daisy::FIFOBase< T >::CountEqualTo ( const T &  element)
inline

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

◆ Front() [1/2]

template<typename T >
T & daisy::FIFOBase< T >::Front ( )
inline

returns a copy of the first element

◆ Front() [2/2]

template<typename T >
const T & daisy::FIFOBase< T >::Front ( ) const
inline

returns a reference to the first element

◆ GetCapacity()

template<typename T >
size_t daisy::FIFOBase< T >::GetCapacity ( ) const
inline

returns the total capacity

◆ GetNumElements()

template<typename T >
size_t daisy::FIFOBase< T >::GetNumElements ( ) const
inline

returns the number of elements in the buffer

◆ Insert()

template<typename T >
bool daisy::FIFOBase< T >::Insert ( size_t  idx,
const T &  element 
)
inline

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

◆ IsEmpty()

template<typename T >
bool daisy::FIFOBase< T >::IsEmpty ( ) const
inline

returns true, if the buffer is empty

◆ IsFull()

template<typename T >
bool daisy::FIFOBase< T >::IsFull ( ) const
inline

returns true, if the buffer is Full

◆ operator=()

template<typename T >
FIFOBase< T > & daisy::FIFOBase< T >::operator= ( const FIFOBase< T > &  other)
inline

Copies all elements from another FIFO

◆ operator[]() [1/2]

template<typename T >
T & daisy::FIFOBase< T >::operator[] ( size_t  idx)
inline

returns the element "idx" positions behind the first element

◆ operator[]() [2/2]

template<typename T >
const T & daisy::FIFOBase< T >::operator[] ( size_t  idx) const
inline

returns the element "idx" positions behind the first element

◆ PopFront()

template<typename T >
T daisy::FIFOBase< T >::PopFront ( )
inline

removes and returns an element from the front of the buffer

◆ PushBack() [1/2]

template<typename T >
bool daisy::FIFOBase< T >::PushBack ( const T &  elementToAdd)
inline

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

◆ PushBack() [2/2]

template<typename T >
int daisy::FIFOBase< T >::PushBack ( std::initializer_list< T >  valuesToAdd)
inline

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

◆ Remove()

template<typename T >
bool daisy::FIFOBase< T >::Remove ( size_t  idx)
inline

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

◆ RemoveAllEqualTo()

template<typename T >
size_t daisy::FIFOBase< T >::RemoveAllEqualTo ( const T &  element)
inline

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


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