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

Detailed Description

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

A simple FILO (stack) buffer with a fixed size (usefull when allocation on the heap is not an option

#include <Stack.h>

Inheritance diagram for daisy::Stack< T, capacity >:
daisy::StackBase< T >

Public Member Functions

 Stack ()
 
 Stack (std::initializer_list< T > valuesToAdd)
 
template<size_t otherCapacity>
 Stack (const Stack< T, otherCapacity > &other)
 
template<size_t otherCapacity>
Stack< T, capacity > & operator= (const Stack< T, otherCapacity > &other)
 
- Public Member Functions inherited from daisy::StackBase< T >
StackBase< T > & operator= (const StackBase< T > &other)
 
 ~StackBase ()
 
bool PushBack (const T &elementToAdd)
 
int PushBack (std::initializer_list< T > valuesToAdd)
 
PopBack ()
 
void Clear ()
 
T & operator[] (uint32_t idx)
 
const T & operator[] (uint32_t idx) const
 
bool Remove (uint32_t idx)
 
int RemoveAllEqualTo (const T &element)
 
bool Insert (uint32_t idx, const T &item)
 
bool Contains (const T &element)
 
size_t CountEqualTo (const T &element)
 
bool IsEmpty () const
 
bool IsFull () const
 
size_t GetNumElements () const
 
size_t GetCapacity () const
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ Stack() [1/3]

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

Creates an empty Stack

◆ Stack() [2/3]

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

Creates a Stack and adds a list of values

◆ Stack() [3/3]

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

Creates a Stack and copies all values from another Stack

Member Function Documentation

◆ operator=()

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

Copies all values from another Stack


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