Associative array of ItemInternal. More...
#include <arcane/mesh/ItemInternalMap.h>
Classes | |
| class | LookupData |
Public Types | |
| using | ValueType = ItemInternal* |
Public Member Functions | |
| bool | add (Int64 key, ItemInternal *v) |
| Adds the value v corresponding to the key key. | |
| void | clear () |
| Removes all elements from the table. | |
| Int32 | count () const |
| Number of elements in the table. | |
| void | remove (Int64 key) |
| Removes the value associated with the key key. | |
| bool | hasKey (Int64 key) |
| true if a value with the key id is present | |
| void | resize (Int32 new_size, bool use_prime=false) |
| Resizes the hash table. | |
| void | notifyUniqueIdsChanged () |
| Notifies that the unique IDs of the entities have changed. | |
| template<class Lambda> | |
| void | eachItem (const Lambda &lambda) |
| Template function to iterate over the instance's entities. | |
| Int32 | nbBucket () const |
| Number of buckets. | |
| impl::ItemBase | tryFind (Int64 key) const |
| Returns the entity associated with key if found, or the null entity otherwise. | |
| Int32 | tryFindLocalId (Int64 key) const |
| Returns the localId() associated with key if found, or none otherwise. | |
| impl::ItemBase | findItem (Int64 uid) const |
| Returns the unique ID entity uid. | |
| Int32 | findLocalId (Int64 uid) const |
| Returns the local number of the unique ID entity uid. | |
| void | checkValid () const |
| Data * | lookup (Int64 key) |
| const Data * | lookup (Int64 key) const |
| ConstArrayView< BaseData * > | buckets () const |
| BaseData * | lookupAdd (Int64 id, ItemInternal *value, bool &is_add) |
| BaseData * | lookupAdd (Int64 uid) |
| ItemInternal * | lookupValue (Int64 uid) const |
| ItemInternal * | operator[] (Int64 uid) const |
Static Public Attributes | |
| static constexpr bool | UseNewImpl = 1 |
Private Types | |
| using | LegacyImpl = HashTableMapT<Int64, ItemInternal*> |
| using | NewImpl = impl::HashTableMap2<Int64, ItemInternal*> |
| using | BaseData = LegacyImpl::Data |
Private Member Functions | |
| void | _changeLocalIds (ArrayView< ItemInternal * > items_internal, ConstArrayView< Int32 > old_to_new_local_ids) |
| Changes the values of localId(). | |
| LookupData | _lookupAdd (Int64 id, ItemInternal *value, bool &is_add) |
| ItemInternal * | _tryFindItemInternal (Int64 key) const |
| Returns the entity associated with key if found, or nullptr otherwise. | |
| void _throwNotFound | ARCANE_NORETURN (Int64 id) const |
| void _throwNotSupported | ARCANE_NORETURN (const char *func_name) const |
| void | _checkValid (Int64 uid, ItemInternal *v) const |
Private Attributes | |
| NewImpl | m_new_impl |
Friends | |
| class | DynamicMeshKindInfos |
Associative array of ItemInternal.
This class is internal to Arcane.
The key of this associative array is the UniqueId of the entities. If it changes, you must call notifyUniqueIdsChanged() to update the associative array.
Definition at line 52 of file ItemInternalMap.h.
|
private |
Definition at line 61 of file ItemInternalMap.h.
|
private |
Definition at line 59 of file ItemInternalMap.h.
|
private |
Definition at line 60 of file ItemInternalMap.h.
| using Arcane::mesh::ItemInternalMap::ValueType = ItemInternal* |
Definition at line 104 of file ItemInternalMap.h.
| Arcane::mesh::ItemInternalMap::ItemInternalMap | ( | ) |
Definition at line 33 of file ItemInternalMap.cc.
|
private |
Changes the values of localId().
Definition at line 74 of file ItemInternalMap.cc.
References Arcane::ItemBase::localId().
|
private |
Definition at line 124 of file ItemInternalMap.cc.
|
inlineprivate |
Definition at line 294 of file ItemInternalMap.h.
|
inlineprivate |
Returns the entity associated with key if found, or nullptr otherwise.
Definition at line 302 of file ItemInternalMap.h.
|
inline |
Adds the value v corresponding to the key key.
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 120 of file ItemInternalMap.h.
Referenced by Arcane::mesh::ItemFamily::experimentalChangeUniqueId(), and Arcane::mesh::ParallelAMRConsistency::makeNewItemsConsistent().
|
inline |
Definition at line 250 of file ItemInternalMap.h.
| void Arcane::mesh::ItemInternalMap::checkValid | ( | ) | const |
Definition at line 91 of file ItemInternalMap.cc.
|
inline |
Removes all elements from the table.
Definition at line 126 of file ItemInternalMap.h.
|
inline |
Number of elements in the table.
Definition at line 132 of file ItemInternalMap.h.
Referenced by Arcane::mesh::FaceUniqueIdBuilder2::_computeSequential(), and Arcane::mesh::ItemFamily::removeNeedRemoveMarkedItems().
|
inline |
Template function to iterate over the instance's entities.
The type of the template argument can be any type of entity that can be constructed from an impl::ItemBase.
Definition at line 181 of file ItemInternalMap.h.
Referenced by Arcane::mesh::FaceUniqueIdBuilder2::_checkFacesUniqueId(), Arcane::mesh::FaceUniqueIdBuilder::_checkNoDuplicate(), Arcane::mesh::FaceUniqueIdBuilder2::_computeAndSortBoundaryFaces(), Arcane::mesh::EdgeUniqueIdBuilder::_computeEdgesUniqueIdsSequential(), Arcane::mesh::FaceUniqueIdBuilder::_computeFacesUniqueIdsParallelV1(), Arcane::mesh::FaceUniqueIdBuilder::_computeFacesUniqueIdsParallelV2(), Arcane::mesh::FaceUniqueIdBuilder::_computeFacesUniqueIdsSequential(), Arcane::mesh::FaceUniqueIdBuilder2::_computeParallel(), Arcane::mesh::FaceUniqueIdBuilder2::_computeSequential(), Arcane::mesh::MeshRefinement::_contract(), Arcane::mesh::SubMeshTools::_fillGhostItems(), Arcane::mesh::GhostLayerBuilder2::_markBoundaryItems(), Arcane::mesh::GhostLayerBuilder2::_markBoundaryNodes(), Arcane::mesh::FaceUniqueIdBuilder2::_unsetFacesUniqueId(), Arcane::mesh::GhostLayerBuilder::addGhostChildFromParent(), Arcane::mesh::GhostLayerBuilder2::addGhostLayers(), Arcane::mesh::Parallel3EdgeUniqueIdBuilder::compute(), Arcane::mesh::CartesianFaceUniqueIdBuilder::computeFacesUniqueIdAndOwner(), Arcane::mesh::FaceUniqueIdBuilder2::computeFacesUniqueIdAndOwnerVersion5(), Arcane::mesh::ParallelAMRConsistency::makeNewItemsConsistent2(), notifyUniqueIdsChanged(), Arcane::mesh::DynamicMeshIncrementalBuilder::removeNeedRemoveMarkedItems(), Arcane::mesh::ItemFamily::removeNeedRemoveMarkedItems(), and Arcane::mesh::ParticleFamily::removeNeedRemoveMarkedItems().
|
inline |
Returns the unique ID entity uid.
Throws an exception if the entity is not in the table.
Definition at line 212 of file ItemInternalMap.h.
Referenced by Arcane::mesh::OneMeshItemAdder::_addOneCell(), Arcane::mesh::GhostLayerBuilder::addGhostChildFromParent(), Arcane::mesh::OneMeshItemAdder::addOneParentItem(), and Arcane::mesh::ParallelAMRConsistency::makeNewItemsConsistent().
Returns the local number of the unique ID entity uid.
Throws an exception if the entity is not in the table.
Definition at line 225 of file ItemInternalMap.h.
|
inline |
true if a value with the key id is present
Definition at line 151 of file ItemInternalMap.h.
Referenced by Arcane::mesh::FaceUniqueIdBuilder::_computeFacesUniqueIdsParallelV1().
|
inline |
Definition at line 238 of file ItemInternalMap.h.
|
inline |
Definition at line 244 of file ItemInternalMap.h.
|
inline |
Definition at line 256 of file ItemInternalMap.h.
|
inline |
Definition at line 264 of file ItemInternalMap.h.
|
inline |
Definition at line 270 of file ItemInternalMap.h.
|
inline |
Number of buckets.
Definition at line 187 of file ItemInternalMap.h.
| void Arcane::mesh::ItemInternalMap::notifyUniqueIdsChanged | ( | ) |
Notifies that the unique IDs of the entities have changed.
This call may cause a complete recalculation of the associative array.
Definition at line 41 of file ItemInternalMap.cc.
References ARCANE_FATAL, Arcane::arcaneIsCheck(), eachItem(), Arcane::Item::uniqueId(), and Arcane::ItemBase::uniqueId().
Referenced by Arcane::mesh::ParallelAMRConsistency::makeNewItemsConsistent2().
|
inline |
Definition at line 276 of file ItemInternalMap.h.
|
inline |
Removes the value associated with the key key.
Throws an exception if there are no values associated with the key
Definition at line 142 of file ItemInternalMap.h.
Referenced by Arcane::mesh::ItemFamily::experimentalChangeUniqueId(), and Arcane::mesh::ParallelAMRConsistency::makeNewItemsConsistent().
|
inline |
Resizes the hash table.
Definition at line 157 of file ItemInternalMap.h.
|
inline |
Returns the entity associated with key if found, or the null entity otherwise.
Definition at line 195 of file ItemInternalMap.h.
Referenced by Arcane::mesh::FaceUniqueIdBuilder::_computeFacesUniqueIdsParallelV1(), and Arcane::mesh::FaceUniqueIdBuilder::_computeFacesUniqueIdsParallelV2().
Returns the localId() associated with key if found, or none otherwise.
Definition at line 201 of file ItemInternalMap.h.
|
friend |
Definition at line 55 of file ItemInternalMap.h.
|
private |
Definition at line 283 of file ItemInternalMap.h.
|
staticconstexpr |
Definition at line 65 of file ItemInternalMap.h.