SourcePro® 2022.1 |
SourcePro® API Reference Guide |
Abstract base class for collections that can be accessed by an index. More...
#include <rw/seqcltn.h>
Public Member Functions | |
virtual RWCollectable * | append (RWCollectable *a)=0 |
virtual void | apply (RWapplyCollectable, void *)=0 |
virtual RWCollectable *& | at (size_t i)=0 |
virtual const RWCollectable * | at (size_t i) const =0 |
virtual void | clear ()=0 |
virtual size_t | entries () const =0 |
virtual RWCollectable * | find (const RWCollectable *) const =0 |
virtual RWCollectable * | first () const =0 |
virtual size_t | index (const RWCollectable *c) const =0 |
virtual RWCollectable * | insert (RWCollectable *)=0 |
virtual RWCollectable * | insertAt (size_t indx, RWCollectable *e)=0 |
virtual bool | isEmpty () const =0 |
virtual RWCollectable * | last () const =0 |
virtual size_t | occurrencesOf (const RWCollectable *) const =0 |
virtual RWCollectable * | prepend (RWCollectable *c)=0 |
virtual RWCollectable * | remove (const RWCollectable *)=0 |
Public Member Functions inherited from RWCollection | |
virtual | ~RWCollection () |
RWBag | asBag () const |
RWBinaryTree | asBinaryTree () const |
RWOrdered | asOrderedCollection () const |
RWSet | asSet () const |
RWBinaryTree | asSortedCollection () const |
virtual RWspace | binaryStoreSize () const |
virtual void | clearAndDestroy () |
virtual bool | contains (const RWCollectable *target) const |
virtual RWClassID | isA () const |
virtual RWConstIterator * | newConstIterator () const =0 |
virtual RWIterator * | newIterator ()=0 |
void | operator+= (const RWCollection &c) |
void | operator-= (const RWCollection &c) |
virtual void | removeAndDestroy (const RWCollectable *target) |
virtual void | restoreGuts (RWvistream &) |
virtual void | restoreGuts (RWFile &) |
virtual void | saveGuts (RWvostream &) const |
virtual void | saveGuts (RWFile &) const |
RWCollection * | select (RWtestCollectable tst, void *vp) const |
Public Member Functions inherited from RWCollectable | |
virtual | ~RWCollectable () |
virtual int | compareTo (const RWCollectable *) const |
virtual RWCollectable * | copy () const |
virtual unsigned | hash () const |
virtual bool | isEqual (const RWCollectable *t) const |
virtual RWCollectable * | newSpecies () const |
RWspace | recursiveStoreSize () const |
RWStringID | stringID () const |
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 RWSequenceable is an abstract base class for collections that can be accessed by an index. It inherits class RWCollection as a public base class and adds a few extra virtual functions. This documentation only describes these extra functions.
|
pure virtual |
Adds a to the end of the collection and returns it. Returns rwnil if the insertion was unsuccessful.
Implemented in RWSortedVector, RWSlistCollectablesStack, RWDlistCollectables, RWSlistCollectables, and RWOrdered.
|
pure virtual |
This function applies the user-supplied function pointed to by ap to each member of the collection. This function should have the following prototype:
The function yourApplyFunction()
can perform any operation on the item at address ctp
that does not change the hash value or sorting order of the item. Client data may be passed to this function through the second argument vp.
Implements RWCollection.
Implemented in RWDlistCollectables, RWSlistCollectables, and RWOrdered.
|
pure virtual |
Allows access to the i th element of the collection. The return value can be used as an lvalue. The index i must be between zero and the number of items in the collection less one, or the function throws an exception of type RWBoundsErr.
Implemented in RWSortedVector, RWDlistCollectables, RWSlistCollectables, and RWOrdered.
|
pure virtual |
Allows access to the i th element of the collection. The return value cannot be used as an lvalue. The index i must be between zero and the number of items in the collection less one, or an exception of type RWBoundsErr will be thrown.
Implemented in RWSortedVector, RWDlistCollectables, RWSlistCollectables, and RWOrdered.
|
pure virtual |
Removes all objects from the collection. Does not delete the objects themselves.
Implements RWCollection.
Implemented in RWDlistCollectables, RWSlistCollectables, and RWOrdered.
|
pure virtual |
Returns the total number of items in the collection.
Implements RWCollection.
Implemented in RWDlistCollectables, RWSlistCollectables, and RWOrdered.
|
pure virtual |
Returns a pointer to the first item in the collection which "matches" the object pointed to by target or rwnil if no item was found. For most collections, an item "matches" the target if either isEqual() or compareTo() find equivalence, whichever is appropriate for the actual collection type. However, the "identity collections" (i.e., RWIdentitySet and RWIdentityDictionary) look for an item with the same address (i.e., "is identical to").
Implements RWCollection.
Implemented in RWDlistCollectables, RWSlistCollectables, and RWOrdered.
|
pure virtual |
Returns the first item in the collection.
Implemented in RWDlistCollectables, RWSlistCollectables, and RWOrdered.
|
pure virtual |
Returns the index number of the first item that "matches" the item pointed to by c. If there is no such item, returns RW_NPOS. For most collections, an item "matches" the target if either isEqual() or compareTo() find equivalence, whichever is appropriate for the actual collection type.
Implemented in RWDlistCollectables, RWSlistCollectables, RWSortedVector, and RWOrdered.
|
pure virtual |
Adds an item to the collection and returns a pointer to it. If the item is already in the collection, some collections derived from RWCollection return the old instance, others return rwnil.
Implements RWCollection.
Implemented in RWDlistCollectables, RWSlistCollectables, RWSortedVector, RWOrdered, and RWSlistCollectablesStack.
|
pure virtual |
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.
Implemented in RWSortedVector, RWDlistCollectables, RWSlistCollectables, and RWOrdered.
|
pure virtual |
Returns true
if the collection is empty, otherwise returns false
.
Implements RWCollection.
Implemented in RWDlistCollectables, RWSlistCollectables, and RWOrdered.
|
pure virtual |
Returns the last item in the collection.
Implemented in RWDlistCollectables, RWSlistCollectables, and RWOrdered.
|
pure virtual |
Returns the number of items in the collection which are "matches" for t. See function find() for a definition of matches.
Implements RWCollection.
Implemented in RWDlistCollectables, RWSlistCollectables, RWSortedVector, and RWOrdered.
|
pure virtual |
Adds c to the beginning of the collection and returns it. Returns rwnil if the insertion was unsuccessful.
Implemented in RWDlistCollectables, RWSlistCollectables, RWSortedVector, RWOrdered, and RWSlistCollectablesQueue.
|
pure virtual |
Removes and returns a pointer to the first item in the collection which "matches" the object pointed to by target. Returns nil
if no object was found. Does not delete the object. See function find() for a definition of matches.
Implements RWCollection.
Implemented in RWDlistCollectables, RWSlistCollectables, RWOrdered, RWSlistCollectablesStack, and RWSlistCollectablesQueue.
Copyright © 2022 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |