7 #ifndef AULA1_STATICSTACK_HPP 8 #define AULA1_STATICSTACK_HPP 23 std::string
getName() {
return "Static Stack"; }
43 throw std::out_of_range(
"The stack is full.");
49 throw std::out_of_range(
"The stack is empty.");
55 throw std::out_of_range(
"The stack is empty.");
int getSize()
Outputs the number of elements stored in the structure.
StaticStack(T data[])
create the structure and populate it with the data from the array
Abstract stack interface.
bool isFull()
Check whether the structure is full.
std::string getName()
Provides the name of the data structure as a string representation.
T pop()
Remove an element from the top of the stack.
StaticStack(int size)
Create a fixed-size stack.
void push(T val)
Add an element to the top of the stack.
Stack implementation using a native C++ array as data storage.
T peek()
See the value from the top of the stack, without removing it.
bool isEmpty()
Check whether the structure is empty.