Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::GroupIndexTable Class Reference

Base class of a hash table between group items and their positions in the table. More...

#include <arcane/core/GroupIndexTable.h>

Inheritance diagram for Arcane::GroupIndexTable:
Collaboration diagram for Arcane::GroupIndexTable:

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

ItemGroupImplm_group_impl = nullptr
UniqueArray< KeyTypeValue > m_key_buffer
UniqueArray< Int32m_next_buffer
 Associated keys table.
UniqueArray< Int32m_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.

Detailed Description

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.

Member Typedef Documentation

◆ KeyTraitsType

typedef HashTraitsT<KeyTypeValue> Arcane::GroupIndexTable::KeyTraitsType

Definition at line 90 of file GroupIndexTable.h.

◆ KeyTypeConstRef

typedef KeyTraitsType::KeyTypeConstRef Arcane::GroupIndexTable::KeyTypeConstRef

Definition at line 91 of file GroupIndexTable.h.

◆ KeyTypeValue

typedef Int32 Arcane::GroupIndexTable::KeyTypeValue

Definition at line 88 of file GroupIndexTable.h.

◆ ValueType

typedef Int32 Arcane::GroupIndexTable::ValueType

Definition at line 89 of file GroupIndexTable.h.

Constructor & Destructor Documentation

◆ GroupIndexTable()

Arcane::GroupIndexTable::GroupIndexTable ( ItemGroupImpl * group_impl)
explicit

Definition at line 35 of file GroupIndexTable.cc.

Member Function Documentation

◆ _checkIntegrity()

bool Arcane::GroupIndexTable::_checkIntegrity ( bool full = true) const
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _hash()

Int32 Arcane::GroupIndexTable::_hash ( KeyTypeConstRef id) const
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _hasKey()

bool Arcane::GroupIndexTable::_hasKey ( KeyTypeConstRef id) const
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _initialized()

bool Arcane::GroupIndexTable::_initialized ( ) const
private

Tests the initialization of the object.

Definition at line 143 of file GroupIndexTable.cc.

References m_buckets.

Referenced by _hash(), and _lookupBucket().

Here is the caller graph for this function:

◆ _lookup()

Int32 Arcane::GroupIndexTable::_lookup ( KeyTypeConstRef id) const
inlineprivate

Search for a key in the entire table.

Definition at line 142 of file GroupIndexTable.h.

References _checkIntegrity(), _hash(), and _lookupBucket().

Here is the call graph for this function:

◆ _lookupBucket()

Int32 Arcane::GroupIndexTable::_lookupBucket ( Int32 bucket,
KeyTypeConstRef id ) const
inlineprivate

Search for a key in a bucket.

Definition at line 135 of file GroupIndexTable.h.

References _initialized().

Referenced by _lookup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _updateSpan()

void Arcane::GroupIndexTable::_updateSpan ( )
private

Definition at line 53 of file GroupIndexTable.cc.

◆ compact()

void Arcane::GroupIndexTable::compact ( const Int32ConstArrayView * info)

Definition at line 94 of file GroupIndexTable.cc.

◆ keyLocalId()

KeyTypeValue Arcane::GroupIndexTable::keyLocalId ( Int32 i) const
inline

Definition at line 107 of file GroupIndexTable.h.

◆ operator[]()

ValueType Arcane::GroupIndexTable::operator[] ( Int32 i) const
inline

Definition at line 105 of file GroupIndexTable.h.

◆ size()

Int32 Arcane::GroupIndexTable::size ( ) const
inline

Definition at line 109 of file GroupIndexTable.h.

◆ update()

void Arcane::GroupIndexTable::update ( )

Definition at line 65 of file GroupIndexTable.cc.

◆ view()

GroupIndexTableView Arcane::GroupIndexTable::view ( ) const
inline

Definition at line 111 of file GroupIndexTable.h.

Member Data Documentation

◆ m_buckets

UniqueArray<Int32> Arcane::GroupIndexTable::m_buckets
private

Associated next index table.

Definition at line 159 of file GroupIndexTable.h.

Referenced by _hasKey(), and _initialized().

◆ m_disable_check_integrity

bool Arcane::GroupIndexTable::m_disable_check_integrity = false
private

Bucket array.

Definition at line 160 of file GroupIndexTable.h.

Referenced by _checkIntegrity().

◆ m_group_impl

ItemGroupImpl* Arcane::GroupIndexTable::m_group_impl = nullptr
private

Definition at line 156 of file GroupIndexTable.h.

◆ m_key_buffer

UniqueArray<KeyTypeValue> Arcane::GroupIndexTable::m_key_buffer
private

Definition at line 157 of file GroupIndexTable.h.

◆ m_next_buffer

UniqueArray<Int32> Arcane::GroupIndexTable::m_next_buffer
private

Associated keys table.

Definition at line 158 of file GroupIndexTable.h.

Referenced by _hasKey().

◆ m_view

GroupIndexTableView Arcane::GroupIndexTable::m_view
private

Definition at line 161 of file GroupIndexTable.h.


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