PUMA Library Reference Manual
|
#include <Puma/BCStack.h>
Stack of fixed-size buckets.
A bucket is a fixed-size array that is filled sequentially. Each bucket is linked with the previous and next buckets forming a double linked list. Items are accessed last-in first-out. No random access supported.
Item | The stack item type. |
BUCKET_SIZE | Optional size of each bucket. Defaults to 32. |
Public Types | |
typedef List::Iterator | Iterator |
Iterator type for the bucket stack. | |
Public Member Functions | |
BCStack () | |
Construct an empty bucket stack. | |
long | length () const |
Get the length of the bucket stack. | |
void | push (Item item) |
Push a new item on top of the stack. | |
Item & | top () const |
Get the top item of the stack. | |
void | pop () |
Remove the top item from the stack. | |
void | reset () |
Reset the bucket stack. | |
bool | empty () const |
Check if the stack is empty. | |
typedef List::Iterator Puma::BCStack< Item, BUCKET_SIZE >::Iterator |
Iterator type for the bucket stack.
|
inline |
Construct an empty bucket stack.
|
inline |
Check if the stack is empty.
|
inline |
Get the length of the bucket stack.
|
inline |
Remove the top item from the stack.
|
inline |
Push a new item on top of the stack.
item | The item to add. |
|
inline |
Reset the bucket stack.
Does not delete the stack items.
|
inline |
Get the top item of the stack.