Capacity-independent base class for Stack. Use Stack instead.
#include <Stack.h>
Public Member Functions | |
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 Member Functions | |
StackBase (T *buffer, size_t bufferSize) | |
StackBase (T *buffer, size_t bufferSize, std::initializer_list< T > valuesToAdd) | |
|
inlineprotected |
|
inlineprotected |
|
inline |
|
inline |
clears the buffer
|
inline |
Returns true if the buffer contains an element equal to the provided value
|
inline |
Returns the number of elements in the buffer that are equal to the provided value
|
inline |
returns the total capacity
|
inline |
returns the number of elements in the buffer
|
inline |
adds a single element to the buffer and returns true if successfull
|
inline |
returns true, if the buffer is empty
|
inline |
returns true, if the buffer is Full
|
inline |
Copies all elements from another Stack
|
inline |
returns an element at the given index without checking for the index to be within range.
|
inline |
returns an element at the given index without checking for the index to be within range.
|
inline |
removes and returns an element from the back of the buffer
|
inline |
Adds an element to the back of the buffer, returning true on success
|
inline |
Adds multiple elements and returns the number of elements that were added
|
inline |
removes a single element from the buffer and returns true if successfull
|
inline |
removes all elements from the buffer for which (buffer(index) == element) returns true and returns the number of elements that were removed.