SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
A hash table for key-value pairs. Items are found by requiring them to be identical. More...
#include <rw/idendict.h>
Public Member Functions | |
virtual RWCollectable * | newSpecies () const |
virtual RWClassID | isA () const |
RWIdentityDictionary (size_t n=RWCollection::DEFAULT_CAPACITY) | |
RWIdentityDictionary (const RWIdentityDictionary &h) | |
RWIdentityDictionary (RWIdentityDictionary &&h) | |
RWIdentityDictionary & | operator= (const RWIdentityDictionary &h) |
RWIdentityDictionary & | operator= (RWIdentityDictionary &&h) |
bool | operator<= (const RWIdentityDictionary &h) const |
bool | operator<= (const RWHashDictionary &) const |
bool | operator<= (const RWSet &) const |
bool | operator<= (const RWHashTable &) const |
virtual bool | isEqual (const RWCollectable *) const |
Static Public Member Functions | |
static RWClassID | classIsA () |
The class RWIdentityDictionary is implemented as a hash table, for the storage and retrieval of key-value pairs. Class RWIdentityDictionary is similar to class RWHashDictionary 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()).
Both keys and values must inherit from the abstract base class RWCollectable.
The iterator for this class is RWHashDictionaryIterator.
#include <rw/idendict.h> // Smalltalk typedef: typedef RWIdentityDictionary IdentityDictionary; RWIdentityDictionary a;
None
RWIdentityDictionary::RWIdentityDictionary | ( | size_t | n = RWCollection::DEFAULT_CAPACITY |
) |
Constructs an empty identity dictionary with n hashing buckets.
RWIdentityDictionary::RWIdentityDictionary | ( | const RWIdentityDictionary & | h | ) | [inline] |
Copy constructor. Makes a shallow copy of h.
RWIdentityDictionary::RWIdentityDictionary | ( | RWIdentityDictionary && | h | ) | [inline] |
Move constructor. The constructed RWIdentityDictionary takes ownership of the data owned by h.
static RWClassID RWIdentityDictionary::classIsA | ( | ) | [static] |
Returns the RWClassID of this class.
Reimplemented from RWHashDictionary.
virtual RWClassID RWIdentityDictionary::isA | ( | ) | const [virtual] |
Returns __RWIDENTITYDICTIONARY
.
Reimplemented from RWHashDictionary.
virtual bool RWIdentityDictionary::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 RWHashDictionary.
virtual RWCollectable* RWIdentityDictionary::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 RWHashDictionary.
bool RWIdentityDictionary::operator<= | ( | const RWHashTable & | t | ) | const |
Returns true
if self is a subset of t, that is, every element of self has a counterpart in t which isEqual().
Reimplemented from RWHashDictionary.
bool RWIdentityDictionary::operator<= | ( | const RWSet & | h | ) | const |
Returns true
if self is a subset of h, that is, every element of self has a counterpart in h which isEqual().
Reimplemented from RWHashDictionary.
bool RWIdentityDictionary::operator<= | ( | const RWHashDictionary & | hd | ) | const |
Returns true
if for every key-value pair in self, there is a corresponding key in hd that isEqual(). Their corresponding values must also be equal.
Reimplemented from RWHashDictionary.
bool RWIdentityDictionary::operator<= | ( | const RWIdentityDictionary & | h | ) | const [inline] |
Returns true
if self is a subset of h, that is, every element of self has a counterpart in h which isEqual(). This operator is not explicitly present unless you are compiling with an implementation of the C++ Standard Library. It is normally inherited from RWHashDictionary.
RWIdentityDictionary& RWIdentityDictionary::operator= | ( | RWIdentityDictionary && | h | ) | [inline] |
Move assignment. Self takes ownership of the data owned by h.
RWIdentityDictionary& RWIdentityDictionary::operator= | ( | const RWIdentityDictionary & | h | ) | [inline] |
Assignment operator. Makes a shallow copy of the collection h.
© 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.