Skip to content

CSortedMap<TKey, TValue>

CSortedMap<TKey,TValue>

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

Description

The CSortedMap<TKey,TValue> class is an implementation of a dynamic hash table whose data are stored as key/value pairs sorted by key and 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 CSortedMap : public IMap<TKey, TValue>

Header

#include <Generic\SortedMap.mqh>

Inheritance Hierarchy

ICollection

IMap

CSortedMap

Class Methods

MethodDescription
AddAdds a key/value pair to the hash table
CountReturns the number of elements in the sorted hash table
ContainsDetermines whether the sorted hash table contains the specified key/value table
ContainsKeyDetermines whether the sorted hash table contains the key/value table with the specified key
ContainsValueDetermines whether the sorted hash table contains the key/value table with the specified value
ComparerReturns a pointer to the IComparer interface, used to organize a sorted hash table
CopyToCopies all key/value pairs from the sorted hash table to the specified arrays, starting at the specified index
ClearRemoves all elements from the sorted hash table
RemoveRemoves the first occurrence of the key/value pair from the sorted hash table
TryGetValueGets an element with the specified key from the sorted hash table
TrySetValueChanges a key/value pair with the specified key from the sorted hash table
Last updated on