Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::HashTableBase Class Reference

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.

Detailed Description

Definition at line 36 of file HashTable.h.

Constructor & Destructor Documentation

◆ HashTableBase()

Arcane::HashTableBase::HashTableBase ( Integer table_size,
bool use_prime )
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< KeyType, ValueType, KeyTraitsType >::HashTableMapT(), and Arcane::HashTableMapT< KeyType, ValueType, KeyTraitsType >::HashTableMapT().

◆ ~HashTableBase()

virtual Arcane::HashTableBase::~HashTableBase ( )
inlinevirtual

Definition at line 51 of file HashTable.h.

Member Function Documentation

◆ count()

Integer Arcane::HashTableBase::count ( ) const
inline

Number of elements in the table.

Definition at line 65 of file HashTable.h.

References m_count.

◆ nearestPrimeNumber()

Integer Arcane::HashTableBase::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.

Definition at line 56 of file HashTable.cc.

Referenced by HashTableBase(), Arcane::HashTableBaseT< KeyType, TraitsType >::resize(), and Arcane::HashTableMapT< KeyType, ValueType, KeyTraitsType >::resize().

Member Data Documentation

◆ m_count

◆ m_nb_bucket


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