SourcePro® 2024.1 |
SourcePro® API Reference Guide |
Represents a group of ordered elements without keyed access, where duplicates are allowed. More...
#include <rw/slistcol.h>
Friends | |
class | RWSlistCollectablesIterator |
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 Symbols 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 RWSlistCollectables represents a group of ordered elements, without keyed access. Duplicates are allowed. The ordering of elements is determined externally, by the order of insertion and removal. An object stored by RWSlistCollectables must inherit from abstract base class RWCollectable.
You must use the virtual function RWCollectable::isEqual() to find a match between a target and an item in the collection.
Class RWSlistCollectables is implemented as a singly-linked list, which allows for efficient insertion and removal, but efficient movement in only one direction. This class corresponds to the Smalltalk class LinkedList.
RWSlistCollectables::RWSlistCollectables | ( | ) |
Constructs an empty linked list.
|
inline |
Constructs a linked list with single item a.
|
inline |
Makes a shallow copy of lst.
|
inline |
Move constructor. The constructed RWSlistCollectables takes ownership of the data owned by lst.
|
inlinevirtual |
Adds a to the end of the collection and returns it. Returns rwnil if the insertion was unsuccessful.
Implements RWSequenceable.
Reimplemented in RWSlistCollectablesStack.
|
inlinevirtual |
Invokes the function pointer ap on each item in the collection, in order from first to last.
Implements RWSequenceable.
|
inlinevirtual |
The index i must be between 0
and the number of items in the collection less one, or an exception of type RWBoundsErr is thrown.
Implements RWSequenceable.
|
inlinevirtual |
The index i must be between 0
and the number of items in the collection less one, or an exception of type RWBoundsErr is thrown.
Implements RWSequenceable.
|
inlinevirtual |
Removes all objects from the collection. Does not delete the objects themselves.
Implements RWSequenceable.
|
inlinevirtual |
Returns true
if the collection contains an item where the virtual function find() returns non-nil.
Reimplemented from RWCollection.
|
inline |
Returns true
if the list contains an item that is identical to the item pointed to by e (that is, that has the address e).
|
virtual |
Returns a new, copy-constructed object of the same type as self. The caller is responsible for deleting the object.
Reimplemented from RWCollectable.
Reimplemented in RWSlistCollectablesQueue, and RWSlistCollectablesStack.
|
inlinevirtual |
Returns the total number of items in the collection.
Implements RWSequenceable.
|
inlinevirtual |
Returns the first item that matches target, or rwnil if no item is found.
Implements RWSequenceable.
|
inline |
Returns the first item that is identical to the item pointed to by e (that is, that has the address e), or rwnil if none is found.
|
inlinevirtual |
Returns the first item in the collection.
Implements RWSequenceable.
|
inline |
Returns and removes the item at the beginning of the list.
|
inlinevirtual |
Returns the index of the first item that isEqual() to the item pointed to by c. If there is no such item, returns RW_NPOS.
Implements RWSequenceable.
|
inlinevirtual |
Adds the item a to the end of the collection and returns it. Returns rwnil if the insertion was unsuccessful.
Implements RWSequenceable.
Reimplemented in RWSlistCollectablesStack.
|
inlinevirtual |
Adds a new item to the collection at position indx. The item previously at position i
is moved to i+1
, etc. The index indx must be between 0
and the number of items in the collection, or an exception of type RWBoundsErr will be thrown.
Implements RWSequenceable.
|
virtual |
Returns __RWSLISTCOLLECTABLES
, i.e. a class identifier, that identifies this object's class.
Reimplemented from RWCollection.
Reimplemented in RWSlistCollectablesQueue, and RWSlistCollectablesStack.
|
inlinevirtual |
Returns true
if the collection is empty, otherwise returns false
.
Implements RWSequenceable.
|
virtual |
Behaves as if compareTo(t) was invoked, returning true
if the result equals 0, false
otherwise.
Reimplemented from RWCollectable.
Reimplemented in RWSlistCollectablesQueue, and RWSlistCollectablesStack.
|
inlinevirtual |
Returns the last item in the collection.
Implements RWSequenceable.
|
virtual |
Returns a const pointer to a dynamically allocated iterator for the collection.
Implements RWCollection.
|
virtual |
Returns a dynamically allocated iterator for the collection.
Implements RWCollection.
|
virtual |
Returns a new, default-constructed object of the same type as self. The caller is responsible for deleting the object.
Reimplemented from RWCollectable.
Reimplemented in RWSlistCollectablesQueue, and RWSlistCollectablesStack.
|
inlinevirtual |
Returns the number of items that compare isEqual() to the item pointed to by target.
Implements RWSequenceable.
|
inline |
Returns the number of items that are identical to the item pointed to by e (that is, that have the address e).
|
inline |
Assignment operator. Makes a shallow copy of rhs.
|
inline |
Move assignment. Self takes ownership of the data owned by rhs.
bool RWSlistCollectables::operator== | ( | const RWSlistCollectables & | s | ) | const |
Returns true
if self and s have the same number of members and if, for every item in self, the corresponding item at the same index in s isEqual() to it.
|
inlinevirtual |
Adds c to the beginning of the collection and returns it. Returns rwnil if the insertion was unsuccessful.
Implements RWSequenceable.
Reimplemented in RWSlistCollectablesQueue.
|
inlinevirtual |
Removes and returns the first item that isEqual() to the item pointed to by target. Returns rwnil if there is no such item.
Implements RWSequenceable.
Reimplemented in RWSlistCollectablesQueue, and RWSlistCollectablesStack.
|
inline |
Removes and returns the first item that is identical to the item pointed to by e (that is, that has the address e). Returns rwnil if there is no such item.
Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |