The QPtrStack class is a template class that provides a stack.
.PP
QValueStack is an STL-compatible alternative to this class.
.PP
Define a template instance QPtrStack<X> to create a stack that operates on pointers to X, (X*).
.PP
A stack is a last in, first out (LIFO) structure. Items are added to the top of the stack with push() and retrieved from the top with pop(). Use top() to get a reference to the top element without changing the stack.
.PP
You can control the stack's deletion policy with setAutoDelete().
.PP
For compatibility with the QPtrCollection classes current() and remove() are provided; they both operate on the top().
.PP
See also QPtrList, QPtrQueue, and Non-GUI Classes.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QPtrStack::QPtrStack ()"
Creates an empty stack.
.SH "QPtrStack::QPtrStack ( const QPtrStack<type> & s )"
Creates a stack by making a shallow copy of another stack \fIs\fR.
.SH "QPtrStack::~QPtrStack ()"
Destroys the stack. All items will be deleted if autoDelete() is TRUE.
.SH "bool QPtrStack::autoDelete () const"
The same as QPtrCollection::autoDelete().
.PP
See also setAutoDelete().
.SH "void QPtrStack::clear ()"
Removes all items from the stack, deleting them if autoDelete() is TRUE.
.PP
See also remove().
.SH "uint QPtrStack::count () const"
Returns the number of items in the stack.
.PP
See also isEmpty().
.SH "type * QPtrStack::current () const"
Returns a pointer to the top item on the stack (most recently pushed). The stack is not changed. Returns 0 if the stack is empty.
.SH "bool QPtrStack::isEmpty () const"
Returns TRUE if the stack contains no elements; otherwise returns FALSE.
.SH "QPtrStack::operator type * () const"
Returns a pointer to the top item on the stack (most recently pushed). The stack is not changed. Returns 0 if the stack is empty.
.SH "QPtrStack<type> & QPtrStack::operator= ( const QPtrStack<type> & s )"
Sets the contents of this stack by making a shallow copy of another stack \fIs\fR. Elements currently in this stack will be deleted if autoDelete() is TRUE.
.SH "type * QPtrStack::pop ()"
Removes the top item from the stack and returns it. The stack must not be empty.
.SH "void QPtrStack::push ( const type * d )"
Adds an element \fId\fR to the top of the stack. Last in, first out.