HashMap<K, T, H, C> Class

An associative array of key-value pairs that are organized in a Hashtable .

The elements need not be ordered, but you must be able to compare them for equality ( EqualTo ) or other equality-like relation provided as the fourth template argument.

The third template argument is a hash function object that is by default the Hasher function object that delegates the computation of the hash function for the element to one of the GetHashCode function overloads. If there is not a GetHashCode overload for the your element type, you can provide your own, and it should work with the standard Hasher .

Adding an element to the hash map depends on the hash function, but can be thought as O(1) operation. Searching for an element in a hash map depends on the hash function, but can be thought as O(1) operation.

Model of ForwardContainer .

Template Parameters

K
T
H Hasher<K>
C EqualTo<K>

Constraint

K  is  Semiregular  and  T  is  Semiregular  and  HashFunction <H , Kand  C  is  Relation  and  C .Domain is  K

Member Functions

public inline nothrow HashtableIterator<Pair<K, T>, Pair<K, T>&, Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> Begin()
public inline nothrow HashtableIterator<Pair<K, T>, const Pair<K, T>&, const Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> Begin() const
public inline nothrow HashtableIterator<Pair<K, T>, const Pair<K, T>&, const Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> CBegin() const
public inline nothrow HashtableIterator<Pair<K, T>, const Pair<K, T>&, const Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> CEnd() const
public inline nothrow HashtableIterator<Pair<K, T>, const Pair<K, T>&, const Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> CFind(const K& key) const
public inline nothrow void Clear()
public inline nothrow long Count() const
public inline nothrow HashtableIterator<Pair<K, T>, Pair<K, T>&, Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> End()
public inline nothrow HashtableIterator<Pair<K, T>, const Pair<K, T>&, const Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> End() const
public inline nothrow HashtableIterator<Pair<K, T>, Pair<K, T>&, Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> Find(const K& key)
public inline nothrow HashtableIterator<Pair<K, T>, const Pair<K, T>&, const Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> Find(const K& key) const
public inline Pair<HashtableIterator<Pair<K, T>, Pair<K, T>&, Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>>, bool> Insert(const Pair<K, T>& value)
public inline nothrow bool IsEmpty() const
public inline nothrow void Remove(HashtableIterator<Pair<K, T>, Pair<K, T>&, Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> pos)
public inline nothrow void Remove(const K& key)
public inline T& operator[](const K& key)

Typedefs

public typedef Compare C
public typedef ConstIterator HashtableIterator<Pair<K, T>, const Pair<K, T>&, const Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>>
public typedef HashFun H
public typedef Iterator HashtableIterator<Pair<K, T>, Pair<K, T>&, Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>>
public typedef KeyType K
public typedef MappedType T
private typedef Self HashMap
private typedef TableType Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>
public typedef ValueType Pair<K, T>

Member Variables

private Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C> table

Member Function Details

Begin Member Function

public inline nothrow HashtableIterator<Pair<K, T>, Pair<K, T>&, Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> Begin()

Definition
Line 25 of System.Base/HashMap.cm


Begin Member Function

public inline nothrow HashtableIterator<Pair<K, T>, const Pair<K, T>&, const Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> Begin()

Definition
Line 29 of System.Base/HashMap.cm


CBegin Member Function

public inline nothrow HashtableIterator<Pair<K, T>, const Pair<K, T>&, const Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> CBegin()

Definition
Line 33 of System.Base/HashMap.cm


CEnd Member Function

public inline nothrow HashtableIterator<Pair<K, T>, const Pair<K, T>&, const Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> CEnd()

Definition
Line 45 of System.Base/HashMap.cm


CFind Member Function

public inline nothrow HashtableIterator<Pair<K, T>, const Pair<K, T>&, const Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> CFind(const K& key)

Definition
Line 69 of System.Base/HashMap.cm


Clear Member Function

public inline nothrow void Clear()

Definition
Line 57 of System.Base/HashMap.cm


Count Member Function

public inline nothrow long Count()

Definition
Line 49 of System.Base/HashMap.cm


End Member Function

public inline nothrow HashtableIterator<Pair<K, T>, Pair<K, T>&, Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> End()

Definition
Line 37 of System.Base/HashMap.cm


End Member Function

public inline nothrow HashtableIterator<Pair<K, T>, const Pair<K, T>&, const Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> End()

Definition
Line 41 of System.Base/HashMap.cm


Find Member Function

public inline nothrow HashtableIterator<Pair<K, T>, Pair<K, T>&, Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> Find(const K& key)

Definition
Line 61 of System.Base/HashMap.cm


Find Member Function

public inline nothrow HashtableIterator<Pair<K, T>, const Pair<K, T>&, const Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> Find(const K& key)

Definition
Line 65 of System.Base/HashMap.cm


Insert Member Function

public inline Pair<HashtableIterator<Pair<K, T>, Pair<K, T>&, Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>>, bool> Insert(const Pair<K, T>& value)

Definition
Line 79 of System.Base/HashMap.cm


IsEmpty Member Function

public inline nothrow bool IsEmpty()

Definition
Line 53 of System.Base/HashMap.cm


Remove Member Function

public inline nothrow void Remove(HashtableIterator<Pair<K, T>, Pair<K, T>&, Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> pos)

Definition
Line 87 of System.Base/HashMap.cm


Remove Member Function

public inline nothrow void Remove(const K& key)

Definition
Line 83 of System.Base/HashMap.cm


operator[] Member Function

public inline T& operator[](const K& key)

Definition
Line 73 of System.Base/HashMap.cm