Represents a group of ordered items, not accessible by an external key. More...
#include <rw/dlistcol.h>
Static Public Member Functions | |
static RWClassID | classIsA () |
Static Public Member Functions inherited from RWCollectable | |
static RWClassID | classID (const RWStringID &name) |
static RWClassID | classIsA () |
static bool | isAtom (RWClassID id) |
static RWspace | nilStoreSize () |
Additional Inherited Members | |
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 RWDlistCollectables represents a group of ordered items, not accessible by an external key. Duplicates are allowed. The ordering of elements is determined externally, generally by the order of insertion and removal. An object stored by RWDlistCollectables must inherit the abstract base class RWCollectable.
Class RWDlistCollectables is implemented as a doubly-linked list, which allows for efficient insertion and removal, as well as for movement in either direction.
|
inline |
Constructs an empty doubly-linked list.
|
inline |
Constructs a linked list with a single item a.
|
inline |
Makes a shallow copy of lst.
|
inlinevirtual |
Empty Destructor.
|
inline |
Move constructor. The constructed RWDlistCollectables takes ownership of the data owned by lst.
|
inlinevirtual |
Inserts the item at the end of the collection and returns it. Returns rwnil if the insertion was unsuccessful.
Implements RWSequenceable.
|
inlinevirtual |
Invokes the function pointer ap on each member in the collection, in order, from first to last.
Implements RWSequenceable.
|
inlinevirtual |
Allows access to the i th element of the collection. The value i must be between zero and the number of items in the collection less one, or the function throws an exception of type RWBoundsErr. Note that for a linked list, these functions must traverse all the links, making them particularly inefficient.
Implements RWSequenceable.
|
inlinevirtual |
Allows access to the i th element of the collection. The value i must be between zero and the number of items in the collection less one, or the function throws an exception of type RWBoundsErr. Note that for a linked list, these functions must traverse all the links, making them particularly inefficient.
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.
|
inlinevirtual |
Returns the total number of items in the collection.
Implements RWSequenceable.
|
inlinevirtual |
Returns the first item that RWCollecatble::isEqual() to the item pointed to by 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 item at the beginning of the list.
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, or RW_NPOS if there is no such index.
Implements RWSequenceable.
|
inlinevirtual |
Adds the item to the end of the collection and returns it. Returns rwnil if the insertion was unsuccessful.
Implements RWSequenceable.
|
inlinevirtual |
Adds a new item to the collection at position inx. The item previously at position i is moved to i + 1, and so forth. The index inx must be between zero and the number of items in the collection, or the function throws an exception of type RWBoundsErr.
Implements RWSequenceable.
|
virtual |
Returns the unique ID for RWDlistCollectables.
Reimplemented from RWCollection.
|
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.
|
inlinevirtual |
Returns the item at the end of the list.
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.
|
inlinevirtual |
Returns the number of items that 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 |
Move assignment. Self takes ownership of the data owned by rhs.
|
inline |
Assignment operator. Makes a shallow copy of rhs.
bool RWDlistCollectables::operator== | ( | const RWDlistCollectables & | d | ) | const |
Returns true
if self and d have the same number of items and if, for every item in self, the corresponding item in the same position in d isEqual() to the item in self.
|
inlinevirtual |
Adds the item to the beginning of the collection and returns it. Returns rwnil if the insertion was unsuccessful.
Implements RWSequenceable.
|
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.
|
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 © 2021 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |