#include <e32hashtab.h>
class RPtrHashSet : public RHashTableBase |
Public Member Type Definitions | |
---|---|
typedef | TPtrHashSetIter< T > TIter |
Public Member Functions | |
---|---|
RPtrHashSet(const THashFunction32< T > &, const TIdentityRelation< T > &) | |
RPtrHashSet() | |
void | Close() |
TInt | Count() |
const T * | Find(const T &) |
T * | Find(const T &) |
const T & | FindL(const T &) |
T & | FindL(const T &) |
TInt | Insert(const T *) |
void | InsertL(const T *) |
TInt | Remove(const T *) |
TInt | Reserve(TInt) |
void | ReserveL(TInt) |
void | ResetAndDestroy() |
Inherited Enumerations | |
---|---|
RHashTableBase:TDefaultSpecifier | |
RHashTableBase:TElementState |
A templated class which implements an unordered extensional set of objects of type T using a probe-sequence hash table. The objects are not copied into the set when they are added; rather the set stores pointers to the contained objects.
typedef TPtrHashSetIter< T > | TIter |
A class which allows iteration over the elements of a RPtrHashSet<T> class.
The set being iterated over may not be modified while an iteration is in progress or the iteration operations may malfunction or panic.
See also: TPtrHashSetIter<T>
RPtrHashSet | ( | const THashFunction32< T > & | aHash, |
const TIdentityRelation< T > & | aIdentity | ||
) | [inline] |
Construct a set of objects of type T using a specified hash function and identity relation. The set is initially empty.
Parameters | |
---|---|
aHash | The hash function used to hash the objects of type T. |
aIdentity | The identity relation used to determine if two objects of type T should be considered identical. |
RPtrHashSet | ( | ) | [inline] |
Construct a set of objects of type T using a default hash function and identity relation. The set is initially empty.
void | Close | ( | ) | [inline] |
Reimplemented from RHashTableBase::Close()
Free all memory used by this set. Returns the set to the same state it had following construction.
TInt | Count | ( | ) | const [inline] |
Reimplemented from RHashTableBase::Count()const
Query the number of elements in the set.
const T * | Find | ( | const T & | aKey | ) | const [inline] |
Locate a specified element in the set.
Parameters | |
---|---|
aKey | The object of type T to search for. |
T * | Find | ( | const T & | aKey | ) | [inline] |
Locate a specified element in the set.
Parameters | |
---|---|
aKey | The object of type T to search for. |
const T & | FindL | ( | const T & | aKey | ) | const [inline] |
Locate a specified element in the set.
Parameters | |
---|---|
aKey | The object of type T to search for. |
Leave Codes | |
---|---|
KErrNotFound | if the specified object is not a member of this set. |
T & | FindL | ( | const T & | aKey | ) | [inline] |
Locate a specified element in the set.
Parameters | |
---|---|
aKey | The object of type T to search for. |
Leave Codes | |
---|---|
KErrNotFound | if the specified object is not a member of this set. |
TInt | Insert | ( | const T * | aKey | ) | [inline] |
Insert an element into the set.
If the specified object is not currently a member of the set, a pointer to the object is added to the set and KErrNone is returned. If the specified object is currently a member of the set, the existing pointer to the object is replaced by the provided pointer and KErrNone is returned. In both cases only a pointer to the object is stored - the object is never copied.
Parameters | |
---|---|
aKey | A pointer to the object of type T to add to the set. |
void | InsertL | ( | const T * | aKey | ) | [inline] |
Insert an element into the set.
If the specified object is not currently a member of the set, a pointer to the object is added to the set and KErrNone is returned. If the specified object is currently a member of the set, the existing pointer to the object is replaced by the provided pointer and KErrNone is returned. In both cases only a pointer to the object is stored - the object is never copied.
Parameters | |
---|---|
aKey | A pointer to the object of type T to add to the set. |
Leave Codes | |
---|---|
KErrNoMemory | if memory could not be allocated to store the pointer to the new object. |
TInt | Remove | ( | const T * | aKey | ) | [inline] |
Remove an element from the set.
Parameters | |
---|---|
aKey | A pointer to the object to be removed. |
Reimplemented from RHashTableBase::Reserve(TInt)
Expand the set to accommodate a specified number of elements. If the set already has enough space for the specified number of elements, no action is taken. Any elements already in the set are retained.
Parameters | |
---|---|
aCount | The number of elements for which space should be allocated. |
void | ReserveL | ( | TInt | aCount | ) | [inline] |
Reimplemented from RHashTableBase::ReserveL(TInt)
Expand the set to accommodate a specified number of elements. If the set already has enough space for the specified number of elements, no action is taken. Any elements already in the set are retained.
Parameters | |
---|---|
aCount | The number of elements for which space should be allocated. |
Leave Codes | |
---|---|
KErrNoMemory | if sufficient memory could not be allocated. |