Skip to content

CHashMap<TKey,TValue>

CHashMap<TKey, TValue>

CHashMap<TKey, TValue> is a generic class that implements the IMap<TKey, TValue> interface.

Description

The CHashMap<TKey, TValue> class is an implementation of the dynamic hash table, the data of which are stored in the form of unordered key/value pairs taking into account the key uniqueness requirement. This class provides basic methods to work with a hash table, such as to access a value by key, to search and delete a key/value pair, and others.

Declaration

template<typename TKey, typename TValue>
   class CHashMap : public IMap<TKey, TValue>

Header

#include <Generic\HashMap.mqh>

Inheritance Hierarchy

ICollection

IMap

CHashMap

Class Methods

MethodDescription
AddAdds a key/value pair to the hash table
CountReturns the number of elements in the hash table
ComparerReturns a pointer to the IEqualityComparer interface, used to organize a hash table
ContainsDetermines whether the hash table contains the specified key/value pair
ContainsKeyDetermines whether the hash table contains the key/value pair with the specified key
ContainsValueCHashMap<TKey, TValue> is a generic class that implements the IMap<TKey, TValue> interface
CopyToCopies all key/value pairs from the hash table to the specified arrays, starting at the specified index
ClearRemoves all elements from the hash table
RemoveRemoves the first occurrence of the key/value pair from the hash table
TryGetValueGets an element with the specified key from the hash table
TrySetValueChanges the value of a key/value pair from the hash table at the specified key
Last updated on