8#ifndef INCLUDED_BDLCC_STRIPEDUNORDEREDMAP
9#define INCLUDED_BDLCC_STRIPEDUNORDEREDMAP
404#include <bdlscm_version.h>
412#include <bsl_functional.h>
545 bsl::size_t
erase(
const KEY& key);
555 template <
class RANDOM_ITER>
556 bsl::size_t
eraseBulk(RANDOM_ITER first, RANDOM_ITER last);
561 bsl::size_t
eraseIf(
const KEY& key,
569 bsl::size_t
insert(
const KEY& key,
const VALUE& value);
591 template <
class RANDOM_ITER>
592 bsl::size_t
insertBulk(RANDOM_ITER first, RANDOM_ITER last);
606 void rehash(bsl::size_t numBuckets);
635 bsl::size_t
setValue(
const KEY& key,
const VALUE& value);
711 bsl::size_t
bucketSize(bsl::size_t index)
const;
726 bsl::size_t
getValue(VALUE *value,
const KEY& key)
const;
786 bsl::size_t
size()
const;
805template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
808 bsl::size_t numInitialBuckets,
809 bsl::size_t numStripes,
811: d_imp(numInitialBuckets, numStripes, basicAllocator)
815template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
819: d_imp(k_DEFAULT_NUM_BUCKETS, k_DEFAULT_NUM_STRIPES, basicAllocator)
824template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
831template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
835 d_imp.disableRehash();
838template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
842 d_imp.enableRehash();
845template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
849 return d_imp.eraseFirst(key);
852template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
853template <
class RANDOM_ITER>
861 return d_imp.eraseBulkFirst(first, last);
864template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
870 return d_imp.eraseFirstIf(key, predicate);
873template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
879 return d_imp.insertUnique(key, value);
882template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
891template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
892template <
class RANDOM_ITER>
900 return d_imp.insertBulkUnique(first, last);
903template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
906 float newMaxLoadFactor)
910 d_imp.maxLoadFactor(newMaxLoadFactor);
913template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
918 d_imp.rehash(numBuckets);
921template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
927 return d_imp.setComputedValueFirst(key, visitor);
930template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
936 return d_imp.setValueFirst(key, value);
939template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
948template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
954 return d_imp.update(key, visitor);
957template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
962 return d_imp.visit(visitor);
965template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
971 return d_imp.visit(key, visitor);
975template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
979 return d_imp.bucketCount();
982template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
985 const KEY& key)
const
987 return d_imp.bucketIndex(key);
990template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
993 bsl::size_t index)
const
997 return d_imp.bucketSize(index);
1000template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
1004 return d_imp.empty();
1007template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
1011 return d_imp.equalFunction();
1014template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
1018 const KEY& key)
const
1020 return d_imp.getValue(value, key);
1023template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
1027 return d_imp.hashFunction();
1030template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
1034 return d_imp.isRehashEnabled();
1037template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
1041 return d_imp.loadFactor();
1044template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
1048 return d_imp.maxLoadFactor();
1051template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
1055 return d_imp.numStripes();
1058template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
1063 return d_imp.visitReadOnly(visitor);
1066template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
1072 return d_imp.visitReadOnly(key, visitor);
1075template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
1079 return d_imp.size();
1084template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
1089 return d_imp.allocator();
1096template <
class KEY,
class VALUE,
class HASH,
class EQUAL>
Definition bdlcc_stripedunorderedcontainerimpl.h:473
Definition bdlcc_stripedunorderedmap.h:440
int update(const KEY &key, const VisitorFunction &visitor)
Definition bdlcc_stripedunorderedmap.h:950
bsl::function< bool(const VALUE &, const KEY &)> ReadOnlyVisitorFunction
Definition bdlcc_stripedunorderedmap.h:501
int visitReadOnly(const ReadOnlyVisitorFunction &visitor) const
Definition bdlcc_stripedunorderedmap.h:1060
bsl::function< bool(VALUE *, const KEY &)> VisitorFunction
Definition bdlcc_stripedunorderedmap.h:488
EQUAL equalFunction() const
Definition bdlcc_stripedunorderedmap.h:1009
bsl::size_t numStripes() const
Return the number of stripes in the hash.
Definition bdlcc_stripedunorderedmap.h:1053
void enableRehash()
Definition bdlcc_stripedunorderedmap.h:840
void rehash(bsl::size_t numBuckets)
Definition bdlcc_stripedunorderedmap.h:916
bsl::size_t bucketSize(bsl::size_t index) const
Definition bdlcc_stripedunorderedmap.h:992
~StripedUnorderedMap()=default
Destroy this hash map.
bsl::size_t setValue(const KEY &key, const VALUE &value)
Definition bdlcc_stripedunorderedmap.h:932
bsl::pair< KEY, VALUE > KVType
Value type of a bulk insert entry.
Definition bdlcc_stripedunorderedmap.h:468
bool empty() const
Definition bdlcc_stripedunorderedmap.h:1002
bslma::Allocator * allocator() const
Definition bdlcc_stripedunorderedmap.h:1086
float maxLoadFactor() const
Definition bdlcc_stripedunorderedmap.h:1046
bsl::size_t insertBulk(RANDOM_ITER first, RANDOM_ITER last)
Definition bdlcc_stripedunorderedmap.h:894
int visit(const VisitorFunction &visitor)
Definition bdlcc_stripedunorderedmap.h:959
void clear()
Definition bdlcc_stripedunorderedmap.h:826
bsl::function< bool(const VALUE &)> EraseIfValuePredicate
Definition bdlcc_stripedunorderedmap.h:477
@ k_DEFAULT_NUM_BUCKETS
Definition bdlcc_stripedunorderedmap.h:461
@ k_DEFAULT_NUM_STRIPES
Definition bdlcc_stripedunorderedmap.h:462
void disableRehash()
Prevent future rehash until enableRehash is called.
Definition bdlcc_stripedunorderedmap.h:833
bsl::size_t erase(const KEY &key)
Definition bdlcc_stripedunorderedmap.h:847
bsl::size_t bucketIndex(const KEY &key) const
Definition bdlcc_stripedunorderedmap.h:984
bsl::size_t eraseIf(const KEY &key, const EraseIfValuePredicate &predicate)
Definition bdlcc_stripedunorderedmap.h:866
bsl::size_t bucketCount() const
Definition bdlcc_stripedunorderedmap.h:977
bsl::size_t getValue(VALUE *value, const KEY &key) const
Definition bdlcc_stripedunorderedmap.h:1016
bsl::size_t size() const
Return the current number of elements in this hash map.
Definition bdlcc_stripedunorderedmap.h:1077
bsl::size_t eraseBulk(RANDOM_ITER first, RANDOM_ITER last)
Definition bdlcc_stripedunorderedmap.h:855
bsl::size_t insert(const KEY &key, const VALUE &value)
Definition bdlcc_stripedunorderedmap.h:875
HASH hashFunction() const
Definition bdlcc_stripedunorderedmap.h:1025
bool isRehashEnabled() const
Return true if rehash is enabled, or false otherwise.
Definition bdlcc_stripedunorderedmap.h:1032
float loadFactor() const
Definition bdlcc_stripedunorderedmap.h:1039
int setComputedValue(const KEY &key, const VisitorFunction &visitor)
Definition bdlcc_stripedunorderedmap.h:923
Forward declaration.
Definition bslstl_function.h:934
Definition bslstl_pair.h:1210
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