SourcePro® 2023.1 |
SourcePro® API Reference Guide |
A restricted interface to class RWSlistCollectables to implement a last in first out (LIFO) stack. More...
#include <rw/stackcol.h>
Private Member Functions | |
virtual RWCollectable * | append (RWCollectable *) |
virtual void | removeAndDestroy (const RWCollectable *) |
Additional Inherited Members | |
Static Public Member Functions inherited from RWCollectable | |
static RWClassID | classID (const RWStringID &name) |
static RWClassID | classIsA () |
static bool | isAtom (RWClassID id) |
static RWspace | nilStoreSize () |
Static Public Attributes inherited from RWCollection | |
static size_t | DEFAULT_CAPACITY |
Related Functions inherited from RWCollection | |
typedef void(* | RWapplyCollectable) (RWCollectable *, void *) |
typedef bool(* | RWtestCollectable) (const RWCollectable *, const void *) |
typedef bool(* | RWtestCollectablePair) (const RWCollectable *, const RWCollectable *, const void *) |
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 from abstract base class RWCollectable. You must use the virtual function isEqual() (see class RWCollectable) to find a match between a target and an item in the stack.
This class corresponds to the Smalltalk class Stack.
RWSlistCollectablesStack::RWSlistCollectablesStack | ( | ) |
Constructs an empty stack.
|
inline |
Constructs a stack with one entry a.
|
inline |
Makes a shallow copy of stk.
|
inline |
Move constructor. The constructed RWSlistCollectablesStack takes ownership of the data owned by stk.
|
inlineprivatevirtual |
Adds a to the end of the collection and returns it. Returns rwnil if the insertion was unsuccessful.
Reimplemented from RWSlistCollectables.
|
virtual |
Returns a new, copy-constructed object of the same type as self. The caller is responsible for deleting the object.
Reimplemented from RWSlistCollectables.
|
inlinevirtual |
Same as push().
Reimplemented from RWSlistCollectables.
|
virtual |
Returns __RWSLISTCOLLECTABLESSTACK
, i.e. a class identifier, that identifies this object's class.
Reimplemented from RWSlistCollectables.
|
virtual |
Behaves as if compareTo(t) was invoked, returning true
if the result equals 0, false
otherwise.
Reimplemented from RWSlistCollectables.
|
virtual |
Returns a new, default-constructed object of the same type as self. The caller is responsible for deleting the object.
Reimplemented from RWSlistCollectables.
|
inline |
Move assignment. Self takes ownership of the data owned by rhs.
|
inline |
Assignment operator. Makes a shallow copy of rhs.
|
inline |
Removes and returns the item at the top of the stack, or returns rwnil if the stack is empty.
|
inline |
Adds an item to the top of the stack.
|
inlinevirtual |
Calls pop(). The argument is ignored.
Reimplemented from RWSlistCollectables.
|
inlineprivatevirtual |
Removes and deletes the first item in the collection which "matches" the object pointed to by target.
Reimplemented from RWCollection.
|
virtual |
Repeatedly calls the global operator:
followed by insert(RWCollectable*) for each item in the collection.
Reimplemented from RWCollection.
|
virtual |
Repeatedly calls the global operator:
followed by insert(RWCollectable*) for each item in the collection.
Reimplemented from RWCollection.
|
inline |
Returns the item at the top of the stack or returns nil
if the stack is empty.
Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |