SourcePro® 2022.1 |
SourcePro® API Reference Guide |
Finds items that have the same address as the key. More...
#include <rw/idenset.h>
Public Member Functions | |
RWIdentitySet () | |
RWIdentitySet (size_t N) | |
RWIdentitySet (const RWIdentitySet &s) | |
RWIdentitySet (RWIdentitySet &&s) | |
virtual RWCollectable * | copy () const |
virtual RWCollectable * | find (const RWCollectable *) const |
virtual RWCollectable * | insert (RWCollectable *) |
virtual RWClassID | isA () const |
virtual bool | isEqual (const RWCollectable *) const |
virtual RWCollectable * | newSpecies () const |
RWIdentitySet & | operator= (const RWIdentitySet &s) |
RWIdentitySet & | operator= (RWIdentitySet &&s) |
virtual RWCollectable * | remove (const RWCollectable *) |
Public Member Functions inherited from RWSet | |
RWSet () | |
RWSet (size_t n) | |
RWSet (const RWSet &h) | |
RWSet (RWSet &&h) | |
virtual | ~RWSet () |
virtual void | clearAndDestroy () |
void | intersectWith (const RWSet &h, RWSet &ret) const |
virtual RWConstIterator * | newConstIterator () const |
virtual RWIterator * | newIterator () |
virtual size_t | occurrencesOf (const RWCollectable *target) const |
RWSet & | operator*= (const RWSet &h) |
bool | operator< (const RWSet &h) const |
bool | operator<= (const RWSet &h) const |
RWSet & | operator= (const RWSet &h) |
RWSet & | operator= (RWSet &&h) |
Public Member Functions inherited from RWHashTable | |
RWHashTable () | |
RWHashTable (size_t N) | |
RWHashTable (const RWHashTable &t) | |
RWHashTable (RWHashTable &&t) | |
virtual void | apply (RWapplyCollectable ap, void *) |
virtual void | clear () |
virtual size_t | entries () const |
virtual bool | isEmpty () const |
bool | operator!= (const RWHashTable &) const |
bool | operator<= (const RWHashTable &t) const |
RWHashTable & | operator= (const RWHashTable &t) |
RWHashTable & | operator= (RWHashTable &&t) |
bool | operator== (const RWHashTable &t) const |
virtual void | resize (size_t n=0) |
void | swap (RWHashTable &t) |
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 bool | contains (const RWCollectable *target) const |
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 unsigned | hash () const |
RWspace | recursiveStoreSize () const |
RWStringID | stringID () const |
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 *) |
The class RWIdentitySet is similar to class RWSet except that items are found by requiring that they be identical (i.e., have the same address) as the key, rather than being equal (i.e., test true
for isEqual()).
The iterator for this class is RWSetIterator.
RWIdentitySet::RWIdentitySet | ( | ) |
Constructs an empty identity set with RWCollection::DEFAULT_CAPACITY hashing buckets.
RWIdentitySet::RWIdentitySet | ( | size_t | N | ) |
Constructs an empty identity set with N hashing buckets.
|
inline |
Copy constructor. Makes a shallow copy of the collection s.
|
inline |
Move constructor. The constructed RWIdentitySet takes ownership of the data owned by s.
|
virtual |
Returns a new, copy-constructed object of the same type as self. The caller is responsible for deleting the object.
Reimplemented from RWSet.
|
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").
Reimplemented from RWHashTable.
|
virtual |
Adds c to the collection and returns it. If an item is already in the collection which isEqual() to c, then the existing item is returned and the new item is not inserted.
Reimplemented from RWSet.
|
virtual |
Returns the unique ID for RWIdentitySet.
Reimplemented from RWSet.
|
virtual |
Behaves as if compareTo(t) was invoked, returning true
if the result equals 0, false
otherwise.
Reimplemented from RWSet.
|
virtual |
Returns a new, default-constructed object of the same type as self. The caller is responsible for deleting the object.
Reimplemented from RWSet.
|
inline |
Assignment operator. Makes a shallow copy of the collection s.
|
inline |
Move assignment. Self takes ownership of the data owned by s.
|
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.
Reimplemented from RWHashTable.
Copyright © 2022 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |