#include <Stack.h>
The chaining makes enqueueing and dequeueing fast.
Definition at line 34 of file Stack.h.
Public Member Functions | |
ContainingStack () | |
Creates a new stack. | |
bool | Delete () |
Deletes the top item from the stack. | |
void | DeleteAll () |
Deletes all items from the stack. | |
long | GetCount () const |
Returns the number of items in the stack. | |
bool | IsEmpty () const |
Returns, if there are no items in the stack. | |
ITEMTYPE * | Peek () const |
Returns the top item of the stack. | |
ITEMTYPE * | Pop () |
Removes the top item of the stack. | |
void | PopAll () |
Removes all items from the stack without freeing them or returning them. | |
void | Push (ITEMTYPE *NewItem) |
Puts an item on the top of the stack. | |
virtual | ~ContainingStack () |
Destroys the stack. | |
Private Attributes | |
long | Count |
The number of items in the stack. | |
ITEMTYPE * | Top |
The top stack item. |
|
Creates a new stack.
|
|
Destroys the stack. When deleting the stack, all contained items are also freed. |
|
Deletes the top item from the stack. The item is removed from the stack and freed.
|
|
Deletes all items from the stack. All items are removed from the stack and freed. |
|
Returns the number of items in the stack.
|
|
Returns, if there are no items in the stack.
|
|
Returns the top item of the stack.
|
|
Removes the top item of the stack. The item is not freed, but returned.
|
|
Removes all items from the stack without freeing them or returning them.
|
|
Puts an item on the top of the stack.
|
|
The number of items in the stack.
|
|
The top stack item.
|