8#ifndef INCLUDED_BSLSTL_HASHTABLE
9#define INCLUDED_BSLSTL_HASHTABLE
1491#include <bslscm_version.h>
1531#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
1536#ifndef BDE_DONT_ALLOW_TRANSITIVE_INCLUDES
1540#if BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
1544# define COMPILING_BSLSTL_HASHTABLE_H
1546# undef COMPILING_BSLSTL_HASHTABLE_H
1553template <
class KEY_CONFIG,
1559template <
class FACTORY>
1560class HashTable_ArrayProctor;
1562template <
class FACTORY>
1563class HashTable_NodeProctor;
1565template <
class FUNCTOR>
1566class HashTable_ComparatorWrapper;
1568template <
class FUNCTOR>
1569class HashTable_ComparatorWrapper<const FUNCTOR>;
1571template <
class FUNCTOR>
1572class HashTable_ComparatorWrapper<FUNCTOR &>;
1574template <
class FUNCTOR>
1575class HashTable_HashWrapper;
1577template <
class FUNCTOR>
1578class HashTable_HashWrapper<const FUNCTOR>;
1580template <
class FUNCTOR>
1581class HashTable_HashWrapper<FUNCTOR &>;
1583struct HashTable_ImpDetails;
1584struct HashTable_Util;
1597template <
class CALLABLE>
1623template <
class FUNCTOR>
1627 mutable FUNCTOR d_functor;
1650 template <
class ARG_TYPE>
1655 const FUNCTOR&
functor()
const;
1666template <
class FUNCTOR>
1670 const FUNCTOR d_functor;
1688 template <
class ARG_TYPE>
1704template <
class FUNCTOR>
1722 template <
class ARG_TYPE>
1723 std::size_t operator()(ARG_TYPE& arg)
const;
1727 FUNCTOR& functor()
const;
1732template <
class FUNCTOR>
1748template <
class FUNCTOR>
1752 mutable FUNCTOR d_functor;
1775 template <
class ARG1_TYPE,
class ARG2_TYPE>
1776 bool operator()(ARG1_TYPE& arg1, ARG2_TYPE& arg2)
const;
1780 const FUNCTOR&
functor()
const;
1791template <
class FUNCTOR>
1795 const FUNCTOR d_functor;
1813 template <
class ARG1_TYPE,
class ARG2_TYPE>
1829template <
class FUNCTOR>
1847 template <
class ARG1_TYPE,
class ARG2_TYPE>
1848 bool operator()(ARG1_TYPE& arg1, ARG2_TYPE& arg2)
const;
1852 FUNCTOR& functor()
const;
1857template <
class FUNCTOR>
1865template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
1913template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
1942 typedef typename AllocatorTraits::template rebind_traits<NodeType>
1946 ReboundTraits::propagate_on_container_copy_assignment::value ==
1947 AllocatorTraits::propagate_on_container_copy_assignment::value);
1950 ReboundTraits::propagate_on_container_move_assignment::value ==
1951 AllocatorTraits::propagate_on_container_move_assignment::value);
1953 BSLMF_ASSERT(ReboundTraits::propagate_on_container_swap::value ==
1954 AllocatorTraits::propagate_on_container_swap::value);
1965 float d_maxLoadFactor;
2001 void quickSwapExchangeAllocators(
HashTable *other);
2007 void quickSwapRetainAllocators(
HashTable *other);
2021 void rehashIntoExactlyNumBuckets(
SizeType newNumBuckets,
2030 void removeAllAndDeallocate();
2039 void removeAllImp();
2051 template <
class DEDUCED_KEY>
2053 std::size_t hashValue)
const;
2082 explicit HashTable(
const ALLOCATOR& basicAllocator = ALLOCATOR());
2103 const COMPARATOR& compare,
2105 float initialMaxLoadFactor,
2106 const ALLOCATOR& basicAllocator = ALLOCATOR());
2132 HashTable(BloombergLP::bslmf::MovableRef<HashTable> original);
2162 HashTable(BloombergLP::bslmf::MovableRef<HashTable> original,
2163 const ALLOCATOR& basicAllocator);
2202#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
2217 template <
class... Args>
2240 template <
class... Args>
2243 Args&&... arguments);
2264 template <
class... Args>
2266 Args&&... arguments);
2305 bool *isInsertedFlag,
2324 bool *isInsertedFlag,
2345 template <
class SOURCE_TYPE>
2348 bool *isInsertedFlag,
2367 template <
class SOURCE_TYPE>
2391 template <
class SOURCE_TYPE>
2396#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
2405 template <
class KEY_ARG,
class BDE_OTHER_TYPE>
2407 bool *isInsertedFlag,
2410 BDE_OTHER_TYPE&& obj);
2482#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
2491 template <
class... ARGS>
2493 bool *isInsertedFlag,
2506 template <
class... ARGS>
2508 bool *isInsertedFlag,
2524 template <
class LOOKUP_KEY,
class... ARGS>
2526 BloombergLP::bslmf::IsTransparentPredicate<HASHER, LOOKUP_KEY>::value
2527 && BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,LOOKUP_KEY>::value,
2529 bool *isInsertedFlag,
2536 const LOOKUP_KEY& lvalue = key;
2537 const std::size_t hashCode = this->d_parameters.
hashCodeForKey(lvalue);
2543 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
2545 hint = bslalg::HashTableImpUtil::findTransparent<KEY_CONFIG>(
2554 *isInsertedFlag =
false;
2558 if (d_size >= d_capacity) {
2563 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2565 std::piecewise_construct,
2569 typedef typename ValueType::second_type MappedType;
2589 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
2593 *isInsertedFlag =
true;
2637 template <
class LOOKUP_KEY>
2639 BloombergLP::bslmf::IsTransparentPredicate<HASHER, LOOKUP_KEY>::value
2640 && BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,LOOKUP_KEY>::value,
2644 return bslalg::HashTableImpUtil::findTransparent<KEY_CONFIG>(
2683 template <
class LOOKUP_KEY>
2685 BloombergLP::bslmf::IsTransparentPredicate<HASHER, LOOKUP_KEY>::value
2686 && BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,LOOKUP_KEY>::value,
2690 const LOOKUP_KEY& key)
const
2695 *first = this->find(key);
2731 const HASHER&
hasher()
const;
2785template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
2801template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
2819template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
2831template <
class FACTORY>
2836 FACTORY *d_factory_p;
2881template <
class FACTORY>
2886 FACTORY *d_factory_p;
2941 size_t requestedBuckets,
2942 double maxLoadFactor);
2982 template <
class TYPE>
2984 template <
class TYPE>
2986 template <
class TYPE>
2991 template<
class ALLOCATOR>
2993 std::size_t bucketArraySize,
2994 const ALLOCATOR& allocator);
3001 template<
class ALLOCATOR>
3003 std::size_t bucketArraySize,
3004 const ALLOCATOR& allocator);
3019template <
class HASHER>
3022 typename CallableVariable<HASHER>::type> >
3026template <
class COMPARATOR>
3029 typename CallableVariable<COMPARATOR>::type> >
3037template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3052 typedef ALLOCATOR AllocatorType;
3054 typedef typename KEY_CONFIG::ValueType ValueType;
3060 typedef typename HashTableType::AllocatorTraits::
3093 const COMPARATOR& compare,
3094 const ALLOCATOR& allocator);
3100 const ALLOCATOR& allocator);
3138 template <
class DEDUCED_KEY>
3143 const BaseHasher&
hasher()
const;
3166template <
class FUNCTOR>
3173template <
class FUNCTOR>
3180template <
class FUNCTOR>
3181template <
class ARG_TYPE>
3186 return d_functor(arg);
3189template <
class FUNCTOR>
3196template <
class FUNCTOR>
3201 swap(d_functor, other.d_functor);
3206template <
class FUNCTOR>
3213template <
class FUNCTOR>
3220template <
class FUNCTOR>
3221template <
class ARG_TYPE>
3226 return d_functor(arg);
3229template <
class FUNCTOR>
3238template <
class FUNCTOR>
3245template <
class FUNCTOR>
3246template <
class ARG_TYPE>
3251 return d_functor(arg);
3254template <
class FUNCTOR>
3265template <
class FUNCTOR>
3272template <
class FUNCTOR>
3280template <
class FUNCTOR>
3281template <
class ARG1_TYPE,
class ARG2_TYPE>
3285 ARG2_TYPE& arg2)
const
3287 return d_functor(arg1, arg2);
3290template <
class FUNCTOR>
3296template <
class FUNCTOR>
3302 swap(d_functor, other.d_functor);
3307template <
class FUNCTOR>
3314template <
class FUNCTOR>
3322template <
class FUNCTOR>
3323template <
class ARG1_TYPE,
class ARG2_TYPE>
3327 ARG2_TYPE& arg2)
const
3329 return d_functor(arg1, arg2);
3332template <
class FUNCTOR>
3340template <
class FUNCTOR>
3348template <
class FUNCTOR>
3349template <
class ARG1_TYPE,
class ARG2_TYPE>
3353 ARG2_TYPE& arg2)
const
3355 return d_functor(arg1, arg2);
3358template <
class FUNCTOR>
3370template <
class FACTORY>
3375: d_factory_p(factory)
3381template <
class FACTORY>
3386 d_factory_p->deleteNode(d_node_p);
3391template <
class FACTORY>
3403template <
class FACTORY>
3408: d_factory_p(factory)
3415template <
class FACTORY>
3421 d_anchor_p->bucketArraySize(),
3422 d_factory_p->allocator());
3427 d_factory_p->deleteNode(root);
3434template <
class FACTORY>
3445template <
class TYPE>
3451template <
class TYPE>
3460template <
class TYPE>
3469template <
class ALLOCATOR>
3473 std::size_t bucketArraySize,
3474 const ALLOCATOR& allocator)
3478 (1 < bucketArraySize
3480 || (1 == bucketArraySize
3483#ifdef BSLS_ASSERT_SAFE_IS_ACTIVE
3486 bucketArraySize <= std::numeric_limits<AllocSizeType>::max());
3495template <
class ALLOCATOR>
3498 std::size_t bucketArraySize,
3499 const ALLOCATOR& allocator)
3504#ifdef BSLS_ASSERT_SAFE_IS_ACTIVE
3507 bucketArraySize <= std::numeric_limits<AllocSizeType>::max());
3511 Bucket *data = bslma::AllocatorUtil::allocateObject<Bucket>(allocator,
3514 std::fill_n(data, bucketArraySize, Bucket());
3524template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3530, d_nodeFactory(allocator)
3534template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3538 const COMPARATOR& compare,
3539 const ALLOCATOR& allocator)
3541, BaseComparator(compare)
3542, d_nodeFactory(allocator)
3546template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3550 const ALLOCATOR& allocator)
3551: BaseHasher(static_cast<const BaseHasher&>(original))
3552, BaseComparator(static_cast<const BaseComparator&>(original))
3553, d_nodeFactory(allocator)
3557template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3561: BaseHasher(static_cast<const BaseHasher&>(original))
3562, BaseComparator(static_cast<const BaseComparator&>(original))
3568template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3573 ALLOCATOR>::NodeFactory &
3577 return d_nodeFactory;
3580template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3588 swap(*
static_cast<BaseHasher*
>(
this), *
static_cast<BaseHasher*
>(other));
3590 swap(*
static_cast<BaseComparator*
>(
this),
3591 *
static_cast<BaseComparator*
>(other));
3593 nodeFactory().swapExchangeAllocators(other->
nodeFactory());
3596template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3604 swap(*
static_cast<BaseHasher*
>(
this), *
static_cast<BaseHasher*
>(other));
3606 swap(*
static_cast<BaseComparator*
>(
this),
3607 *
static_cast<BaseComparator*
>(other));
3609 nodeFactory().swapRetainAllocators(other->
nodeFactory());
3613template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3618 ALLOCATOR>::BaseComparator &
3625template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3626template <
class DEDUCED_KEY>
3632hashCodeForKey(DEDUCED_KEY& key)
const
3634 return static_cast<const BaseHasher &
>(*this)(key);
3637template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3642 ALLOCATOR>::BaseHasher &
3649template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3654 ALLOCATOR>::NodeFactory &
3658 return d_nodeFactory;
3661template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3667 ALLOCATOR>::originalComparator()
const
3669 return static_cast<const BaseComparator *
>(
this)->functor();
3672template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3677 ALLOCATOR>::originalHasher()
const
3679 return static_cast<const BaseHasher *
>(
this)->functor();
3687template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3690HashTable(
const ALLOCATOR& basicAllocator)
3691: d_parameters(basicAllocator)
3695, d_maxLoadFactor(1.0)
3701template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3705 const COMPARATOR& compare,
3707 float initialMaxLoadFactor,
3708 const ALLOCATOR& basicAllocator)
3709: d_parameters(hash, compare, basicAllocator)
3713, d_maxLoadFactor(initialMaxLoadFactor)
3724 if (0 != initialNumBuckets) {
3729 static_cast<size_t>(initialNumBuckets),
3732 d_capacity =
static_cast<SizeType>(capacity);
3736template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3741 original.d_parameters,
3742 AllocatorTraits::select_on_container_copy_construction(original.allocator()))
3744, d_size(original.d_size)
3746, d_maxLoadFactor(original.d_maxLoadFactor)
3754template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3757 BloombergLP::bslmf::MovableRef<HashTable> original)
3762, d_maxLoadFactor(1.0)
3766 swap(d_anchor, lvalue.d_anchor);
3767 swap(d_size, lvalue.d_size);
3768 swap(d_capacity, lvalue.d_capacity);
3769 swap(d_maxLoadFactor, lvalue.d_maxLoadFactor);
3772template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3776: d_parameters(original.d_parameters, basicAllocator)
3778, d_size(original.d_size)
3780, d_maxLoadFactor(original.d_maxLoadFactor)
3788template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3791 const ALLOCATOR& basicAllocator)
3792: d_parameters(MoveUtil::access(original).d_parameters.originalHasher(),
3793 MoveUtil::access(original).d_parameters.originalComparator(),
3798, d_maxLoadFactor(1.0)
3802 basicAllocator == lvalue.
allocator())) {
3806 swap(d_anchor, lvalue.d_anchor);
3807 swap(d_size, lvalue.d_size);
3808 swap(d_capacity, lvalue.d_capacity);
3809 swap(d_maxLoadFactor, lvalue.d_maxLoadFactor);
3812 d_size = lvalue.d_size;
3813 d_maxLoadFactor = lvalue.d_maxLoadFactor;
3819 swap(anchor, lvalue.d_anchor);
3822 lvalue.d_capacity = 0;
3823 lvalue.d_maxLoadFactor = 1.0f;
3825 HashTable_ArrayProctor<typename ImplParameters::NodeFactory>
3830 this->moveDataStructure(anchor.listRootAddress());
3837template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3841#if defined(BDE_BUILD_TARGET_SAFE_2)
3854 this->d_parameters.
hasher(),
3858 this->removeAllAndDeallocate();
3862template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3879 static_cast<size_t>(d_size),
3889 arrayProctor(&d_parameters.
nodeFactory(), &d_anchor);
3891 d_capacity =
static_cast<SizeType
>(capacity);
3899 size_t hashCode = this->hashCodeForNode(cursor);
3907 while (0 != (cursor = cursor->
nextLink()));
3911 arrayProctor.release();
3914template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3916HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::moveDataStructure(
3931 static_cast<size_t>(d_size),
3938 d_capacity =
static_cast<SizeType
>(capacity);
3942 HashTable_ArrayProctor<typename ImplParameters::NodeFactory>
3943 arrayProctor(&d_parameters.
nodeFactory(), &d_anchor);
3951 size_t hashCode = this->hashCodeForNode(cursor);
3959 while (0 != (cursor = cursor->
nextLink()));
3963 arrayProctor.release();
3966template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3968HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::
3969quickSwapExchangeAllocators(HashTable *other)
3976 swap(d_anchor, other->d_anchor);
3977 swap(d_size, other->d_size);
3978 swap(d_capacity, other->d_capacity);
3979 swap(d_maxLoadFactor, other->d_maxLoadFactor);
3982template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3984HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::
3985quickSwapRetainAllocators(HashTable *other)
3993 swap(d_anchor, other->d_anchor);
3994 swap(d_size, other->d_size);
3995 swap(d_capacity, other->d_capacity);
3996 swap(d_maxLoadFactor, other->d_maxLoadFactor);
3999template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4001HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::
4002rehashIntoExactlyNumBuckets(SizeType newNumBuckets, SizeType capacity)
4015 HashTable *d_table_p;
4019#if !defined(BSLS_PLATFORM_CMP_MSVC)
4024 Proctor(
const Proctor&);
4025 Proctor& operator=(
const Proctor&);
4030 Proctor(HashTable *table,
4034 , d_originalAnchor_p(originalAnchor)
4035 , d_newAnchor_p(newAnchor)
4044 if (d_originalAnchor_p) {
4050 d_table_p->removeAll();
4057 HashTable_Util::destroyBucketArray(
4060 d_table_p->allocator());
4066 d_originalAnchor_p = 0;
4079 static_cast<size_t>(newNumBuckets),
4082 Proctor cleanUpIfUserHashThrows(
this, &d_anchor, &newAnchor);
4085 bslalg::HashTableImpUtil::rehash<KEY_CONFIG>(
4088 this->d_parameters.hasher());
4091 cleanUpIfUserHashThrows.dismiss();
4093 d_anchor.
swap(newAnchor);
4094 d_capacity = capacity;
4097template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4100HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::removeAllAndDeallocate()
4102 this->removeAllImp();
4108template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4110HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::removeAllImp()
4119 BidirectionalLink *next;
4123 static_cast<NodeType *
>(root));
4125 while(0 != (root = next));
4130template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4131template <
class DEDUCED_KEY>
4134HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::find(
4136 std::size_t hashValue)
const
4138 return bslalg::HashTableImpUtil::find<KEY_CONFIG>(
4145template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4148HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::getBucketAddress(
4149 SizeType bucketIndex)
const
4156template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4159HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::hashCodeForNode(
4165 bslalg::HashTableImpUtil::extractKey<KEY_CONFIG>(node));
4169template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4171HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>&
4177 if (AllocatorTraits::propagate_on_container_copy_assignment::value) {
4179 quickSwapExchangeAllocators(&other);
4182 HashTable other(rhs, this->allocator());
4183 quickSwapRetainAllocators(&other);
4189template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4197 if (allocator() == lvalue.
allocator()) {
4198 HashTable other(MoveUtil::move(lvalue));
4199 quickSwapRetainAllocators(&other);
4202 AllocatorTraits::propagate_on_container_move_assignment::value) {
4203 HashTable other(MoveUtil::move(lvalue));
4204 quickSwapExchangeAllocators(&other);
4207 HashTable other(MoveUtil::move(lvalue), allocator());
4208 quickSwapRetainAllocators(&other);
4214#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
4215template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4216template <
class... ARGS>
4219 ARGS&&... arguments)
4226 if (d_size >= d_capacity) {
4227 this->rehashForNumBuckets(numBuckets() * 2);
4240 nodeProctor(&d_parameters.
nodeFactory(), newNode);
4246 ImpUtil::extractKey<KEY_CONFIG>(newNode));
4248 ImpUtil::extractKey<KEY_CONFIG>(newNode),
4252 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
4255 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, position);
4264template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4265template <
class... ARGS>
4269 ARGS&&... arguments)
4276 if (d_size >= d_capacity) {
4277 this->rehashForNumBuckets(numBuckets() * 2);
4290 nodeProctor(&d_parameters.
nodeFactory(), newNode);
4295 ImpUtil::extractKey<KEY_CONFIG>(newNode));
4297 || !d_parameters.
comparator()(ImpUtil::extractKey<KEY_CONFIG>(newNode),
4298 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
4299 hint = this->find(ImpUtil::extractKey<KEY_CONFIG>(newNode), hashCode);
4303 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
4306 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, hint);
4315template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4316template <
class... ARGS>
4319 bool *isInsertedFlag,
4320 ARGS&&... arguments)
4329 if (d_size >= d_capacity) {
4330 this->rehashForNumBuckets(numBuckets() * 2);
4343 nodeProctor(&d_parameters.
nodeFactory(), newNode);
4348 ImpUtil::extractKey<KEY_CONFIG>(newNode));
4350 ImpUtil::extractKey<KEY_CONFIG>(newNode),
4353 *isInsertedFlag = (!position);
4356 if (d_size >= d_capacity) {
4357 this->rehashForNumBuckets(numBuckets() * 2);
4360 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
4371template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4380template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4386 return tryEmplace(&dummy,
4388 MoveUtil::move(key));
4391template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4394 bool *isInsertedFlag,
4400 KEY_CONFIG::extractKey(value));
4402 KEY_CONFIG::extractKey(value),
4405 *isInsertedFlag = (!position);
4408 if (d_size >= d_capacity) {
4409 this->rehashForNumBuckets(numBuckets() * 2);
4422template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4425 bool *isInsertedFlag,
4433 KEY_CONFIG::extractKey(lvalue));
4435 KEY_CONFIG::extractKey(lvalue),
4438 *isInsertedFlag = (!position);
4441 if (d_size >= d_capacity) {
4442 this->rehashForNumBuckets(numBuckets() * 2);
4446 MoveUtil::move(lvalue));
4456template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4457template <
class SOURCE_TYPE>
4461 bool *isInsertedFlag,
4466 return emplaceIfMissing(isInsertedFlag,
4471template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4472template <
class SOURCE_TYPE>
4481template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4482template <
class SOURCE_TYPE>
4489 return emplaceWithHint(hint,
4493#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
4494template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4495template <
class KEY_ARG,
class BDE_OTHER_TYPE>
4498 bool *isInsertedFlag,
4501 BDE_OTHER_TYPE&& obj)
4505 const KEY_ARG& lvalue = key;
4510 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
4511 hint = this->find(lvalue, hashCode);
4515 static_cast<NodeType *
>(hint)->value().second =
4517 *isInsertedFlag =
false;
4522 if (d_size >= d_capacity) {
4523 this->rehashForNumBuckets(numBuckets() * 2);
4534 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
4538 *isInsertedFlag =
true;
4543template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4548 if (newNumBuckets > this->numBuckets()) {
4557 static_cast<size_t>(newNumBuckets),
4560 this->rehashIntoExactlyNumBuckets(numBuckets,
4565template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4578 hashCodeForNode(node));
4586template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4590 this->removeAllImp();
4603template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4609 if (numElements < 1) {
4613 if (numElements > d_capacity) {
4622 static_cast<size_t>(this->numBuckets()),
4625 this->rehashIntoExactlyNumBuckets(numBuckets,
4630template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4633 float newMaxLoadFactor)
4641 std::max<SizeType>(d_size, 1u),
4642 static_cast<size_t>(this->numBuckets()),
4645 this->rehashIntoExactlyNumBuckets(numBuckets,
4650 d_maxLoadFactor = newMaxLoadFactor;
4653template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4659 if (AllocatorTraits::propagate_on_container_swap::value) {
4660 quickSwapExchangeAllocators(&other);
4668 quickSwapRetainAllocators(&other);
4672#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
4673template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4674template <
class... ARGS>
4678 bool *isInsertedFlag,
4690 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
4691 hint = this->find(key, hashCode);
4696 *isInsertedFlag =
false;
4700 if (d_size >= d_capacity) {
4701 this->rehashForNumBuckets(numBuckets() * 2);
4705#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
4707 std::piecewise_construct,
4708 std::forward_as_tuple(key),
4709 std::forward_as_tuple(std::forward<ARGS>(args)...));
4711 typedef typename ValueType::second_type MappedType;
4719 AllocatorTraits::construct(alloc, defaultMapped.
address(),
4720 std::forward<ARGS>(args)...);
4731 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
4735 *isInsertedFlag =
true;
4740template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4741template <
class... ARGS>
4745 bool *isInsertedFlag,
4758 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
4759 hint = this->find(lvalue, hashCode);
4764 *isInsertedFlag =
false;
4768 if (d_size >= d_capacity) {
4769 this->rehashForNumBuckets(numBuckets() * 2);
4773#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
4775 std::piecewise_construct,
4776 std::forward_as_tuple(MoveUtil::move(key)),
4777 std::forward_as_tuple(std::forward<ARGS>(args)...));
4779 typedef typename ValueType::second_type MappedType;
4787 AllocatorTraits::construct(alloc, defaultMapped.
address(),
4788 std::forward<ARGS>(args)...);
4792 MoveUtil::move(key),
4799 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
4803 *isInsertedFlag =
true;
4809template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4817template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4828template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4850template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4858template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4866 return static_cast<SizeType>(bucketAtIndex(index).countElements());
4869template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4877template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4883 return bslalg::HashTableImpUtil::find<KEY_CONFIG>(
4890template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4906 KeyRef k = ImpUtil::extractKey<KEY_CONFIG>(first);
4908 while (0 != (first = first->
nextLink()) &&
4909 d_parameters.
comparator()(k,ImpUtil::extractKey<KEY_CONFIG>(first)))
4916template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4927 *first = this->find(key);
4928 *last = *first ? this->findEndOfRange(*first) : 0;
4931template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4948 typedef typename KEY_CONFIG::ValueType
ValueType;
4949 typedef typename ::bsl::allocator_traits<ALLOCATOR>::size_type
SizeType;
4954 if (this->size() != other.
size()) {
4964 ImpUtil::find<KEY_CONFIG>(other.d_anchor,
4965 ImpUtil::extractKey<KEY_CONFIG>(cursor),
4968 ImpUtil::extractKey<KEY_CONFIG>(cursor)));
4981 while (endWalker != endRange) {
4983 if (rhsWalker == rhsLast) {
4990 if (rhsWalker != rhsLast) {
4999 while (cursor != endRange &&
5000 (ImpUtil::extractValue<KEY_CONFIG>(cursor) ==
5001 ImpUtil::extractValue<KEY_CONFIG>(rhsFirst)))
5007 if (cursor == endRange) {
5029 ImpUtil::extractValue<KEY_CONFIG>(marker);
5031 if (cursor != marker) {
5035 while (scanner != marker &&
5036 ImpUtil::extractValue<KEY_CONFIG>(scanner) != valueAtMarker) {
5039 if (scanner != marker) {
5048 if (ImpUtil::extractValue<KEY_CONFIG>(scanner) ==
5060 scanner != endRange;
5063 if (ImpUtil::extractValue<KEY_CONFIG>(scanner) ==
5079template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5087template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5091 return static_cast<float>(
static_cast<double>(this->size())
5092 /
static_cast<double>(this->numBuckets()));
5095template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5100 return d_maxLoadFactor;
5103template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5113 typedef typename AllocatorTraits::
5114 template rebind_traits<bslalg::HashTableBucket>
5115 BucketAllocatorTraits;
5116 typedef typename BucketAllocatorTraits::allocator_type BucketAllocator;
5118 return BucketAllocatorTraits::max_size(BucketAllocator(this->allocator()));
5121template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5126 return AllocatorTraits::max_size(this->allocator()) /
sizeof(
NodeType);
5129template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5137template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5145template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5159template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5184template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5193template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5202template <
class FUNCTOR>
5210template <
class FUNCTOR>
5230template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5238template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5250template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5256 && bslmf::IsBitwiseMoveable<COMPARATOR>::value
5257 && bslmf::IsBitwiseMoveable<ALLOCATOR>::value>
Definition bslma_bslallocator.h:580
Definition bslalg_bidirectionallink.h:346
BidirectionalLink * nextLink() const
Return the address of the next node linked from this node.
Definition bslalg_bidirectionallink.h:421
BidirectionalLink * previousLink() const
Return the address of the preceding node linked from this node.
Definition bslalg_bidirectionallink.h:427
Definition bslalg_bidirectionalnode.h:357
Definition bslalg_functoradapter.h:228
HashTable_HashWrapper< CallableVariable< HASHER >::type > Type
This typedef is an alias for the functor.
Definition bslalg_functoradapter.h:234
Definition bslalg_hashtableanchor.h:541
BidirectionalLink * listRootAddress() const
Return the value listRootAddress attribute of this object.
Definition bslalg_hashtableanchor.h:708
void setBucketArrayAddressAndSize(HashTableBucket *bucketArrayAddress, std::size_t bucketArraySize)
Definition bslalg_hashtableanchor.h:679
std::size_t bucketArraySize() const
Return the value of the bucketArraySize attribute of this object.
Definition bslalg_hashtableanchor.h:714
void swap(HashTableAnchor &other)
Definition bslalg_hashtableanchor.h:701
void setListRootAddress(BidirectionalLink *value)
Definition bslalg_hashtableanchor.h:691
HashTableBucket * bucketArrayAddress() const
Definition bslalg_hashtableanchor.h:720
Definition bslma_allocator.h:457
Definition bslma_destructorguard.h:132
Definition bslmf_movableref.h:751
Definition bslstl_bidirectionalnodepool.h:270
bslalg::BidirectionalLink * cloneNode(const bslalg::BidirectionalLink &original)
Definition bslstl_bidirectionalnodepool.h:479
AllocatorType & allocator()
Definition bslstl_bidirectionalnodepool.h:471
void adopt(bslmf::MovableRef< BidirectionalNodePool > pool)
Definition bslstl_bidirectionalnodepool.h:460
bslalg::BidirectionalLink * emplaceIntoNewNode(Args &&... arguments)
Definition bslstl_bidirectionalnodepool.h:491
void deleteNode(bslalg::BidirectionalLink *linkNode)
Definition bslstl_bidirectionalnodepool.h:517
bslalg::BidirectionalLink * moveIntoNewNode(bslalg::BidirectionalLink *original)
Definition bslstl_bidirectionalnodepool.h:509
void reserveNodes(size_type numNodes)
Definition bslstl_bidirectionalnodepool.h:538
Definition bslstl_hashtable.h:2832
~HashTable_ArrayProctor()
Definition bslstl_hashtable.h:3417
void release()
Definition bslstl_hashtable.h:3436
const FUNCTOR & functor() const
HashTable_ComparatorWrapper(const FUNCTOR &fn)
bool operator()(ARG1_TYPE &arg1, ARG2_TYPE &arg2) const
HashTable_ComparatorWrapper()
Definition bslstl_hashtable.h:1749
void swap(HashTable_ComparatorWrapper &other)
Exchange the value of this object with the specified other object.
Definition bslstl_hashtable.h:3299
const FUNCTOR & functor() const
Definition bslstl_hashtable.h:3291
HashTable_ComparatorWrapper()
Definition bslstl_hashtable.h:3267
bool operator()(ARG1_TYPE &arg1, ARG2_TYPE &arg2) const
Definition bslstl_hashtable.h:3284
HashTable_HashWrapper(const FUNCTOR &fn)
const FUNCTOR & functor() const
std::size_t operator()(ARG_TYPE &arg) const
Definition bslstl_hashtable.h:1624
const FUNCTOR & functor() const
Definition bslstl_hashtable.h:3191
HashTable_HashWrapper()
Definition bslstl_hashtable.h:3168
std::size_t operator()(ARG_TYPE &arg) const
Definition bslstl_hashtable.h:3184
void swap(HashTable_HashWrapper &other)
Exchange the value of this object with the specified other object.
Definition bslstl_hashtable.h:3198
Definition bslstl_hashtable.h:3041
std::size_t hashCodeForKey(DEDUCED_KEY &key) const
Definition bslstl_hashtable.h:3632
HashTable< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR > HashTableType
Definition bslstl_hashtable.h:3059
NodeFactory & nodeFactory()
Definition bslstl_hashtable.h:3575
void quickSwapRetainAllocators(HashTable_ImplParameters *other)
Definition bslstl_hashtable.h:3599
const BaseComparator & comparator() const
Definition bslstl_hashtable.h:3620
BidirectionalNodePool< typename HashTableType::ValueType, NodeAllocator > NodeFactory
Definition bslstl_hashtable.h:3066
const BaseHasher & hasher() const
Definition bslstl_hashtable.h:3643
void quickSwapExchangeAllocators(HashTable_ImplParameters *other)
Definition bslstl_hashtable.h:3583
ReboundTraits::allocator_type NodeAllocator
Definition bslstl_hashtable.h:3062
HashTableType::AllocatorTraits::template rebind_traits< NodeType > ReboundTraits
Definition bslstl_hashtable.h:3061
const HASHER & originalHasher() const
Definition bslstl_hashtable.h:3677
const COMPARATOR & originalComparator() const
Definition bslstl_hashtable.h:3667
Definition bslstl_hashtable.h:2882
~HashTable_NodeProctor()
Definition bslstl_hashtable.h:3383
void release()
Definition bslstl_hashtable.h:3393
Definition bslstl_hashtable.h:1914
bslalg::BidirectionalLink * insertOrAssign(bool *isInsertedFlag, bslalg::BidirectionalLink *hint, BSLS_COMPILERFEATURES_FORWARD_REF(KEY_ARG) key, BDE_OTHER_TYPE &&obj)
Definition bslstl_hashtable.h:4497
bslalg::BidirectionalNode< ValueType > NodeType
Definition bslstl_hashtable.h:1922
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< HASHER, LOOKUP_KEY >::value &&BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, bslalg::BidirectionalLink * >::type tryEmplace(bool *isInsertedFlag, bslalg::BidirectionalLink *hint, LOOKUP_KEY &&key, ARGS &&... args)
Definition bslstl_hashtable.h:2528
HashTable & operator=(const HashTable &rhs)
Definition bslstl_hashtable.h:4172
KEY_CONFIG::KeyType KeyType
Definition bslstl_hashtable.h:1920
void rehashForNumBuckets(SizeType newNumBuckets)
Definition bslstl_hashtable.h:4545
ALLOCATOR AllocatorType
Definition bslstl_hashtable.h:1918
void setMaxLoadFactor(float newMaxLoadFactor)
Definition bslstl_hashtable.h:4632
void swap(HashTable &other)
Definition bslstl_hashtable.h:4655
ALLOCATOR allocator() const
Definition bslstl_hashtable.h:4812
SizeType countElementsInBucket(SizeType index) const
Definition bslstl_hashtable.h:4861
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< HASHER, LOOKUP_KEY >::value &&BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, bslalg::BidirectionalLink * >::type find(const LOOKUP_KEY &key) const
Definition bslstl_hashtable.h:2642
bslalg::BidirectionalLink * tryEmplace(bool *isInsertedFlag, bslalg::BidirectionalLink *hint, const KeyType &key, ARGS &&... args)
Definition bslstl_hashtable.h:4677
SizeType rehashThreshold() const
Definition bslstl_hashtable.h:5140
bslalg::BidirectionalLink * emplaceIfMissing(bool *isInsertedFlag, Args &&... arguments)
::bsl::allocator_traits< AllocatorType > AllocatorTraits
Definition bslstl_hashtable.h:1919
bool hasSameValue(const HashTable &other) const
Definition bslstl_hashtable.h:4933
const COMPARATOR & comparator() const
Definition bslstl_hashtable.h:4853
float maxLoadFactor() const
Definition bslstl_hashtable.h:5098
bslalg::BidirectionalLink * emplace(Args &&... arguments)
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< HASHER, LOOKUP_KEY >::value &&BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, void >::type findRange(bslalg::BidirectionalLink **first, bslalg::BidirectionalLink **last, const LOOKUP_KEY &key) const
Definition bslstl_hashtable.h:2688
bslalg::BidirectionalLink * insert(BSLS_COMPILERFEATURES_FORWARD_REF(SOURCE_TYPE) value)
Definition bslstl_hashtable.h:4475
const HASHER & hasher() const
Definition bslstl_hashtable.h:5082
bslalg::BidirectionalLink * findEndOfRange(bslalg::BidirectionalLink *first) const
Definition bslstl_hashtable.h:4892
bslalg::BidirectionalLink * emplaceWithHint(bslalg::BidirectionalLink *hint, Args &&... arguments)
HashTable & operator=(BloombergLP::bslmf::MovableRef< HashTable > rhs)
AllocatorTraits::size_type SizeType
Definition bslstl_hashtable.h:1923
void reserveForNumElements(SizeType numElements)
Definition bslstl_hashtable.h:4606
SizeType maxSize() const
Definition bslstl_hashtable.h:5124
bslalg::BidirectionalLink * remove(bslalg::BidirectionalLink *node)
Definition bslstl_hashtable.h:4567
SizeType numBuckets() const
Return the number of buckets contained in this hash table.
Definition bslstl_hashtable.h:5132
SizeType maxNumBuckets() const
Definition bslstl_hashtable.h:5106
bsl::remove_const< KeyType >::type NonConstKeyType
Definition bslstl_hashtable.h:1924
HashTable(const ALLOCATOR &basicAllocator=ALLOCATOR())
Definition bslstl_hashtable.h:3690
bslalg::BidirectionalLink * insertIfMissing(const KeyType &key)
Definition bslstl_hashtable.h:4373
~HashTable()
Destroy this object.
Definition bslstl_hashtable.h:3839
SizeType bucketIndexForKey(const KeyType &key) const
Definition bslstl_hashtable.h:4831
bslalg::BidirectionalLink * elementListRoot() const
Definition bslstl_hashtable.h:4872
SizeType size() const
Return the number of elements in this hash table.
Definition bslstl_hashtable.h:5148
KEY_CONFIG::ValueType ValueType
Definition bslstl_hashtable.h:1921
HashTable(BloombergLP::bslmf::MovableRef< HashTable > original, const ALLOCATOR &basicAllocator)
float loadFactor() const
Definition bslstl_hashtable.h:5089
const bslalg::HashTableBucket & bucketAtIndex(SizeType index) const
Definition bslstl_hashtable.h:4820
void removeAll()
Definition bslstl_hashtable.h:4588
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:229
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1762
#define BSLS_COMPILERFEATURES_FORWARD_REF(T)
Definition bsls_compilerfeatures.h:2012
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2018
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
void swap(OptionValue &a, OptionValue &b)
Definition balxml_encoderoptions.h:68
Definition bdlbb_blob.h:576
Definition bslstl_algorithm.h:82
void swap(BidirectionalNodePool< VALUE, ALLOCATOR > &a, BidirectionalNodePool< VALUE, ALLOCATOR > &b)
bool operator==(const BidirectionalIterator< T1, ITER_IMP, TAG_TYPE > &lhs, const BidirectionalIterator< T2, ITER_IMP, TAG_TYPE > &rhs)
bool operator!=(const BidirectionalIterator< T1, ITER_IMP, TAG_TYPE > &lhs, const BidirectionalIterator< T2, ITER_IMP, TAG_TYPE > &rhs)
void swap(TYPE &a, TYPE &b)
t_TYPE & type
This typedef defines the return type of this meta function.
Definition bslmf_addlvaluereference.h:129
Definition bslma_allocatortraits.h:1061
BloombergLP::bslma::AllocatorTraits_SizeType< ALLOCATOR_TYPE >::type size_type
Definition bslma_allocatortraits.h:1165
static void construct(ALLOCATOR_TYPE &basicAllocator, ELEMENT_TYPE *elementAddr, Args &&... arguments)
Definition bslma_allocatortraits.h:1472
Definition bslmf_conditional.h:120
Definition bslmf_enableif.h:525
Definition bslmf_integralconstant.h:244
Definition bslmf_isconvertible.h:867
Definition bslmf_isfunction.h:232
Definition bslmf_ispointer.h:138
t_TYPE type
This typedef is an alias to the (template parameter) t_TYPE.
Definition bslmf_removeconst.h:161
Definition bslalg_hashtablebucket.h:297
Definition bslalg_hashtableimputil.h:613
static void insertAtFrontOfBucket(HashTableAnchor *anchor, BidirectionalLink *link, std::size_t hashCode)
static void remove(HashTableAnchor *anchor, BidirectionalLink *link, std::size_t hashCode)
static void insertAtBackOfBucket(HashTableAnchor *anchor, BidirectionalLink *link, std::size_t hashCode)
static std::size_t computeBucketIndex(std::size_t hashCode, std::size_t numBuckets)
Definition bslalg_hashtableimputil.h:845
static void deallocateObject(const t_ALLOCATOR &allocator, t_POINTER p, std::size_t n=1)
Definition bslma_allocatorutil.h:926
Definition bslma_usesbslmaallocator.h:343
Definition bslmf_isbitwisemoveable.h:718
Definition bslmf_movableref.h:791
static MovableRef< t_TYPE > move(t_TYPE &reference) BSLS_KEYWORD_NOEXCEPT
Definition bslmf_movableref.h:1060
Definition bslstl_hashtable.h:1598
bsl::conditional< bsl::is_function< CALLABLE >::value, typenamebsl::add_lvalue_reference< CALLABLE >::type, CALLABLE >::type type
Definition bslstl_hashtable.h:1604
Definition bslstl_hashtable.h:3023
Definition bslstl_hashtable.h:3030
Definition bslstl_hashtable.h:2923
static bslma::Allocator * incidentalAllocator()
static bslalg::HashTableBucket * defaultBucketAddress()
static size_t nextPrime(size_t n)
static size_t growBucketsForLoadFactor(size_t *capacity, size_t minElements, size_t requestedBuckets, double maxLoadFactor)
Definition bslstl_hashtable.h:2972
static void destroyBucketArray(bslalg::HashTableBucket *data, std::size_t bucketArraySize, const ALLOCATOR &allocator)
Definition bslstl_hashtable.h:3471
static void initAnchor(bslalg::HashTableAnchor *anchor, std::size_t bucketArraySize, const ALLOCATOR &allocator)
Definition bslstl_hashtable.h:3497
static void assertNotNullPointer(TYPE &)
Definition bslstl_hashtable.h:3447
Definition bsls_objectbuffer.h:276
TYPE * address()
Definition bsls_objectbuffer.h:334
TYPE & object()
Definition bsls_objectbuffer.h:351