Entity vector. More...
#include <arcane/core/ItemVector.h>
Public Types | |
| using | ItemType = Item |
Public Member Functions | |
| ItemVector (IItemFamily *afamily) | |
| Creates an empty vector associated with the family family. | |
| ItemVector (IItemFamily *afamily, Int32ConstArrayView local_ids) | |
| Creates a vector associated with the family family and containing the entities local_ids. | |
| ItemVector (IItemFamily *afamily, Integer asize) | |
| Creates a vector for size elements associated with the family family. | |
| ItemVector () | |
| Creates a null vector. You must then call setFamily() to use it. | |
| operator ItemVectorView () const | |
| Cast operator to ItemVectorView. | |
| void | setFamily (IItemFamily *afamily) |
| Sets the associated family. | |
| void | add (Int32 local_id) |
| Adds an entity with local ID local_id to the end of the vector. | |
| void | add (ConstArrayView< Int32 > local_ids) |
| Adds a list of entity local IDs local_ids to the end of the vector. | |
| void | addItem (ItemLocalId local_id) |
| Adds an entity with local ID local_id to the end of the vector. | |
| void | addItem (Item item) |
| Adds an entity to the end of the vector. | |
| Int32 | size () const |
| Number of elements in the vector. | |
| void | reserve (Integer capacity) |
| Reserves memory for capacity entities. | |
| void | clear () |
| Removes all entities from the vector. | |
| ItemVectorView | view () const |
| View of the vector. | |
| ArrayView< Int32 > | viewAsArray () |
| View of the local IDs. | |
| ConstArrayView< Int32 > | viewAsArray () const |
| Constant view of the local IDs. | |
| void | removeAt (Int32 index) |
| Removes the entity at index index. | |
| void | resize (Integer new_size) |
| Sets the number of elements in the array. | |
| ItemVector | clone () |
| Clones this vector. | |
| Item | operator[] (Int32 index) const |
| Entity at position index of the vector. | |
| IItemFamily * | family () const |
| Family associated with the vector. | |
| ItemEnumerator | enumerator () const |
| Enumerator. | |
Protected Attributes | |
| SharedArray< Int32 > | m_local_ids |
| IItemFamily * | m_family = nullptr |
| ItemSharedInfo * | m_shared_info = ItemSharedInfo::nullInstance() |
Private Member Functions | |
| void | _init () |
Entity vector.
The ItemVector class uses a reference semantics.
ItemVector is the generic class. It is possible to have a specialized version by entity type via ItemVectorT.
The operation of the entity vector is similar to that of the ItemGroup entity group, with the following differences:
A vector is useful for building a temporary list of entities. It inherits functionalities similar to the Array class and it is therefore possible, for example, to add elements one by one, either via a localId(), or via an entity.
Definition at line 59 of file ItemVector.h.
| using Arcane::ItemVector::ItemType = Item |
Definition at line 63 of file ItemVector.h.
|
explicit |
Creates an empty vector associated with the family family.
Definition at line 37 of file ItemVector.cc.
Referenced by clone(), Arcane::ItemVectorT< Node >::ItemVectorT(), Arcane::ItemVectorT< Node >::ItemVectorT(), Arcane::ItemVectorT< Node >::ItemVectorT(), and Arcane::ItemVectorT< Node >::ItemVectorT().
| Arcane::ItemVector::ItemVector | ( | IItemFamily * | afamily, |
| Int32ConstArrayView | local_ids ) |
Creates a vector associated with the family family and containing the entities local_ids.
Definition at line 48 of file ItemVector.cc.
References Arcane::MemoryUtils::copy(), and Arcane::ConstArrayView< T >::size().
| Arcane::ItemVector::ItemVector | ( | IItemFamily * | afamily, |
| Integer | asize ) |
Creates a vector for size elements associated with the family family.
Definition at line 61 of file ItemVector.cc.
| Arcane::ItemVector::ItemVector | ( | ) |
Creates a null vector. You must then call setFamily() to use it.
Definition at line 73 of file ItemVector.cc.
|
private |
Definition at line 82 of file ItemVector.cc.
|
inline |
Adds a list of entity local IDs local_ids to the end of the vector.
Definition at line 97 of file ItemVector.h.
|
inline |
Adds an entity with local ID local_id to the end of the vector.
Definition at line 94 of file ItemVector.h.
|
inline |
Adds an entity to the end of the vector.
Definition at line 103 of file ItemVector.h.
References Arcane::Item::localId().
|
inline |
Adds an entity with local ID local_id to the end of the vector.
Definition at line 100 of file ItemVector.h.
|
inline |
Removes all entities from the vector.
Definition at line 112 of file ItemVector.h.
|
inline |
Clones this vector.
Definition at line 135 of file ItemVector.h.
References ItemVector().
|
inline |
Enumerator.
Definition at line 144 of file ItemVector.h.
|
inline |
Family associated with the vector.
Definition at line 141 of file ItemVector.h.
|
inline |
Cast operator to ItemVectorView.
Definition at line 82 of file ItemVector.h.
References view().
Entity at position index of the vector.
Definition at line 138 of file ItemVector.h.
|
inline |
Removes the entity at index index.
Definition at line 124 of file ItemVector.h.
|
inline |
Reserves memory for capacity entities.
Definition at line 109 of file ItemVector.h.
|
inline |
Sets the number of elements in the array.
If the new size is greater than the old size, the added elements are undefined.
Definition at line 132 of file ItemVector.h.
Referenced by Arcane::ConnectivityItemVector::resizeAndCopy(), and Arcane::ConnectivityItemVector::setItem().
| void Arcane::ItemVector::setFamily | ( | IItemFamily * | afamily | ) |
Sets the associated family.
The vector is cleared of its elements
Definition at line 96 of file ItemVector.cc.
|
inline |
Number of elements in the vector.
Definition at line 106 of file ItemVector.h.
Referenced by Arcane::mesh::ItemsExchangeInfo2::prepareToSend(), and Arcane::mesh::ItemFamilyVariableSerializer::serialize().
|
inline |
View of the vector.
Definition at line 115 of file ItemVector.h.
Referenced by operator ItemVectorView(), and Arcane::mesh::ItemsExchangeInfo2::removeSentItems().
View of the local IDs.
Definition at line 118 of file ItemVector.h.
Referenced by Arcane::ConnectivityItemVector::resizeAndCopy(), and Arcane::ConnectivityItemVector::setItem().
|
inline |
Constant view of the local IDs.
Definition at line 121 of file ItemVector.h.
|
protected |
Definition at line 149 of file ItemVector.h.
|
protected |
Definition at line 148 of file ItemVector.h.
|
protected |
Definition at line 150 of file ItemVector.h.