8#ifndef INCLUDED_BDLCC_STRIPEDUNORDEREDMULTIMAP
9#define INCLUDED_BDLCC_STRIPEDUNORDEREDMULTIMAP
250#include <bdlscm_version.h>
259#include <bsl_functional.h>
395 bsl::size_t
eraseAll(
const KEY& key);
411 template <
class RANDOM_ITER>
412 bsl::size_t
eraseBulkAll(RANDOM_ITER first, RANDOM_ITER last);
429 void insert(
const KEY& key,
const VALUE& value);
445 template <
class RANDOM_ITER>
446 void insertBulk(RANDOM_ITER first, RANDOM_ITER last);
460 void rehash(bsl::size_t numBuckets);
514 bsl::size_t
setValueAll(
const KEY& key,
const VALUE& value);
523 bsl::size_t
setValueFirst(
const KEY& key,
const VALUE& value);
607 bsl::size_t
bucketSize(bsl::size_t index)
const;
619 const KEY& key)
const;
620 bsl::size_t
getValueAll(std::vector<VALUE> *valuesPtr,
621 const KEY& key)
const;
622#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR
627 bsl::size_t
getValueAll(std::pmr::vector<VALUE> *valuesPtr,
628 const KEY& key)
const;
635 bsl::size_t
getValueFirst(VALUE *value,
const KEY& key)
const;
696 bsl::size_t
size()
const;
715template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
718 bsl::size_t numInitialBuckets,
719 bsl::size_t numStripes,
721: d_imp(numInitialBuckets, numStripes, basicAllocator)
725template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
729: d_imp(k_DEFAULT_NUM_BUCKETS, k_DEFAULT_NUM_STRIPES, basicAllocator)
734template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
741template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
745 d_imp.disableRehash();
748template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
752 d_imp.enableRehash();
755template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
760 return d_imp.eraseAll(key);
763template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
769 return d_imp.eraseAllIf(key, predicate);
772template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
773template <
class RANDOM_ITER>
781 return d_imp.eraseBulkAll(first, last);
784template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
789 return d_imp.eraseFirst(key);
792template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
799 return d_imp.eraseFirstIf(key, predicate);
802template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
808 d_imp.insertAlways(key, value);
811template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
820template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
821template <
class RANDOM_ITER>
829 d_imp.insertBulkAlways(first, last);
832template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
835 float newMaxLoadFactor)
839 d_imp.maxLoadFactor(newMaxLoadFactor);
842template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
845 bsl::size_t numBuckets)
847 d_imp.rehash(numBuckets);
850template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
857 return d_imp.setComputedValueAll(key, visitor);
860template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
867 return d_imp.setComputedValueFirst(key, visitor);
870template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
876 return d_imp.setValueAll(key, value);
879template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
885 return d_imp.setValueFirst(key, value);
888template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
897template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
903 return d_imp.update(key, visitor);
906template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
911 return d_imp.visit(visitor);
914template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
920 return d_imp.visit(key, visitor);
924template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
929 return d_imp.bucketCount();
932template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
935 const KEY& key)
const
937 return d_imp.bucketIndex(key);
940template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
943 bsl::size_t index)
const
947 return d_imp.bucketSize(index);
950template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
954 return d_imp.empty();
957template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
961 return d_imp.equalFunction();
964template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
968 const KEY& key)
const
970 return d_imp.getValue(valuesPtr, key);
973template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
976 std::vector<VALUE> *valuesPtr,
977 const KEY& key)
const
979 return d_imp.getValue(valuesPtr, key);
982#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR
983template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
986 std::pmr::vector<VALUE> *valuesPtr,
987 const KEY& key)
const
989 return d_imp.getValue(valuesPtr, key);
993template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
997 const KEY& key)
const
999 return d_imp.getValue(value, key);
1002template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
1006 return d_imp.hashFunction();
1009template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
1013 return d_imp.isRehashEnabled();
1016template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
1020 return d_imp.loadFactor();
1023template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
1028 return d_imp.maxLoadFactor();
1031template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
1036 return d_imp.numStripes();
1039template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
1044 return d_imp.visitReadOnly(visitor);
1047template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
1053 return d_imp.visitReadOnly(key, visitor);
1056template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
1060 return d_imp.size();
1065template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
1070 return d_imp.allocator();
1077template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
Definition bdlcc_stripedunorderedcontainerimpl.h:473
Definition bdlcc_stripedunorderedmultimap.h:290
bsl::size_t setValueAll(const KEY &key, const VALUE &value)
Definition bdlcc_stripedunorderedmultimap.h:872
int setComputedValueFirst(const KEY &key, const VisitorFunction &visitor)
Definition bdlcc_stripedunorderedmultimap.h:863
void insertBulk(RANDOM_ITER first, RANDOM_ITER last)
Definition bdlcc_stripedunorderedmultimap.h:823
bsl::size_t setValueFirst(const KEY &key, const VALUE &value)
Definition bdlcc_stripedunorderedmultimap.h:881
bool isRehashEnabled() const
Return true if rehash is enabled, or false otherwise.
Definition bdlcc_stripedunorderedmultimap.h:1011
void rehash(bsl::size_t numBuckets)
Definition bdlcc_stripedunorderedmultimap.h:844
void insert(const KEY &key, const VALUE &value)
Definition bdlcc_stripedunorderedmultimap.h:804
~StripedUnorderedMultiMap()=default
bsl::size_t bucketCount() const
Definition bdlcc_stripedunorderedmultimap.h:927
bsl::size_t eraseAllIf(const KEY &key, const EraseIfValuePredicate &predicate)
Definition bdlcc_stripedunorderedmultimap.h:765
@ k_DEFAULT_NUM_STRIPES
Definition bdlcc_stripedunorderedmultimap.h:313
@ k_DEFAULT_NUM_BUCKETS
Definition bdlcc_stripedunorderedmultimap.h:312
int visit(const VisitorFunction &visitor)
Definition bdlcc_stripedunorderedmultimap.h:908
int visitReadOnly(const ReadOnlyVisitorFunction &visitor) const
Definition bdlcc_stripedunorderedmultimap.h:1041
HASH hashFunction() const
Definition bdlcc_stripedunorderedmultimap.h:1004
bsl::size_t bucketSize(bsl::size_t index) const
Definition bdlcc_stripedunorderedmultimap.h:942
bsl::size_t eraseFirst(const KEY &key)
Definition bdlcc_stripedunorderedmultimap.h:786
float loadFactor() const
Definition bdlcc_stripedunorderedmultimap.h:1018
bsl::size_t size() const
Return the current number of elements in this hash map.
Definition bdlcc_stripedunorderedmultimap.h:1058
bsl::function< bool(VALUE *, const KEY &)> VisitorFunction
Definition bdlcc_stripedunorderedmultimap.h:330
bsl::function< bool(const VALUE &, const KEY &)> ReadOnlyVisitorFunction
Definition bdlcc_stripedunorderedmultimap.h:343
int update(const KEY &key, const VisitorFunction &visitor)
Definition bdlcc_stripedunorderedmultimap.h:899
bsl::size_t eraseFirstIf(const KEY &key, const EraseIfValuePredicate &predicate)
Definition bdlcc_stripedunorderedmultimap.h:795
float maxLoadFactor() const
Definition bdlcc_stripedunorderedmultimap.h:1026
bsl::size_t numStripes() const
Return the number of stripes in the hash.
Definition bdlcc_stripedunorderedmultimap.h:1033
EQUAL equalFunction() const
Definition bdlcc_stripedunorderedmultimap.h:959
bool empty() const
Definition bdlcc_stripedunorderedmultimap.h:952
void clear()
Definition bdlcc_stripedunorderedmultimap.h:736
bsl::size_t eraseAll(const KEY &key)
Definition bdlcc_stripedunorderedmultimap.h:757
bsl::size_t getValueFirst(VALUE *value, const KEY &key) const
Definition bdlcc_stripedunorderedmultimap.h:995
bsl::size_t eraseBulkAll(RANDOM_ITER first, RANDOM_ITER last)
Definition bdlcc_stripedunorderedmultimap.h:775
void enableRehash()
Definition bdlcc_stripedunorderedmultimap.h:750
bsl::function< bool(const VALUE &)> EraseIfValuePredicate
Definition bdlcc_stripedunorderedmultimap.h:352
bsl::size_t bucketIndex(const KEY &key) const
Definition bdlcc_stripedunorderedmultimap.h:934
int setComputedValueAll(const KEY &key, const VisitorFunction &visitor)
Definition bdlcc_stripedunorderedmultimap.h:853
void disableRehash()
Prevent future rehash until enableRehash is called.
Definition bdlcc_stripedunorderedmultimap.h:743
bsl::pair< KEY, VALUE > KVType
Value type of a bulk insert entry.
Definition bdlcc_stripedunorderedmultimap.h:319
bslma::Allocator * allocator() const
Definition bdlcc_stripedunorderedmultimap.h:1068
bsl::size_t getValueAll(bsl::vector< VALUE > *valuesPtr, const KEY &key) const
Definition bdlcc_stripedunorderedmultimap.h:966
Forward declaration.
Definition bslstl_function.h:934
Definition bslstl_pair.h:1210
Definition bslstl_vector.h:1025
Definition bslma_allocator.h:457
Definition bslmf_movableref.h:751
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlcc_boundedqueue.h:270
Definition balxml_encoderoptions.h:68
Definition bslstl_equalto.h:311
Definition bslstl_hash.h:498
Definition bslma_usesbslmaallocator.h:343
static MovableRef< t_TYPE > move(t_TYPE &reference) BSLS_KEYWORD_NOEXCEPT
Definition bslmf_movableref.h:1060