Hash table collection.
More...
#include <base/collection/HashTable.h>
Inherits Collection.
template<class KEY, class VALUE>
class HashTable< KEY, VALUE >
Hash table collection.
A hash table implementation.
- Version
- 1.2
- Examples
- testsuite/eval.cpp, testsuite/HashTable.cpp, and testsuite/ls.cpp.
◆ HashTableAssociation
template<class KEY , class VALUE >
The type of an association in the hash table.
◆ Key
template<class KEY , class VALUE >
◆ ReadEnumerator
template<class KEY , class VALUE >
Non-modifying enumerator.
◆ ReadValueEnumerator
template<class KEY , class VALUE >
Non-modifying value enumerator.
◆ Value
template<class KEY , class VALUE >
◆ ValueEnumerator
template<class KEY , class VALUE >
Modifying value enumerator.
◆ HashTable() [1/3]
template<class KEY , class VALUE >
Initializes an hash table.
◆ HashTable() [2/3]
template<class KEY , class VALUE >
Initializes the hash table with the specified initial capacity.
◆ HashTable() [3/3]
template<class KEY , class VALUE >
Initializes hash table from other hash table.
◆ add() [1/5]
template<class KEY , class VALUE >
Adds the key and value to the table.
◆ add() [2/5]
template<class KEY , class VALUE >
Adds the key and value to the table.
◆ add() [3/5]
template<class KEY , class VALUE >
Adds the key and value to the table.
◆ add() [4/5]
template<class KEY , class VALUE >
Adds the key and value to the table.
◆ add() [5/5]
template<class KEY , class VALUE >
Adds the key and value to the table.
◆ copyOnWrite()
template<class KEY , class VALUE >
void HashTable< KEY, VALUE >::copyOnWrite |
( |
| ) |
|
|
inline |
Copies the hash set if referenced by multiple automation pointers.
◆ find() [1/2]
template<class KEY , class VALUE >
Returns the value associated with the specified key.
- Parameters
-
- Returns
- nullptr is key doesn't exist.
◆ find() [2/2]
template<class KEY , class VALUE >
Returns the value associated with the specified key.
- Parameters
-
- Returns
- nullptr is key doesn't exist.
◆ getCapacity()
template<class KEY , class VALUE >
MemorySize HashTable< KEY, VALUE >::getCapacity |
( |
| ) |
const |
|
inlinenoexcept |
Returns the capacity of the hash table.
◆ getReadEnumerator()
template<class KEY , class VALUE >
Returns a enumerator of the hash table for non-modifying access.
◆ getReadValueEnumerator()
template<class KEY , class VALUE >
Returns a enumerator of the values of the hash table for non-modifying access.
◆ getSize()
template<class KEY , class VALUE >
MemorySize HashTable< KEY, VALUE >::getSize |
( |
| ) |
const |
|
inlinenoexcept |
Returns the number of elements in the hash table.
◆ getValue()
template<class KEY , class VALUE >
Returns the value associated with the specified key. Raises InvalidKey if the specified key doesn't exist in this hash table.
- Parameters
-
◆ getValueEnumerator()
template<class KEY , class VALUE >
Returns a enumerator of the values of the hash table for modifying access.
◆ hasKey()
template<class KEY , class VALUE >
bool HashTable< KEY, VALUE >::hasKey |
( |
const Key & |
key | ) |
const |
|
inlinenoexcept |
Returns true if the specified value is a key in the table.
◆ isEmpty()
template<class KEY , class VALUE >
bool HashTable< KEY, VALUE >::isEmpty |
( |
| ) |
const |
|
inlinenoexcept |
Returns true if the hash table is empty.
◆ operator bool()
template<class KEY , class VALUE >
HashTable< KEY, VALUE >::operator bool |
( |
| ) |
const |
|
inlinenoexcept |
Returns true is non-empty.
◆ operator<<() [1/2]
template<class KEY , class VALUE >
◆ operator<<() [2/2]
template<class KEY , class VALUE >
◆ operator=()
template<class KEY , class VALUE >
Assignment of hash table by hash table.
◆ operator[]() [1/2]
template<class KEY , class VALUE >
Returns the value associated with the specified key when used as 'rvalue'. When used as 'lvalue' the key is associated with the specified value.
◆ operator[]() [2/2]
template<class KEY , class VALUE >
Returns the value associated with the specified key.
◆ remove()
template<class KEY , class VALUE >
Removes the specified key and its associated value from this hash table. Raises InvalidKey if the key doesn't exist in this hash table.
◆ removeAll()
template<class KEY , class VALUE >
Removes all the keys from this hash table.
◆ DEFAULT_CAPACITY
template<class KEY , class VALUE >
constexpr MemorySize HashTable< KEY, VALUE >::DEFAULT_CAPACITY = 16 |
|
staticconstexpr |
◆ impl
template<class KEY , class VALUE >
Hash table implementation.
◆ MAXIMUM_CAPACITY
template<class KEY , class VALUE >
◆ MINIMUM_CAPACITY
template<class KEY , class VALUE >
constexpr MemorySize HashTable< KEY, VALUE >::MINIMUM_CAPACITY = 16 |
|
staticconstexpr |