Skip to content

Class daisy::StackBase

template <typename T>

ClassList > daisy > StackBase

More...

  • #include <Stack.h>

Inherited by the following classes: daisy::Stack, daisy::Stack, daisy::Stack

Public Functions

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

Protected Functions

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

Detailed Description

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

Public Functions Documentation

function Clear

inline void daisy::StackBase::Clear () 

clears the buffer


function Contains

inline bool daisy::StackBase::Contains (
    const  T & element
) 

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


function CountEqualTo

inline size_t daisy::StackBase::CountEqualTo (
    const  T & element
) 

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


function GetCapacity

inline size_t daisy::StackBase::GetCapacity () const

returns the total capacity


function GetNumElements

inline size_t daisy::StackBase::GetNumElements () const

returns the number of elements in the buffer


function Insert

inline bool daisy::StackBase::Insert (
    uint32_t idx,
    const  T & item
) 

adds a single element to the buffer and returns true if successfull


function IsEmpty

inline bool daisy::StackBase::IsEmpty () const

returns true, if the buffer is empty


function IsFull

inline bool daisy::StackBase::IsFull () const

returns true, if the buffer is Full


function PopBack

inline T daisy::StackBase::PopBack () 

removes and returns an element from the back of the buffer


function PushBack [½]

inline bool daisy::StackBase::PushBack (
    const  T & elementToAdd
) 

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


function PushBack [2/2]

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

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


function Remove

inline bool daisy::StackBase::Remove (
    uint32_t idx
) 

removes a single element from the buffer and returns true if successfull


function RemoveAllEqualTo

inline int daisy::StackBase::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 StackBase < T > & daisy::StackBase::operator= (
    const  StackBase < T > & other
) 

Copies all elements from another Stack


function operator[]

inline T & daisy::StackBase::operator[] (
    uint32_t idx
) 

returns an element at the given index without checking for the index to be within range.


function operator[]

inline const  T & daisy::StackBase::operator[] (
    uint32_t idx
) const

returns an element at the given index without checking for the index to be within range.


function ~StackBase

inline daisy::StackBase::~StackBase () 

Protected Functions Documentation

function StackBase [½]

inline daisy::StackBase::StackBase (
    T * buffer,
    size_t bufferSize
) 

function StackBase [2/2]

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


The documentation for this class was generated from the following file external-docs/libDaisy/src/util/Stack.h