Quick Links: |
#include <bslstl_hashtable.h>
Public Types | |
typedef HashTable< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR > | HashTableType |
typedef HashTableType::AllocatorTraits::template rebind_traits< NodeType > | ReboundTraits |
typedef ReboundTraits::allocator_type | NodeAllocator |
typedef BidirectionalNodePool < typename HashTableType::ValueType, NodeAllocator > | NodeFactory |
Public Member Functions | |
HashTable_ImplParameters (const ALLOCATOR &allocator) | |
HashTable_ImplParameters (const HASHER &hash, const COMPARATOR &compare, const ALLOCATOR &allocator) | |
HashTable_ImplParameters (const HashTable_ImplParameters &original, const ALLOCATOR &allocator) | |
HashTable_ImplParameters (bslmf::MovableRef< HashTable_ImplParameters > original) | |
NodeFactory & | nodeFactory () |
void | quickSwapExchangeAllocators (HashTable_ImplParameters *other) |
void | quickSwapRetainAllocators (HashTable_ImplParameters *other) |
const BaseComparator & | comparator () const |
template<class DEDUCED_KEY > | |
std::size_t | hashCodeForKey (DEDUCED_KEY &key) const |
const BaseHasher & | hasher () const |
const NodeFactory & | nodeFactory () const |
const COMPARATOR & | originalComparator () const |
const HASHER & | originalHasher () const |
This class holds all the parameterized parts of a HashTable
class, efficiently exploiting the empty base optimization without adding unforeseen namespace associations to the HashTable
class itself due to the structural inheritance.
See Component bslstl_hashtable
typedef HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR> bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::HashTableType |
typedef HashTableType::AllocatorTraits:: template rebind_traits<NodeType> bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::ReboundTraits |
typedef ReboundTraits::allocator_type bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::NodeAllocator |
typedef BidirectionalNodePool<typename HashTableType::ValueType, NodeAllocator> bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::NodeFactory |
bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::HashTable_ImplParameters | ( | const ALLOCATOR & | allocator | ) | [explicit] |
Create a HashTable_ImplParameters
object having default constructed HASHER
and COMPARATOR
functors, and using the specified allocator
to provide a BidirectionalNodePool
.
bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::HashTable_ImplParameters | ( | const HASHER & | hash, | |
const COMPARATOR & | compare, | |||
const ALLOCATOR & | allocator | |||
) |
Create a HashTable_ImplParameters
object having the specified hash
and compare
functors, and using the specified allocator
to provide a BidirectionalNodePool
.
bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::HashTable_ImplParameters | ( | const HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR > & | original, | |
const ALLOCATOR & | allocator | |||
) |
Create a HashTable_ImplParameters
object having the same hasher
and comparator
attributes as the specified original
, and providing a BidirectionalNodePool
using the specified allocator
.
bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::HashTable_ImplParameters | ( | bslmf::MovableRef< HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR > > | original | ) |
Create a HashTable_ImplParameters
object with a copy of the hasher
and comparator
attributes associated with the specified original
parameters object, and adopting all outstanding memory allocations and the allocator associated with original
. Note that original
is left in a valid but unspecified state.
NodeFactory& bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::nodeFactory | ( | ) |
Return a reference offering modifiable access to the nodeFactory
owned by this object.
void bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::quickSwapExchangeAllocators | ( | HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR > * | other | ) |
Efficiently exchange the value, functor, and allocator of this object with those of the specified other
object. This method provides the no-throw exception-safety guarantee.
void bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::quickSwapRetainAllocators | ( | HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR > * | other | ) |
Efficiently exchange the value and functors this object with those of the specified other
object. This method provides the no-throw exception-safety guarantee. The behavior is undefined unless this object was created with the same allocator as other
.
const BaseComparator& bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::comparator | ( | ) | const |
Return a reference offering non-modifiable access to the comparator
functor owned by this object.
Referenced by bslstl::HashTable< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::find().
std::size_t bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::hashCodeForKey | ( | DEDUCED_KEY & | key | ) | const |
Return the hash code for the specified key
using a copy of the hash functor supplied at construction. Note that this function is provided as a common way to resolve const_cast
issues in the case that the stored hash functor has a function call operator that is not declared as const
.
Referenced by bslstl::HashTable< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::find().
const BaseHasher& bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::hasher | ( | ) | const |
Return a reference offering non-modifiable access to the hasher
functor owned by this object.
const NodeFactory& bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::nodeFactory | ( | ) | const |
Return a reference offering non-modifiable access to the nodeFactory
owned by this object.
const COMPARATOR& bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::originalComparator | ( | ) | const |
Return a reference offering non-modifiable access to the comparator
functor owned by this object.
const HASHER& bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::originalHasher | ( | ) | const |
Return a reference offering non-modifiable access to the hasher
functor owned by this object.