SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Finds items that have the same address as the key. More...
#include <rw/idenset.h>
Public Member Functions | |
virtual RWCollectable * | newSpecies () const |
virtual RWClassID | isA () const |
RWIdentitySet (size_t N=RWCollection::DEFAULT_CAPACITY) | |
RWIdentitySet (const RWIdentitySet &s) | |
RWIdentitySet (RWIdentitySet &&s) | |
RWIdentitySet & | operator= (const RWIdentitySet &s) |
RWIdentitySet & | operator= (RWIdentitySet &&s) |
virtual RWCollectable * | find (const RWCollectable *) const |
virtual RWCollectable * | insert (RWCollectable *) |
virtual RWCollectable * | remove (const RWCollectable *) |
virtual bool | isEqual (const RWCollectable *) const |
Static Public Member Functions | |
static RWClassID | classIsA () |
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.
#include <rw/idenset.h> typedef RWIdentitySet IdentitySet; // Smalltalk typedef RWIdentitySet a;
Polymorphic
RWIdentitySet::RWIdentitySet | ( | size_t | N = RWCollection::DEFAULT_CAPACITY |
) |
Constructs an empty identity set with N hashing buckets.
RWIdentitySet::RWIdentitySet | ( | const RWIdentitySet & | s | ) | [inline] |
Copy constructor. Makes a shallow copy of the collection s.
RWIdentitySet::RWIdentitySet | ( | RWIdentitySet && | s | ) | [inline] |
Move constructor. The constructed RWIdentitySet takes ownership of the data owned by s.
static RWClassID RWIdentitySet::classIsA | ( | ) | [static] |
virtual RWCollectable* RWIdentitySet::find | ( | const RWCollectable * | target | ) | const [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 RWCollectable* RWIdentitySet::insert | ( | RWCollectable * | c | ) | [virtual] |
virtual RWClassID RWIdentitySet::isA | ( | ) | const [virtual] |
Returns the unique ID for RWIdentitySet.
Reimplemented from RWSet.
virtual bool RWIdentitySet::isEqual | ( | const RWCollectable * | t | ) | const [virtual] |
Returns true
if the collectable object "matches" the object at address t. The default definition is:
return this == t;
i.e., both objects have the same address (a test for identity). The definition may be redefined in any consistent way.
Reimplemented from RWSet.
virtual RWCollectable* RWIdentitySet::newSpecies | ( | ) | const [virtual] |
Allocates a new object off the heap of the same type as self and returns a pointer to it. You are responsible for deleting the object when done with it.
Reimplemented from RWSet.
RWIdentitySet& RWIdentitySet::operator= | ( | RWIdentitySet && | s | ) | [inline] |
Move assignment. Self takes ownership of the data owned by s.
RWIdentitySet& RWIdentitySet::operator= | ( | const RWIdentitySet & | s | ) | [inline] |
Assignment operator. Makes a shallow copy of the collection s.
virtual RWCollectable* RWIdentitySet::remove | ( | const RWCollectable * | target | ) | [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 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.