12#ifndef ARCANE_CORE_ITEMVECTOR_H
13#define ARCANE_CORE_ITEMVECTOR_H
18#include "arcane/core/ItemVectorView.h"
19#include "arcane/core/IItemFamily.h"
63 using ItemType =
Item;
94 void add(
Int32 local_id) { m_local_ids.add(local_id); }
112 void clear() { m_local_ids.clear(); }
165template <
typename VectorItemType>
171 using ItemType = VectorItemType;
208 return ItemType(m_local_ids[index], m_shared_info);
233template <
typename ItemType>
inline ItemVectorViewT<ItemType>::
234ItemVectorViewT(
const ItemVectorT<ItemType>& rhs)
235: ItemVectorView(rhs.view())
Modifiable view of an array of type T.
Constant view of an array of type T.
Interface of an entity family.
Index of an ItemType entity in a variable.
Index of an Item in a variable.
ItemEnumeratorT< ItemType > enumerator() const
Enumerator.
void addItem(ItemType item)
Adds an entity to the end of the vector.
ItemType operator[](Int32 index) const
Entity at position index of the vector.
void addItem(ItemLocalIdT< ItemType > local_id)
Adds an entity to the end of the vector.
ItemVectorT()=default
Empty constructor.
ItemVectorT(IItemFamily *afamily, Integer asize)
Constructor for asize elements for the family afamily.
ItemVectorT(IItemFamily *afamily, ConstArrayView< Int32 > local_ids)
Creates a vector associated with the family afamily and containing the entities local_ids.
ItemVectorT(IItemFamily *afamily)
Empty constructor with family.
ItemVectorViewT< ItemType > view() const
View of the entire array.
ItemVectorT(const ItemVector &rhs)
Copy constructor.
View on a typed array of entities.
View on a vector of entities.
ConstArrayView< Int32 > viewAsArray() const
Constant view of the local IDs.
void add(Int32 local_id)
Adds an entity with local ID local_id to the end of the vector.
void removeAt(Int32 index)
Removes the entity at index index.
void clear()
Removes all entities from the vector.
ItemVector clone()
Clones this vector.
IItemFamily * family() const
Family associated with the vector.
ItemVector(IItemFamily *afamily)
Creates an empty vector associated with the family family.
ItemVectorView view() const
View of the vector.
void addItem(Item item)
Adds an entity to the end of the vector.
void resize(Integer new_size)
Sets the number of elements in the array.
Int32 size() const
Number of elements in the vector.
ArrayView< Int32 > viewAsArray()
View of the local IDs.
void addItem(ItemLocalId local_id)
Adds an entity with local ID local_id to the end of the vector.
Item operator[](Int32 index) const
Entity at position index of the vector.
ItemEnumerator enumerator() const
Enumerator.
void reserve(Integer capacity)
Reserves memory for capacity entities.
void add(ConstArrayView< Int32 > local_ids)
Adds a list of entity local IDs local_ids to the end of the vector.
Base class for a mesh element.
constexpr Int32 localId() const
Local identifier of the entity in the processor subdomain.
1D vector of data with reference semantics.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
std::int32_t Int32
Signed integer type of 32 bits.