Module: Essential Tools Module Group: RWCollectable Classes
RWSlistCollectablesStackRWSlistCollectablesRWSequenceable... ... RWCollectionRWCollectable
// Smalltalk typedef: typedef RWSlistCollectablesStack Stack; #include <rw/stackcol.h> RWSlistCollectablesStack a;
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 std::Stack.
Polymorphic
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.
void operator=(const RWSlistCollectablesStack& s);
Assignment operator. A shallow copy of the stack s is made.
virtual void apply(RWapplyCollectable ap, void*); virtual RWspace binaryStoreSize() const; virtual void clear();
Inherited from class RWSlistCollectables.
virtual void clearAndDestroy(); virtual bool contains(const RWCollectable* target) const;
Inherited from class RWCollection.
bool containsReference(const RWCollectable* e) const; virtual size_t entries() const;
Inherited from class RWSlistCollectables.
virtual RWCollectable* first() const;
Inherited from class RWSlistCollectables. Same as top().
virtual RWCollectable* insert(RWCollectable* c);
Inherited from class RWSlistCollectables. Same as push().
virtual RWClassID isA() const;
Redefined from class RWCollectable to return __RWSLISTCOLLECTABLESSTACK.
virtual bool isEmpty()const;
Inherited from class RWSlistCollectables.
virtual RWCollectable* last() const;
Inherited from class RWSlistCollectables. Returns the item at the bottom of the stack.
virtual size_t occurrencesOf(const RWCollectable* target) const; size_t occurrencesOfReference(const RWCollectable* e) const;
Inherited from class RWSlistCollectables.
RWCollectable* pop();
Removes and returns the item at the top of the stack, or returns nil if the stack is empty.
void push(RWCollectable*);
Adds an item to the top of the stack.
virtual RWCollectable* remove(const RWCollectable*);
Redefined from class RWSlistCollectables. Calls pop(). The argument is ignored.
RWCollectable* top() const;
Returns the item at the top of the stack or nil if the stack is empty.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.