![]() |
PUMA Library Reference Manual
|
#include <Puma/PtrStack.h>
Inheritance diagram for Puma::PtrStack< T >:Layered stack for pointers to objects.
Each layer is a separate stack. Layers can be added, dropped, or destroyed.
Public Member Functions | |
| PtrStack (long size=8192, long incr=8192) | |
| Construct a new layered stack. | |
| virtual | ~PtrStack () |
| Destructor. | |
Stack operations | |
| void | Push (const T *item) |
| Add a new item on the top of the current layer. | |
| void | Pop () |
| Remove the top item from the current layer. | |
| T * | Top () const |
| Get the top item from the current layer. | |
| long | Length () const |
| Get the number of items added to the current layer. | |
| T * | Get (long n) const |
| Get the n-th item on the current layer. | |
Layer operations | |
| void | New () |
| Create a new layer. | |
| void | Forget () |
| Remove the top layer and add its items to the underlying layer. | |
| void | Reject () |
| Remove the top layer. | |
| void | Destroy () |
| Remove the top layer and delete its items. | |
| long | Stacks () const |
| Get the number of layers. | |
| void | Reset () |
| Remove all layers. | |
| virtual void | Remove () |
| Remove the top item of the current layer. | |
| virtual void | Delete () |
| Remove and delete the top item of the current layer. | |
|
inline |
Construct a new layered stack.
| size | The size of each layer. Defaults to 8192. |
| incr | The increment for the size of each layer. Defaults to 8192. |
|
inlinevirtual |
Destructor.
|
inlineprotectedvirtual |
Remove and delete the top item of the current layer.
Reimplemented in Puma::Builder, Puma::CCBuilder, Puma::CCSemantic, Puma::CSemantic, and Puma::Semantic.
|
inline |
Remove the top layer and delete its items.
|
inline |
Remove the top layer and add its items to the underlying layer.
|
inline |
Get the n-th item on the current layer.
| n | The index of the item to get. |
|
inline |
Get the number of items added to the current layer.
|
inline |
Create a new layer.
|
inline |
Remove the top item from the current layer.
|
inline |
Add a new item on the top of the current layer.
| item | The item to add. |
|
inline |
Remove the top layer.
|
inlineprotectedvirtual |
Remove the top item of the current layer.
|
inline |
Remove all layers.
|
inline |
Get the number of layers.
|
inline |
Get the top item from the current layer.