Quick Links:

bal | bbl | bdl | bsl

Public Types | Public Member Functions

bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR > Class Template Reference

#include <bslstl_hashtable.h>

List of all members.

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)
NodeFactorynodeFactory ()
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 NodeFactorynodeFactory () const
const COMPARATOR & originalComparator () const
const HASHER & originalHasher () const

Detailed Description

template<class KEY_CONFIG, class HASHER, class COMPARATOR, class ALLOCATOR>
class bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >

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


Member Typedef Documentation

template<class KEY_CONFIG , class HASHER , class COMPARATOR , class ALLOCATOR >
typedef HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR> bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::HashTableType
template<class KEY_CONFIG , class HASHER , class COMPARATOR , class ALLOCATOR >
typedef HashTableType::AllocatorTraits:: template rebind_traits<NodeType> bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::ReboundTraits
template<class KEY_CONFIG , class HASHER , class COMPARATOR , class ALLOCATOR >
typedef ReboundTraits::allocator_type bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::NodeAllocator
template<class KEY_CONFIG , class HASHER , class COMPARATOR , class ALLOCATOR >
typedef BidirectionalNodePool<typename HashTableType::ValueType, NodeAllocator> bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::NodeFactory

Constructor & Destructor Documentation

template<class KEY_CONFIG , class HASHER , class COMPARATOR , class ALLOCATOR >
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.

template<class KEY_CONFIG , class HASHER , class COMPARATOR , class ALLOCATOR >
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.

template<class KEY_CONFIG , class HASHER , class COMPARATOR , class ALLOCATOR >
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.

template<class KEY_CONFIG , class HASHER , class COMPARATOR , class 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.


Member Function Documentation

template<class KEY_CONFIG , class HASHER , class COMPARATOR , class ALLOCATOR >
NodeFactory& bslstl::HashTable_ImplParameters< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR >::nodeFactory (  ) 

Return a reference offering modifiable access to the nodeFactory owned by this object.

template<class KEY_CONFIG , class HASHER , class COMPARATOR , class ALLOCATOR >
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.

template<class KEY_CONFIG , class HASHER , class COMPARATOR , class ALLOCATOR >
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.

template<class KEY_CONFIG , class HASHER , class COMPARATOR , class ALLOCATOR >
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().

template<class KEY_CONFIG , class HASHER , class COMPARATOR , class ALLOCATOR >
template<class DEDUCED_KEY >
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().

template<class KEY_CONFIG , class HASHER , class COMPARATOR , class ALLOCATOR >
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.

template<class KEY_CONFIG , class HASHER , class COMPARATOR , class ALLOCATOR >
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.

template<class KEY_CONFIG , class HASHER , class COMPARATOR , class ALLOCATOR >
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.

template<class KEY_CONFIG , class HASHER , class COMPARATOR , class ALLOCATOR >
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.


The documentation for this class was generated from the following file: