Base class for a simple hash table for entities. More...
#include <arcane/utils/HashTable.h>
Public Member Functions | |
| HashTableBase (Integer table_size, bool use_prime) | |
| Creates a table of size table_size. | |
| Integer | nearestPrimeNumber (Integer n) |
| Returns the nearest prime number greater than n. The nearest prime number greater than n is returned using a pre-determined prime number table. | |
| Integer | count () const |
| Number of elements in the table. | |
Protected Member Functions | |
| void _throwNotFound | ARCANE_NORETURN () const |
Protected Attributes | |
| Integer | m_count |
| Number of elements. | |
| Integer | m_nb_bucket |
| Number of buckets. | |
Base class for a simple hash table for entities.
Definition at line 36 of file HashTable.h.
|
inline |
Creates a table of size table_size.
If use_prime is true, uses the nearestPrimeNumber() function to have a size that is a prime number.
Definition at line 46 of file HashTable.h.
References m_count, m_nb_bucket, and nearestPrimeNumber().
Referenced by Arcane::HashTableBaseT< KeyType, TraitsType >::HashTableBaseT(), Arcane::HashTableMapT< VariableNameInfo, IVariable *, VNIComparer >::HashTableMapT(), and Arcane::HashTableMapT< VariableNameInfo, IVariable *, VNIComparer >::HashTableMapT().
|
inlinevirtual |
Definition at line 51 of file HashTable.h.
|
inline |
Returns the nearest prime number greater than n. The nearest prime number greater than n is returned using a pre-determined prime number table.
Definition at line 56 of file HashTable.cc.
Referenced by HashTableBase(), Arcane::HashTableBaseT< KeyType, TraitsType >::resize(), and Arcane::HashTableMapT< VariableNameInfo, IVariable *, VNIComparer >::resize().
|
protected |
Number of elements.
Definition at line 76 of file HashTable.h.
Referenced by Arcane::HashTableMapT< VariableNameInfo, IVariable *, VNIComparer >::_rehash(), Arcane::HashTableBaseT< KeyType, TraitsType >::clear(), Arcane::HashTableMapT< VariableNameInfo, IVariable *, VNIComparer >::clear(), count(), HashTableBase(), and Arcane::HashTableMapT< VariableNameInfo, IVariable *, VNIComparer >::operator=().
|
protected |
Number of buckets.
Definition at line 77 of file HashTable.h.
Referenced by Arcane::HashTableMapT< VariableNameInfo, IVariable *, VNIComparer >::_rehash(), HashTableBase(), Arcane::HashTableBaseT< KeyType, TraitsType >::HashTableBaseT(), Arcane::HashTableMapT< VariableNameInfo, IVariable *, VNIComparer >::HashTableMapT(), Arcane::HashTableMapT< VariableNameInfo, IVariable *, VNIComparer >::HashTableMapT(), Arcane::HashTableMapT< VariableNameInfo, IVariable *, VNIComparer >::operator=(), Arcane::HashTableMapT< VariableNameInfo, IVariable *, VNIComparer >::rehash(), Arcane::HashTableBaseT< KeyType, TraitsType >::resize(), and Arcane::HashTableMapT< VariableNameInfo, IVariable *, VNIComparer >::resize().