Base class of a hash table between group items and their positions in the table. More...
#include <arcane/core/GroupIndexTable.h>
Public Types | |
| typedef Int32 | KeyTypeValue |
| typedef Int32 | ValueType |
| typedef HashTraitsT< KeyTypeValue > | KeyTraitsType |
| typedef KeyTraitsType::KeyTypeConstRef | KeyTypeConstRef |
Public Member Functions | |
| GroupIndexTable (ItemGroupImpl *group_impl) | |
| void | update () |
| void | clear () |
| void | compact (const Int32ConstArrayView *info) |
| ValueType | operator[] (Int32 i) const |
| KeyTypeValue | keyLocalId (Int32 i) const |
| Int32 | size () const |
| GroupIndexTableView | view () const |
| Public Member Functions inherited from Arcane::HashTableBase | |
| 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. | |
Private Member Functions | |
| Int32 | _hash (KeyTypeConstRef id) const |
| Hashing function. | |
| bool | _hasKey (KeyTypeConstRef id) const |
| true if a value with key id is present | |
| Int32 | _lookupBucket (Int32 bucket, KeyTypeConstRef id) const |
| Search for a key in a bucket. | |
| Int32 | _lookup (KeyTypeConstRef id) const |
| Search for a key in the entire table. | |
| bool | _initialized () const |
| Tests the initialization of the object. | |
| bool | _checkIntegrity (bool full=true) const |
| Tests the integrity of the table relative to its group. | |
| void | _updateSpan () |
Private Attributes | |
| ItemGroupImpl * | m_group_impl = nullptr |
| UniqueArray< KeyTypeValue > | m_key_buffer |
| UniqueArray< Int32 > | m_next_buffer |
| Associated keys table. | |
| UniqueArray< Int32 > | m_buckets |
| Associated next index table. | |
| bool | m_disable_check_integrity = false |
| Bucket array. | |
| GroupIndexTableView | m_view |
Additional Inherited Members | |
| Protected Member Functions inherited from Arcane::HashTableBase | |
| void _throwNotFound | ARCANE_NORETURN () const |
| Protected Attributes inherited from Arcane::HashTableBase | |
| Integer | m_count |
| Number of elements. | |
| Integer | m_nb_bucket |
| Number of buckets. | |
Base class of a hash table between group items and their positions in the table.
This table is used for partial variables: the position of an entity's data is not its localId() but its position in the group enumerator (i.e.: in the table).
Definition at line 83 of file GroupIndexTable.h.
| typedef HashTraitsT<KeyTypeValue> Arcane::GroupIndexTable::KeyTraitsType |
Definition at line 90 of file GroupIndexTable.h.
| typedef KeyTraitsType::KeyTypeConstRef Arcane::GroupIndexTable::KeyTypeConstRef |
Definition at line 91 of file GroupIndexTable.h.
| typedef Int32 Arcane::GroupIndexTable::KeyTypeValue |
Definition at line 88 of file GroupIndexTable.h.
| typedef Int32 Arcane::GroupIndexTable::ValueType |
Definition at line 89 of file GroupIndexTable.h.
|
explicit |
Definition at line 35 of file GroupIndexTable.cc.
|
private |
Tests the integrity of the table relative to its group.
Definition at line 152 of file GroupIndexTable.cc.
References _hasKey(), ENUMERATE_ITEM, m_disable_check_integrity, and Arcane::StringBuilder::toString().
Referenced by _lookup().
|
inlineprivate |
Hashing function.
Uses the Arcane hash function even if some collisions are observed with small values.
Definition at line 126 of file GroupIndexTable.h.
References _initialized().
Referenced by _hasKey(), and _lookup().
|
private |
true if a value with key id is present
Definition at line 129 of file GroupIndexTable.cc.
References _hash(), m_buckets, and m_next_buffer.
Referenced by _checkIntegrity().
|
private |
Tests the initialization of the object.
Definition at line 143 of file GroupIndexTable.cc.
References m_buckets.
Referenced by _hash(), and _lookupBucket().
|
inlineprivate |
Search for a key in the entire table.
Definition at line 142 of file GroupIndexTable.h.
References _checkIntegrity(), _hash(), and _lookupBucket().
|
inlineprivate |
Search for a key in a bucket.
Definition at line 135 of file GroupIndexTable.h.
References _initialized().
Referenced by _lookup().
|
private |
Definition at line 53 of file GroupIndexTable.cc.
| void Arcane::GroupIndexTable::compact | ( | const Int32ConstArrayView * | info | ) |
Definition at line 94 of file GroupIndexTable.cc.
|
inline |
Definition at line 107 of file GroupIndexTable.h.
|
inline |
Definition at line 105 of file GroupIndexTable.h.
|
inline |
Definition at line 109 of file GroupIndexTable.h.
| void Arcane::GroupIndexTable::update | ( | ) |
Definition at line 65 of file GroupIndexTable.cc.
|
inline |
Definition at line 111 of file GroupIndexTable.h.
|
private |
Associated next index table.
Definition at line 159 of file GroupIndexTable.h.
Referenced by _hasKey(), and _initialized().
|
private |
|
private |
Definition at line 156 of file GroupIndexTable.h.
|
private |
Definition at line 157 of file GroupIndexTable.h.
|
private |
|
private |
Definition at line 161 of file GroupIndexTable.h.