daisy::StackBase¶
#include <Stack.h>
Inherited by daisy::Stack< daisy::UiPage *, kMaxNumPages >, daisy::Stack< daisy::UiCanvasDescriptor, kMaxNumCanvases >, daisy::Stack< T, capacity >
Public Functions¶
Name | |
---|---|
StackBase< T > & | operator=(const StackBase< T > & other) |
~StackBase() | |
bool | PushBack(const T & elementToAdd) |
int | PushBack(std::initializer_list< T > valuesToAdd) |
T | 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 |
Protected Functions¶
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 operator=¶
Copies all elements from another Stack
function ~StackBase¶
function PushBack¶
Adds an element to the back of the buffer, returning true on success
function PushBack¶
Adds multiple elements and returns the number of elements that were added
function PopBack¶
removes and returns an element from the back of the buffer
function Clear¶
clears the buffer
function operator[]¶
returns an element at the given index without checking for the index to be within range.
function operator[]¶
returns an element at the given index without checking for the index to be within range.
function Remove¶
removes a single element from the buffer and returns true if successfull
function RemoveAllEqualTo¶
removes all elements from the buffer for which (buffer(index) == element) returns true and returns the number of elements that were removed.
function Insert¶
adds a single element to the buffer and returns true if successfull
function Contains¶
Returns true if the buffer contains an element equal to the provided value
function CountEqualTo¶
Returns the number of elements in the buffer that are equal to the provided value
function IsEmpty¶
returns true, if the buffer is empty
function IsFull¶
returns true, if the buffer is Full
function GetNumElements¶
returns the number of elements in the buffer
function GetCapacity¶
returns the total capacity
Protected Functions Documentation¶
function StackBase¶
function StackBase¶
Updated on 2024-01-03 at 19:41:00 +0000