Classes | |
| struct | Data |
Public Types | |
| typedef KeyTraitsType::KeyTypeConstRef | KeyTypeConstRef |
| typedef KeyTraitsType::KeyTypeValue | KeyTypeValue |
| typedef KeyTraitsType::Printable | Printable |
| typedef KeyTraitsType::HashValueType | HashValueType |
| typedef HashTableMapT< KeyType, ValueType, KeyTraitsType > | ThatClass |
| typedef HashTableMapEnumeratorT< KeyType, ValueType > | Enumerator |
Public Member Functions | |
| HashTableMapT (Integer table_size, bool use_prime) | |
| Creates a table of size table_size. | |
| HashTableMapT (Integer table_size, bool use_prime, Integer buffer_size) | |
| Creates a table of size table_size. | |
| ThatClass & | operator= (const ThatClass &from) |
| Copy assignment operator. | |
| bool | hasKey (KeyTypeConstRef id) |
| true if a value with key id is present | |
| void | clear () |
| Deletes all elements from the table. | |
| Data * | lookup (KeyTypeConstRef id) |
| Searches for the value corresponding to key id. | |
| const Data * | lookup (KeyTypeConstRef id) const |
| Searches for the value corresponding to key id. | |
| ValueType & | lookupValue (KeyTypeConstRef id) |
| Searches for the value corresponding to key id. | |
| ValueType & | operator[] (KeyTypeConstRef id) |
| Searches for the value corresponding to key id. | |
| const ValueType & | lookupValue (KeyTypeConstRef id) const |
| Searches for the value corresponding to key id. | |
| const ValueType & | operator[] (KeyTypeConstRef id) const |
| Searches for the value corresponding to key id. | |
| bool | add (KeyTypeConstRef id, const ValueType &value) |
| Adds the value value corresponding to key id. | |
| void | remove (KeyTypeConstRef id) |
| Removes the value associated with key id. | |
| Data * | lookupAdd (KeyTypeConstRef id, const ValueType &value, bool &is_add) |
| Searches for or adds the value corresponding to key id. | |
| Data * | lookupAdd (KeyTypeConstRef id) |
| Searches for or adds the value corresponding to key id. | |
| void | nocheckAdd (KeyTypeConstRef id, const ValueType &value) |
| Adds the value value corresponding to the key id. | |
| ArrayView< Data * > | buckets () |
| ConstArrayView< Data * > | buckets () const |
| void | resize (Integer new_size, bool use_prime=false) |
| Resizes the hash table. | |
| void | rehash () |
| Rehashes the data after changing key values. | |
| template<class Lambda> | |
| void | each (const Lambda &lambda) |
| Applies the functor f to all elements of the collection. | |
| template<class Lambda> | |
| void | eachValue (const Lambda &lambda) |
| Applies the functor f to all elements of the collection and uses x->value() (of type ValueType) as an argument. | |
| 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. | |
Public Attributes | |
| Int64 | m_nb_collision = 0 |
| Int64 | m_nb_direct = 0 |
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. | |
Definition at line 53 of file HashTableMap.h.
| typedef HashTableMapEnumeratorT<KeyType, ValueType> Arcane::HashTableMapT< KeyType, ValueType, KeyTraitsType >::Enumerator |
Definition at line 63 of file HashTableMap.h.
| typedef KeyTraitsType::HashValueType Arcane::HashTableMapT< KeyType, ValueType, KeyTraitsType >::HashValueType |
Definition at line 61 of file HashTableMap.h.
| typedef KeyTraitsType::KeyTypeConstRef Arcane::HashTableMapT< KeyType, ValueType, KeyTraitsType >::KeyTypeConstRef |
Definition at line 58 of file HashTableMap.h.
| typedef KeyTraitsType::KeyTypeValue Arcane::HashTableMapT< KeyType, ValueType, KeyTraitsType >::KeyTypeValue |
Definition at line 59 of file HashTableMap.h.
| typedef KeyTraitsType::Printable Arcane::HashTableMapT< KeyType, ValueType, KeyTraitsType >::Printable |
Definition at line 60 of file HashTableMap.h.
| typedef HashTableMapT<KeyType, ValueType, KeyTraitsType> Arcane::HashTableMapT< KeyType, ValueType, KeyTraitsType >::ThatClass |
Definition at line 62 of file HashTableMap.h.
|
inline |
Creates a table of size table_size.
If use_prime is true, it uses the nearestPrimeNumber() function to have a size that is a prime number.
Definition at line 109 of file HashTableMap.h.
|
inline |
Creates a table of size table_size.
If use_prime is true, it uses the nearestPrimeNumber() function to have a size that is a prime number.
Definition at line 127 of file HashTableMap.h.
|
inline |
Definition at line 139 of file HashTableMap.h.
|
inline |
Adds the value value corresponding to key id.
If a value corresponding to id already exists, it is replaced.
| true | if the key is added |
| false | if the key already exists and is replaced |
Definition at line 263 of file HashTableMap.h.
|
inline |
Definition at line 350 of file HashTableMap.h.
|
inline |
Definition at line 355 of file HashTableMap.h.
|
inline |
Deletes all elements from the table.
Definition at line 181 of file HashTableMap.h.
Referenced by resize().
|
inline |
Applies the functor f to all elements of the collection.
Definition at line 385 of file HashTableMap.h.
|
inline |
Applies the functor f to all elements of the collection and uses x->value() (of type ValueType) as an argument.
Definition at line 400 of file HashTableMap.h.
|
inline |
true if a value with key id is present
Definition at line 170 of file HashTableMap.h.
|
inline |
Searches for the value corresponding to key id.
Definition at line 192 of file HashTableMap.h.
|
inline |
Searches for the value corresponding to key id.
Definition at line 202 of file HashTableMap.h.
|
inline |
Searches for or adds the value corresponding to key id.
If key id is already in the table, returns a reference to this value and sets is_add to false. Otherwise, adds key id with value ValueType() (which must exist).
The returned structure is never null and can be kept because it does not change address as long as this hash table instance exists
Definition at line 323 of file HashTableMap.h.
|
inline |
Searches for or adds the value corresponding to key id.
If key id is already in the table, returns a reference to this value and sets is_add to false. Otherwise, adds key id with value value and sets is_add to true.
The returned structure is never null and can be kept because it does not change address as long as this hash table instance exists
Definition at line 297 of file HashTableMap.h.
|
inline |
Searches for the value corresponding to key id.
An exception is generated if the value is not found.
Definition at line 212 of file HashTableMap.h.
Referenced by operator[](), and operator[]().
|
inline |
Searches for the value corresponding to key id.
An exception is generated if the value is not found.
Definition at line 236 of file HashTableMap.h.
|
inline |
Adds the value value corresponding to the key id.
If a value corresponding to id already exists, the result is undefined.
Definition at line 343 of file HashTableMap.h.
|
inline |
Copy assignment operator.
Definition at line 145 of file HashTableMap.h.
|
inline |
Searches for the value corresponding to key id.
An exception is generated if the value is not found.
Definition at line 226 of file HashTableMap.h.
|
inline |
Searches for the value corresponding to key id.
An exception is generated if the value is not found.
Definition at line 250 of file HashTableMap.h.
|
inline |
Rehashes the data after changing key values.
Definition at line 376 of file HashTableMap.h.
|
inline |
Removes the value associated with key id.
Definition at line 279 of file HashTableMap.h.
|
inline |
Resizes the hash table.
Definition at line 361 of file HashTableMap.h.
|
mutable |
Definition at line 446 of file HashTableMap.h.
|
mutable |
Definition at line 447 of file HashTableMap.h.