[#BloombergLP-bdlcc-StripedUnorderedMultiMap] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::StripedUnorderedMultiMap :relfileprefix: ../../ :mrdocs: Fully thread‐safe striped hash multimap from `KEY` to `VALUE`. == Synopsis Declared in `<bdlcc_stripedunorderedmultimap.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class KEY, class VALUE, class HASH = xref:bsl/hash-06.adoc[bsl::hash<KEY>], class EQUAL = xref:bsl/equal_to-0d.adoc[bsl::equal_to<KEY>]> class StripedUnorderedMultiMap; ---- == 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_multimap` object guarded by a single lock. The interface is inspired by, but not identical to that of `bsl::unordered_multimap`. 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 [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/EraseIfValuePredicate.adoc[`EraseIfValuePredicate`] | Alias for a predicate that selects values to erase. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/KVType.adoc[`KVType`] | Value type of a bulk insert entry. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/ReadOnlyVisitorFunction.adoc[`ReadOnlyVisitorFunction`] | Alias for a read‐only visitor over element values. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/VisitorFunction.adoc[`VisitorFunction`] | Alias for a visitor that may modify element values. |=== == Enums [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/_04enum.adoc[`Unnamed enum`] | Default sizing constants for this multimap. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/2constructor-09a.adoc[`StripedUnorderedMultiMap`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/allocator.adoc[`allocator`] | Return the allocator used by this hash map to supply memory. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/bucketCount.adoc[`bucketCount`] | Return the number of buckets maintained by this hash map. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/bucketIndex.adoc[`bucketIndex`] | Return the bucket index where elements with `key` are inserted. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/bucketSize.adoc[`bucketSize`] | Return the number of elements in the bucket at the specified `index`. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/clear.adoc[`clear`] | Remove all elements from this hash map. If rehash is in progress, block until it completes. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/disableRehash.adoc[`disableRehash`] | Prevent future rehash until `enableRehash` is called. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/empty.adoc[`empty`] | Return `true` if this hash map contains no elements, and `false` otherwise. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/enableRehash.adoc[`enableRehash`] | Allow rehashing to resume when the load factor is exceeded. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/equalFunction.adoc[`equalFunction`] | Return a copy of the key‐equality functor used by this hash map. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/eraseAll.adoc[`eraseAll`] | Erase from this hash map the elements having the specified `key`. Return the number of elements erased. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/eraseAllIf.adoc[`eraseAllIf`] | Erase from this hash map the elements having the specified `key` for which the specified `predicate` holds true. Return the number of elements erased. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/eraseBulkAll.adoc[`eraseBulkAll`] | Erase all elements whose keys fall in `[first, last)]`. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/eraseFirst.adoc[`eraseFirst`] | Erase the first element found with the specified `key`. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/eraseFirstIf.adoc[`eraseFirstIf`] | Erase the first element with `key` for which `predicate` is true. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/getValueAll-00.adoc[`getValueAll`] | `getValueAll` overloads | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/getValueFirst.adoc[`getValueFirst`] | Load into `*value` the first value found for the specified `key`. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/hashFunction.adoc[`hashFunction`] | Return (a copy of) the unary hash functor used by this hash map. The return function will generate a hash value (of type `std::size_t`) for a `KEY` object. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/insert-05.adoc[`insert`] | `insert` overloads | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/insertBulk.adoc[`insertBulk`] | Insert key‐value pairs from the range `[first, last)]`. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/isRehashEnabled.adoc[`isRehashEnabled`] | Return `true` if rehash is enabled, or `false` otherwise. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/loadFactor.adoc[`loadFactor`] | Return the current size divided by the number of buckets. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/maxLoadFactor.adoc[`maxLoadFactor`] | Return the maximum load factor allowed for this hash map. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/numStripes.adoc[`numStripes`] | Return the number of stripes in the hash. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/rehash.adoc[`rehash`] | Recreate this hash map with at least `numBuckets` buckets. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/setComputedValueAll.adoc[`setComputedValueAll`] | Invoke `visitor` on the value of every element matching `key`. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/setComputedValueFirst.adoc[`setComputedValueFirst`] | Invoke `visitor` on the value of the first element matching `key`. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/setValueAll.adoc[`setValueAll`] | Set the value of every element matching `key`, or insert one. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/setValueFirst-01.adoc[`setValueFirst`] | `setValueFirst` overloads | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/size.adoc[`size`] | Return the current number of elements in this hash map. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/update.adoc[`update`] | Call `visitor` on each element matching `key` until it returns false. | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/visit-06.adoc[`visit`] | `visit` overloads | xref:BloombergLP/bdlcc/StripedUnorderedMultiMap/visitReadOnly-0a.adoc[`visitReadOnly`] | `visitReadOnly` overloads |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#