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

Detailed Description

template<typename T, size_t capacity>
class daisy::FIFO< T, capacity >

A simple FIFO ring buffer with a fixed size.

#include <FIFO.h>

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

Public Member Functions

 FIFO ()
 
 FIFO (std::initializer_list< T > valuesToAdd)
 
template<size_t otherCapacity>
 FIFO (const FIFO< T, otherCapacity > &other)
 
template<size_t otherCapacity>
FIFO< T, capacity > & operator= (const FIFO< T, otherCapacity > &other)
 
- Public Member Functions inherited from daisy::FIFOBase< T >
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
 

Additional Inherited Members

- Protected Member Functions inherited from daisy::FIFOBase< T >
 FIFOBase (T *buffer, size_t bufferSize)
 
 FIFOBase (T *buffer, size_t bufferSize, std::initializer_list< T > valuesToAdd)
 

Constructor & Destructor Documentation

◆ FIFO() [1/3]

template<typename T , size_t capacity>
daisy::FIFO< T, capacity >::FIFO ( )
inline

Creates an empty FIFO

◆ FIFO() [2/3]

template<typename T , size_t capacity>
daisy::FIFO< T, capacity >::FIFO ( std::initializer_list< T >  valuesToAdd)
inlineexplicit

Creates a FIFO and adds a list of values

◆ FIFO() [3/3]

template<typename T , size_t capacity>
template<size_t otherCapacity>
daisy::FIFO< T, capacity >::FIFO ( const FIFO< T, otherCapacity > &  other)
inline

Creates a FIFO and copies all values from another FIFO

Member Function Documentation

◆ operator=()

template<typename T , size_t capacity>
template<size_t otherCapacity>
FIFO< T, capacity > & daisy::FIFO< T, capacity >::operator= ( const FIFO< T, otherCapacity > &  other)
inline

Copies all values from another FIFO


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