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

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

#include <QuadraticProbingHashTable.h>

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

Public Types

typedef QuadraticProbingHashTableImplementation< KeyT, DataT, HashT, AllocatorT > Implementation
 
- Public Types inherited from agx::QuadraticProbingHashTableImplementation< KeyT, DataT, HashT, AllocatorT >
typedef template_iterator< const QuadraticProbingHashTableImplementation< KeyT, DataT, HashT, AllocatorT > > const_iterator
 
typedef HashT hash_fn_type
 
typedef template_iterator< QuadraticProbingHashTableImplementation< KeyT, DataT, HashT, AllocatorT > > iterator
 Iterators.
 
typedef KeyT key_type
 
typedef DataT value_type
 
- Public Types inherited from agx::Container
enum  ClearPolicy { SHRINK_BUFFER , SHRINK_BUFFER_AVERAGED , MAINTAIN_BUFFER }
 agxData::Values from this enumeration is passed to the subclasses' 'clear' method in order to control what should become of the container's memory. More...
 

Public Member Functions

 QuadraticProbingHashTable (const AllocatorT &allocator=AllocatorT())
 
- Public Member Functions inherited from agx::QuadraticProbingHashTableImplementation< KeyT, DataT, HashT, AllocatorT >
 QuadraticProbingHashTableImplementation (const AllocatorT &allocator=AllocatorT())
 Constructor.
 
 QuadraticProbingHashTableImplementation (const QuadraticProbingHashTableImplementation< KeyT, DataT, HashT, AllocatorT > &other)
 Copy constructor.
 
 ~QuadraticProbingHashTableImplementation ()
 Destructor.
 
AllocatorT & allocator ()
 
const AllocatorT & allocator () const
 
iterator begin ()
 Iterator to first element in hash table.
 
const_iterator begin () const
 
void clear (ClearPolicy policy=SHRINK_BUFFER_AVERAGED)
 Remove all elements.
 
bool contains (const KeyT &key) const
 Boolean query to test existence of an element.
 
iterator end ()
 Iterator marking end of hash table.
 
const_iterator end () const
 
iterator erase (const iterator &it)
 Erase an element using an iterator.
 
bool erase (const KeyT &key)
 Erase an element from the hash table.
 
iterator find (const KeyT &key)
 Find an element.
 
const_iterator find (const KeyT &key) const
 
const Bucket * getBucketBuffer () const
 
size_t getMaxProbeLength () const
 
size_t getNumBuckets () const
 
DataT & getOrCreate (const KeyT &key)
 Returns value given key.
 
insert_iterator insert (const KeyT &key, const DataT &data)
 Insert an element, overwriting if key already exists.
 
QuadraticProbingHashTableImplementation< KeyT, DataT, HashT, AllocatorT > & operator= (const QuadraticProbingHashTableImplementation< KeyT, DataT, HashT, AllocatorT > &other)
 Assignment operator.
 
DataT & operator[] (const KeyT &key)
 Index operator for accessing elements in the hash, inserting it if not found.
 
const DataT & operator[] (const KeyT &key) const
 
template<typename T >
void purge (T purger)
 Purge the hash table.
 
void reserve (size_t size)
 Reserve capacity in the hash table.
 
- Public Member Functions inherited from agx::Container
size_t capacity () const
 Returns the size of the memory are used by the container to store its elements.
 
bool empty () const
 
void * ptr ()
 
const void * ptr () const
 
size_t size () const
 

Additional Inherited Members

- Protected Member Functions inherited from agx::QuadraticProbingHashTableImplementation< KeyT, DataT, HashT, AllocatorT >
Bucket * buckets () const
 
bool eraseBucket (size_t index)
 
template<typename T2 >
size_t findBucket (const T2 &key) const
 
size_t & numBuckets ()
 
size_t numBuckets () const
 
size_t & numFilled ()
 
size_t numFilled () const
 
void rebuild (size_t size)
 Rebuild, and optionally resize hash table.
 
- Protected Member Functions inherited from agx::Container
 Container ()
 
 Container (const Container &other)
 
 Container (Container &&other)
 
 ~Container ()
 
- Protected Attributes inherited from agx::Container
void * m_buffer
 
size_t m_capacity
 
size_t m_size
 

Detailed Description

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

Inheritance with partial specialization due to bug with ref_ptr containers.

And partial specialization only works on classes, not methods (which would have been a cleaner solution).

See full comment in HashSet.h

Definition at line 698 of file QuadraticProbingHashTable.h.

Member Typedef Documentation

◆ Implementation

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

Definition at line 701 of file QuadraticProbingHashTable.h.

Constructor & Destructor Documentation

◆ QuadraticProbingHashTable()

template<typename KeyT , typename DataT , typename HashT = HashFn<KeyT>, typename AllocatorT = ByteAllocator>
agx::QuadraticProbingHashTable< KeyT, DataT, HashT, AllocatorT >::QuadraticProbingHashTable ( const AllocatorT &  allocator = AllocatorT())
inline

Definition at line 703 of file QuadraticProbingHashTable.h.


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