template<class T> class PStack

This template class maps the PAbstractList to a specific object type, and adds functionality that allows the list to be used as a last in first out stack.

Inheritance:


Public Methods

[more] Construction
[more] Overrides from class PObject
[more] New functions for class


Inherited from PAbstractList:

Public Methods

ovirtual Comparison Compare(const PObject & obj) const

Overrides from class PContainer

Overrides from class PCollection

Protected Methods

oPINLINE PObject& GetReferenceAt( PINDEX index ) const
oBOOL SetCurrent( PINDEX index ) const


Inherited from PCollection:

Public Methods

Common functions for collections


Inherited from PContainer:

Public Methods

Common functions for containers

Protected Methods

ovirtual void DestroyContents()
ovirtual void AssignContents(const PContainer & c)
ovoid CopyContents(const PContainer & c)
ovoid CloneContents(const PContainer* src)
ovoid Destruct()


Inherited from PObject:

Public Methods

Run Time Type functions

I/O functions

Public Members

Comparison functions


Documentation

This template class maps the PAbstractList to a specific object type, and adds functionality that allows the list to be used as a last in first out stack. 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.

o Construction

o PStack()
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.

o Overrides from class PObject

ovirtual PObject* Clone() const
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.

o New functions for class

ovirtual void Push( T* obj )
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.
Parameters:
obj - Object to add to the stack.

ovirtual T* Pop()
Remove the last object pushed onto the stack.

Returns:
object on top of the stack.

ovirtual T& Top()
Get the element that is currently on top of the stack without removing it.

Returns:
reference to object on top of the stack.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.