AGX Dynamics 2.42.1.1
Loading...
Searching...
No Matches
agx::LinearProbingHashTable< KeyT, DataT, HashT, AllocatorT > Class Template Reference

Inheritance with partial specialization due to bug with ref_ptr containers. More...

#include <LinearProbingHashTable.h>

+ Inheritance diagram for agx::LinearProbingHashTable< KeyT, DataT, HashT, AllocatorT >:

Public Types

typedef LinearProbingHashTableImplementation< KeyT, DataT, HashT, AllocatorT > Implementation
 
- Public Types inherited from agx::LinearProbingHashTableImplementation< KeyT, ValueT, HashT, AllocatorT >
using bucket_type = PairT
 
enum  ClearPolicy { SHRINK_BUFFER , SHRINK_BUFFER_AVERAGED , MAINTAIN_BUFFER }
 
using const_reference = const PairT &
 
using key_type = KeyT
 
using reference = PairT &
 
using size_type = size_t
 
using value_type = ValueT
 

Public Member Functions

 LinearProbingHashTable ()
 
- Public Member Functions inherited from agx::LinearProbingHashTableImplementation< KeyT, ValueT, HashT, AllocatorT >
 LinearProbingHashTableImplementation ()=default
 
 LinearProbingHashTableImplementation (const LinearProbingHashTableImplementation &other)
 
 LinearProbingHashTableImplementation (LinearProbingHashTableImplementation &&other)
 
 ~LinearProbingHashTableImplementation ()
 
iterator begin ()
 Iterator to first element in hash table.
 
const_iterator begin () const
 Iterator to first element in hash table.
 
size_t capacity () const
 
void clear (int policy=SHRINK_BUFFER_AVERAGED)
 Remove all elements.
 
void clearResize (size_t num_elems)
 Resize the table to fit at least num_elems elements and clear all existing entries.
 
bool contains (const KeyT &k) const
 Check if the hash table contains a key/value pair for the given key.
 
size_t count (const KeyT &k) const
 Count the number of key/value pairs matching the given key.
 
bool empty () const
 
iterator end ()
 Iterator marking end of hash table.
 
const_iterator end () const
 Iterator marking end of hash table.
 
bool erase (const KeyT &key)
 Erase an element from the hash table.
 
iterator erase (iterator it)
 Erase an element from the hash table.
 
iterator find (const KeyT &key)
 Find a key/value pair in the hash table given a key.
 
const_iterator find (const KeyT &key) const
 Find a key/value pair in the hash table given a key.
 
const ValueT get_or_return_default (const KeyT &k) const
 
iterator insert (const KeyT &key, const ValueT value)
 Insert a key/value pair into the hash table.
 
iterator insert (const std::pair< KeyT, ValueT > &p)
 
void insert (const_iterator begin, const_iterator end)
 Insert all elements in the given range.
 
void insert_unique (KeyT &&key, ValueT &&value)
 Insert a key/value pair into the hash table assuming that the given key does not already exist in the hash table.
 
void insert_unique (std::pair< KeyT, ValueT > &&p)
 
LinearProbingHashTableImplementationoperator= (const LinearProbingHashTableImplementation &other)
 
LinearProbingHashTableImplementationoperator= (LinearProbingHashTableImplementation &&other)
 
ValueT & operator[] (const KeyT &key)
 Return the value associated with the given key.
 
const void * ptr () const
 
void reserve (size_t num_elems)
 Make room for this many elements in the hash table.
 
ValueT set_get (const KeyT &key, const ValueT &new_value)
 
size_t size () const
 
void swap (LinearProbingHashTableImplementation &other)
 
ValueT * try_get (const KeyT &k)
 Find the value associated with the given key.
 
const ValueT * try_get (const KeyT &k) const
 Find the value associated with the given key.
 

Additional Inherited Members

- Protected Member Functions inherited from agx::LinearProbingHashTableImplementation< KeyT, ValueT, HashT, AllocatorT >
void erase_bucket (size_t bucket)
 
template<typename T2 >
size_t find_filled_bucket (const T2 &key) const
 

Detailed Description

template<typename KeyT, typename DataT, typename HashT = agx::HashFn<KeyT>, typename AllocatorT = ByteAllocator>
class agx::LinearProbingHashTable< KeyT, DataT, HashT, AllocatorT >

Inheritance with partial specialization due to bug with ref_ptr containers.

Partial specialization only works on classes, not methods which would have been a cleaner solution.

See full comment in HashSet.h

Definition at line 926 of file LinearProbingHashTable.h.

Member Typedef Documentation

◆ Implementation

template<typename KeyT , typename DataT , typename HashT = agx::HashFn<KeyT>, typename AllocatorT = ByteAllocator>
typedef LinearProbingHashTableImplementation<KeyT, DataT, HashT, AllocatorT> agx::LinearProbingHashTable< KeyT, DataT, HashT, AllocatorT >::Implementation

Definition at line 929 of file LinearProbingHashTable.h.

Constructor & Destructor Documentation

◆ LinearProbingHashTable()

template<typename KeyT , typename DataT , typename HashT = agx::HashFn<KeyT>, typename AllocatorT = ByteAllocator>
agx::LinearProbingHashTable< KeyT, DataT, HashT, AllocatorT >::LinearProbingHashTable ( )
inline

Definition at line 931 of file LinearProbingHashTable.h.


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