Tools.h++ Manual

21-178 104011 Tandem Computers Incorporated
21
RWSlistCollectablesStack
RWSlistCollectablesStack
|
RWSlistCollectables
||
RWSequenceable RWSlist
|
RWCollection
|
RWCollectable
Synopsis
// Smalltalk typedef:
typedef RWSlistCollectablesStackStack;
#include <rw/stackcol.h>
RWSlistCollectablesStack a
;
Description Class
RWSlistCollectablesStack
represents a restricted interface to class
RWSlistCollectables
to implement a last in first out (LIFO) stack. A Stack
is a sequential list for which all insertions and deletions are made at one end
(the beginning of the list). Hence, the ordering is determined externally by the
ordering of the insertions. Duplicates are allowed.
An object stored by
RWSlistCollectablesStack
must inherit abstract base
class
RWCollectable
. The virtual function
isEqual()
(see class
RWCollectable
) is required to find a match between a target and an item in
the stack.
This class corresponds to the
Smalltalk
class
Stack
.
Public constructors
RWSlistCollectablesStack();
Construct an empty stack.
RWSlistCollectablesStack(RWCollectable* a);
Construct a stack with one entry
a
.
RWSlistCollectablesStack(const RWSlistCollectablesStack&
s);
Copy constructor. A shallow copy of the stack
s
is made.