#include <lists.h>
Inheritance diagram for PStack< T >:
Public Member Functions | |
Construction | |
PStack () | |
Create a new, empty, stack. | |
Overrides from class PObject | |
virtual PObject * | Clone () const |
Make a complete duplicate of the stack. | |
New functions for class | |
virtual void | Push (T *obj) |
Add an object to the stack. | |
virtual T * | Pop () |
Remove the last object pushed onto the stack. | |
virtual T & | Top () |
Get the element that is currently on top of the stack without removing it. | |
Protected Member Functions | |
PStack (int dummy, const PStack *c) |
The functions in this class primarily do all the appropriate casting of types.
By default, objects placed into the set will not be deleted when removed or when all references to the set are destroyed. This is different from the default on most collection classes.
Note that if templates are not used the PDECLARE_STACK
macro will simulate the template instantiation.
Create a new, empty, stack.
Note that by default, objects placed into the stack will not be deleted when removed or when all references to the stack are destroyed. This is different from the default on most collection classes.
Make a complete duplicate of the stack.
Note that all objects in the array are also cloned, so this will make a complete copy of the stack.
Reimplemented from PObject.
virtual T* PStack< T >::Pop | ( | ) | [inline, virtual] |
Remove the last object pushed onto the stack.
virtual void PStack< T >::Push | ( | T * | obj | ) | [inline, virtual] |
Add an object to the stack.
This object will be on "top" of the stack and will be the object returned by the Pop()
function.
obj | Object to add to the stack. |
virtual T& PStack< T >::Top | ( | ) | [inline, virtual] |
Get the element that is currently on top of the stack without removing it.