Nugget
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
eastl::intrusive_hashtable< Key, Value, Hash, Equal, bucketCount, bConstIterators, bUniqueKeys > Class Template Reference

#include <intrusive_hashtable.h>

Public Types

enum  { kBucketCount = bucketCount }
 
typedef intrusive_hashtable< Key, Value, Hash, Equal, bucketCount, bConstIterators, bUniqueKeys > this_type
 
typedef Key key_type
 
typedef Value value_type
 
typedef Value mapped_type
 
typedef Value node_type
 
typedef uint32_t hash_code_t
 
typedef Equal key_equal
 
typedef ptrdiff_t difference_type
 
typedef eastl_size_t size_type
 
typedef value_type & reference
 
typedef const value_type & const_reference
 
typedef intrusive_node_iterator< value_type, bConstIterators > local_iterator
 
typedef intrusive_node_iterator< value_type, true > const_local_iterator
 
typedef intrusive_hashtable_iterator< value_type, bConstIterators > iterator
 
typedef intrusive_hashtable_iterator< value_type, true > const_iterator
 
typedef type_select< bUniqueKeys, pair< iterator, bool >, iterator >::type insert_return_type
 
typedef type_select< bConstIterators, eastl::use_self< Value >, eastl::use_intrusive_key< Value, key_type > >::type extract_key
 

Public Member Functions

 intrusive_hashtable (const Hash &, const Equal &)
 
void swap (this_type &x)
 
iterator begin () EA_NOEXCEPT
 
const_iterator begin () const EA_NOEXCEPT
 
const_iterator cbegin () const EA_NOEXCEPT
 
iterator end () EA_NOEXCEPT
 
const_iterator end () const EA_NOEXCEPT
 
const_iterator cend () const EA_NOEXCEPT
 
local_iterator begin (size_type n) EA_NOEXCEPT
 
const_local_iterator begin (size_type n) const EA_NOEXCEPT
 
const_local_iterator cbegin (size_type n) const EA_NOEXCEPT
 
local_iterator end (size_type) EA_NOEXCEPT
 
const_local_iterator end (size_type) const EA_NOEXCEPT
 
const_local_iterator cend (size_type) const EA_NOEXCEPT
 
size_type size () const EA_NOEXCEPT
 
bool empty () const EA_NOEXCEPT
 
size_type bucket_count () const EA_NOEXCEPT
 
size_type bucket_size (size_type n) const EA_NOEXCEPT
 
size_type bucket (const key_type &k) const EA_NOEXCEPT
 
float load_factor () const EA_NOEXCEPT
 
insert_return_type insert (value_type &value)
 
insert_return_type insert (const_iterator, value_type &value)
 
template<typename InputIterator >
void insert (InputIterator first, InputIterator last)
 
iterator erase (const_iterator position)
 
iterator erase (const_iterator first, const_iterator last)
 
size_type erase (const key_type &k)
 
iterator remove (value_type &value)
 
void clear ()
 
iterator find (const key_type &k)
 
const_iterator find (const key_type &k) const
 
template<typename U , typename UHash , typename BinaryPredicate >
iterator find_as (const U &u, UHash uhash, BinaryPredicate predicate)
 
template<typename U , typename UHash , typename BinaryPredicate >
const_iterator find_as (const U &u, UHash uhash, BinaryPredicate predicate) const
 
template<typename U >
iterator find_as (const U &u)
 
template<typename U >
const_iterator find_as (const U &u) const
 
size_type count (const key_type &k) const
 
eastl::pair< iterator, iteratorequal_range (const key_type &k)
 
eastl::pair< const_iterator, const_iteratorequal_range (const key_type &k) const
 
bool validate () const
 
int validate_iterator (const_iterator i) const
 
Hash hash_function () const
 
Equal equal_function () const
 
const key_equal & key_eq () const
 
key_equal & key_eq ()
 

Protected Member Functions

eastl::pair< iterator, bool > DoInsertValue (value_type &, true_type)
 
iterator DoInsertValue (value_type &, false_type)
 
node_type * DoFindNode (node_type *pNode, const key_type &k) const
 
template<typename U , typename BinaryPredicate >
node_type * DoFindNode (node_type *pNode, const U &u, BinaryPredicate predicate) const
 

Protected Attributes

node_type * mBucketArray [kBucketCount+1]
 
size_type mnElementCount
 
Hash mHash
 
Equal mEqual
 

Detailed Description

template<typename Key, typename Value, typename Hash, typename Equal, size_t bucketCount, bool bConstIterators, bool bUniqueKeys>
class eastl::intrusive_hashtable< Key, Value, Hash, Equal, bucketCount, bConstIterators, bUniqueKeys >

intrusive_hashtable

Member Function Documentation

◆ find_as()

template<typename K , typename V , typename H , typename Eq , size_t bC, bool bM, bool bU>
template<typename U , typename UHash , typename BinaryPredicate >
intrusive_hashtable< K, V, H, Eq, bC, bM, bU >::iterator eastl::intrusive_hashtable< K, V, H, Eq, bC, bM, bU >::find_as ( const U &  u,
UHash  uhash,
BinaryPredicate  predicate 
)
inline

Implements a find whereby the user supplies a comparison of a different type than the hashtable value_type. A useful case of this is one whereby you have a container of string objects but want to do searches via passing in char pointers. The problem is that without this kind of find, you need to do the expensive operation of converting the char pointer to a string so it can be used as the argument to the find function.

Example usage: hash_set<string> hashSet; hashSet.find_as("hello"); // Use default hash and compare.

Example usage (namespaces omitted for brevity): hash_set<string> hashSet; hashSet.find_as("hello", hash<char*>(), equal_to_2<string, char*>());


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