[#BloombergLP-bdlcc-StripedUnorderedMap]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::StripedUnorderedMap
:relfileprefix: ../../
:mrdocs:

Fully thread&hyphen;safe hash map from `KEY` to `VALUE`, partitioned into stripes&period;

== Synopsis

Declared in `&lt;bdlcc&lowbar;stripedunorderedmap&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class KEY,
    class VALUE,
    class HASH = xref:bsl/hash-06.adoc[bsl::hash&lt;KEY&gt;],
    class EQUAL = xref:bsl/equal_to-0d.adoc[bsl::equal&lowbar;to&lt;KEY&gt;]&gt;
class StripedUnorderedMap;
----

== Description

This class template defines a fully thread&hyphen;safe container that provides a mapping from keys (of template parameter type `KEY`) to their associated mapped values (of template parameter type `VALUE`)&period;

The buckets of this hash map are guarded by `numStripes` reader&hyphen;writer locks, a value specified on construction&period; Partitioning the buckets among several locks allows greater overall concurrency than a `bsl&colon;&colon;unordered&lowbar;map` object guarded by a single lock&period;

The interface is inspired by, but not identical to that of `bsl&colon;&colon;unordered&lowbar;map`&period; 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&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlcc/StripedUnorderedMap/EraseIfValuePredicate.adoc[`EraseIfValuePredicate`] 
| Alias for a predicate that selects values to erase&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/KVType.adoc[`KVType`] 
| Value type of a bulk insert entry&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/ReadOnlyVisitorFunction.adoc[`ReadOnlyVisitorFunction`] 
| Alias for a read&hyphen;only visitor over element values&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/VisitorFunction.adoc[`VisitorFunction`] 
| Alias for a visitor that may modify element values&period;
|===


== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlcc/StripedUnorderedMap/_04enum.adoc[`Unnamed enum`] 
| Default sizing constants for this map&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlcc/StripedUnorderedMap/2constructor-03.adoc[`StripedUnorderedMap`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bdlcc/StripedUnorderedMap/allocator.adoc[`allocator`] 
| Return the allocator used by this hash map to supply memory&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/bucketCount.adoc[`bucketCount`] 
| Return the number of buckets maintained by this hash map&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/bucketIndex.adoc[`bucketIndex`] 
| Return the bucket index where elements with `key` are inserted&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/bucketSize.adoc[`bucketSize`] 
| Return the number of elements in the bucket at `index`&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/clear.adoc[`clear`] 
| Remove all elements from this hash map&period; If rehash is in progress, block until it completes&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/disableRehash.adoc[`disableRehash`] 
| Prevent future rehash until `enableRehash` is called&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/empty.adoc[`empty`] 
| Return `true` if this hash map contains no elements, and `false` otherwise&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/enableRehash.adoc[`enableRehash`] 
| Allow rehashing to resume when the load factor is exceeded&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/equalFunction.adoc[`equalFunction`] 
| Return a copy of the key&hyphen;equality functor used by this hash map&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/erase.adoc[`erase`] 
| Erase the element having the specified `key`&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/eraseBulk.adoc[`eraseBulk`] 
| Erase elements whose keys fall in the range `&lsqb;first, last)&rsqb;`&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/eraseIf.adoc[`eraseIf`] 
| Remove the element with `key` if `predicate` holds true&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/getValue.adoc[`getValue`] 
| Load into `&ast;value` the value for `key`, if present&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/hashFunction.adoc[`hashFunction`] 
| Return (a copy of) the unary hash functor used by this hash map&period; The return function will generate a hash value (of type `std&colon;&colon;size&lowbar;t`) for a `KEY` object&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/insert-08.adoc[`insert`] 
| `insert` overloads
| xref:BloombergLP/bdlcc/StripedUnorderedMap/insertBulk.adoc[`insertBulk`] 
| Insert or update unique keys from the range `&lsqb;first, last)&rsqb;`&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/isRehashEnabled.adoc[`isRehashEnabled`] 
| Return `true` if rehash is enabled, or `false` otherwise&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/loadFactor.adoc[`loadFactor`] 
| Return the current load factor of this hash map&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/maxLoadFactor.adoc[`maxLoadFactor`] 
| Return the maximum load factor allowed for this hash map&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/numStripes.adoc[`numStripes`] 
| Return the number of stripes in the hash&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/rehash.adoc[`rehash`] 
| Recreate this hash map with at least `numBuckets` buckets&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/setComputedValue.adoc[`setComputedValue`] 
| Invoke `visitor` on the value for `key`, inserting a default if absent&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/setValue-0f.adoc[`setValue`] 
| `setValue` overloads
| xref:BloombergLP/bdlcc/StripedUnorderedMap/size.adoc[`size`] 
| Return the current number of elements in this hash map&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/update.adoc[`update`] 
| Call `visitor` on the element having `key`, if present&period;
| xref:BloombergLP/bdlcc/StripedUnorderedMap/visit-0c.adoc[`visit`] 
| `visit` overloads
| xref:BloombergLP/bdlcc/StripedUnorderedMap/visitReadOnly-04.adoc[`visitReadOnly`] 
| `visitReadOnly` overloads
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
