Fully thread‐safe hash map from KEY to VALUE, partitioned into stripes.
Synopsis
Declared in <bdlcc_stripedunorderedmap.h>
template<
class KEY,
class VALUE,
class HASH = bsl::hash<KEY>,
class EQUAL = bsl::equal_to<KEY>>
class StripedUnorderedMap;
Description
This class template defines a fully thread‐safe container that provides a mapping from keys (of template parameter type KEY) to their associated mapped values (of template parameter type VALUE).
The buckets of this hash map are guarded by numStripes reader‐writer locks, a value specified on construction. Partitioning the buckets among several locks allows greater overall concurrency than a bsl::unordered_map object guarded by a single lock.
The interface is inspired by, but not identical to that of bsl::unordered_map. Notably absent are iterators, which are of limited practicality in the typical use case because they are readily invalidated when the map population is open to modification by multiple threads.
Type Aliases
Name |
Description |
Alias for a predicate that selects values to erase. |
|
Value type of a bulk insert entry. |
|
Alias for a read‐only visitor over element values. |
|
Alias for a visitor that may modify element values. |
Enums
Name |
Description |
Default sizing constants for this map. |
Member Functions
Name |
Description |
|
Constructors |
Return the allocator used by this hash map to supply memory. |
|
Return the number of buckets maintained by this hash map. |
|
Return the bucket index where elements with |
|
Return the number of elements in the bucket at |
|
Remove all elements from this hash map. If rehash is in progress, block until it completes. |
|
Prevent future rehash until |
|
Return |
|
Allow rehashing to resume when the load factor is exceeded. |
|
Return a copy of the key‐equality functor used by this hash map. |
|
Erase the element having the specified |
|
Erase elements whose keys fall in the range |
|
Remove the element with |
|
Load into |
|
Return (a copy of) the unary hash functor used by this hash map. The return function will generate a hash value (of type |
|
|
|
Insert or update unique keys from the range |
|
Return |
|
Return the current load factor of this hash map. |
|
Return the maximum load factor allowed for this hash map. |
|
Return the number of stripes in the hash. |
|
Recreate this hash map with at least |
|
Invoke |
|
|
|
Return the current number of elements in this hash map. |
|
Call |
|
|
|
|
Created with MrDocs