Go to the first, previous, next, last section, table of contents.


CNStack -- Stack

SYNOPSIS

#include <CNCL/Stack.h>

TYPE

CN_STACK

BASE CLASSES

CNQueue

DERIVED CLASSES

None

RELATED CLASSES

CNDLList, CNQueueFIFO, CNQueueLIFO, CNQueueRandom, CNQueueSPT, CNPrioQueueFIFO, CNSink, CNJob

DESCRIPTION

CNStack is a stack, implemented as a LIFO queue which can hold any number of CNCL compatible objects. It acts very much like a LIFO queue but provides another kind of user interface.

Constructors:

CNStack();
CNStack(CNParam *param);
CNStack(long elem);
Initialize the Stack, optionally setting the size.

In addition to the member functions required by CNCL, CNStack provides:

bool empty();
Returns TRUE when stack is empty.
long depth() const;
Returns the number of objects on the stack.
void push(CNObject *obj);
Pushes an object onto the stack.
CNObject *pull();
Retrieves the last object from the stack.
CNObject *pop();
An alias for pull(). Retrieves the last object from the stack.
void clear();
Deletes all objects on the stack.
long size();
void size(long num);
Gets/sets the maximum depth of the stack.


Go to the first, previous, next, last section, table of contents.