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) |
| Makes room for new_size entries. | |
| 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 303 of file ItemInternalMap.h.
|
inlineprivate |
Returns the entity associated with key if found, or nullptr otherwise.
Definition at line 311 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 259 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(), Arcane::mesh::FaceUniqueIdBuilder::_v1Distributed(), 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 190 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::_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::FaceUniqueIdBuilder::_v1AssignFaceUniqueIds(), Arcane::mesh::FaceUniqueIdBuilder::_v1ByAllGather(), Arcane::mesh::FaceUniqueIdBuilder::_v1CellBlockSizes(), Arcane::mesh::FaceUniqueIdBuilder::_v1CheckAndDump(), Arcane::mesh::FaceUniqueIdBuilder::_v1Distributed(), 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 221 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 234 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::_v1ByAllGather().
|
inline |
Definition at line 247 of file ItemInternalMap.h.
|
inline |
Definition at line 253 of file ItemInternalMap.h.
|
inline |
Definition at line 265 of file ItemInternalMap.h.
|
inline |
Definition at line 273 of file ItemInternalMap.h.
|
inline |
Definition at line 279 of file ItemInternalMap.h.
|
inline |
Number of buckets.
Definition at line 196 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 285 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 |
Makes room for new_size entries.
Called before a batch of insertions by a family that knows how many items it is about to add, so that the table is sized once instead of growing by doubling and rehashing at each step. use_prime belonged to the previous implementation and is ignored.
Definition at line 164 of file ItemInternalMap.h.
|
inline |
Returns the entity associated with key if found, or the null entity otherwise.
Definition at line 204 of file ItemInternalMap.h.
Referenced by Arcane::mesh::FaceUniqueIdBuilder::_computeFacesUniqueIdsParallelV2(), and Arcane::mesh::FaceUniqueIdBuilder::_v1ByAllGather().
Returns the localId() associated with key if found, or none otherwise.
Definition at line 210 of file ItemInternalMap.h.
|
friend |
Definition at line 55 of file ItemInternalMap.h.
|
private |
Definition at line 292 of file ItemInternalMap.h.
|
staticconstexpr |
Definition at line 65 of file ItemInternalMap.h.