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).
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
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 |
An alias to a function meeting the following contract: ` /// Return |
|
Value type of a bulk insert entry. |
|
An alias to a function meeting the following contract: ` /// Visit the specified |
|
An alias to a function meeting the following contract: ` /// Visit the specified |
Enums
Name |
Description |
Default sizing constants for this map. |
Member Functions
Name |
Description |
|
Create an empty |
Return the allocator used by this hash map to supply memory. Note that if no allocator was supplied at construction the default allocator installed at that time is used. |
|
Return the number of buckets in the array of buckets maintained by this hash map. Note that unless rehash is disabled, the value returned may be obsolete by the time it is received. |
|
Return the index of the bucket, in the array of buckets maintained by this hash map, where elements having the specified |
|
Return the number of elements contained in the bucket at the specified |
|
Remove all elements from this hash map. If rehash is in progress, block until it completes. |
|
Prevent future rehash until |
|
Return |
|
Allow rehash. If conditions warrant, rehash will be started by the next method call that observes the load factor is exceeded (see {Concurrent Rehash}). Note that calling |
|
Return (a copy of) the key‐equality functor used by this hash map. The returned function will return |
|
Erase from this hash map the element having the specified |
|
Erase from this hash map elements in this hash map having any of the values in the keys contained between the specified |
|
Remove from this hash map the element, if any, having the specified |
|
Load, into the specified |
|
Return (a copy of) the unary hash functor used by this hash map. The return function will generate a hash value (of type |
|
|
|
Insert into this hash map elements having the key‐value pairs obtained between the specified |
|
Return |
|
Return the current quotient of the size of this hash map and the number of buckets. Note that the load factor is a measure of container "fullness"; that is, a high load factor typically implies many collisions (many elements landing in the same bucket) and that decreases performance. See {Rehash Control}. |
|
Return the maximum load factor allowed for this hash map. If an insert operation would cause the load factor to exceed the |
|
Return the number of stripes in the hash. |
|
Recreate this hash map to one having at least the specified |
|
Invoke the specified |
|
|
|
Return the current number of elements in this hash map. |
|
Call the specified |
|
|
|
|
Created with MrDocs