This class is a double‐hashed table. The VALUE template parameter is optional. The capacityHint specified at construction time will be used to compute the number of buckets (capacity) in this object. Also, two hash functions may optionally be specified at construction time. Elements can be inserted using the insert method. If the VALUE parameter is not bslmf::Nil, then both key and value must be supplied to the insert method. Otherwise, only the key should be supplied. The find method can be used to lookup elements by a specified key. The optional TRAITS parameter can be used to classify "null" and "removed" values. See the component‐level documentation for more details.
Synopsis
Declared in <bdlc_hashtable.h>
template<
class KEY,
class VALUE = bslmf::Nil,
class TRAITS = HashTableDefaultTraits,
class HASH1 = HashTableDefaultHash1,
class HASH2 = HashTableDefaultHash2>
class HashTable;
Type Aliases
Name |
Description |
Data type to handle elements in the double‐hashed table. This value is guaranteed to be between 0 and the capacity of the hash table. |
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this object. |
Return the maximum number of elements that can be stored in this object. Note that this value is computed based on the capacity hint used upon construction. |
|
Return the capacity hint that was used to determine the capacity of this object. |
|
Find an element having the specified |
|
|
|
Return the reference to the non‐modifiable key of the element identified by the specified |
|
Return the maximum chain length encountered by this object. |
|
Return the number of collisions encountered by this object. |
|
Remove the element identified by the specified |
|
Return the number of elements stored in this object. |
|
Return the total chain length encountered by this object. |
|
|
|
|
Declare that this type uses a |
Created with MrDocs