12#ifndef ARCANE_CORE_ITEMLOCALID_H
13#define ARCANE_CORE_ITEMLOCALID_H
17#include "arcane/utils/ArrayView.h"
41class ARCANE_CORE_EXPORT ItemLocalId
45 ItemLocalId() =
default;
46 constexpr ARCCORE_HOST_DEVICE
explicit ItemLocalId(
Int32 id)
54 inline ItemLocalId(
Item item);
55 constexpr ARCCORE_HOST_DEVICE
operator Int32()
const {
return m_local_id; }
56 constexpr ARCCORE_HOST_DEVICE
Int32 asInt32()
const {
return m_local_id; }
57 constexpr ARCCORE_HOST_DEVICE
Int32 asInteger()
const {
return m_local_id; }
61 constexpr ARCCORE_HOST_DEVICE
Int32 localId()
const {
return m_local_id; }
62 constexpr ARCCORE_HOST_DEVICE
bool isNull()
const {
return m_local_id == NULL_ITEM_LOCAL_ID; }
68 auto* ptr =
reinterpret_cast<const ItemLocalId*
>(v.
data());
69 return { ptr, v.
size() };
73 auto* ptr =
reinterpret_cast<const Int32*
>(v.
data());
74 return { ptr, v.
size() };
79 Int32 m_local_id = NULL_ITEM_LOCAL_ID;
89template <
typename ItemType_>
95 using ItemType = ItemType_;
96 using ThatClass = ItemLocalIdT<ItemType>;
100 ItemLocalIdT() =
default;
101 constexpr ARCCORE_HOST_DEVICE
explicit ItemLocalIdT(
Int32 id)
106 inline ItemLocalIdT(ItemType item);
112 auto* ptr =
reinterpret_cast<const ThatClass*
>(v.
data());
113 return { ptr, v.
size() };
118 auto* ptr =
reinterpret_cast<const Int32*
>(v.
data());
119 return { ptr, v.
size() };
124 ARCANE_DEPRECATED_REASON(
"Y2022: Use strongly typed 'ItemEnumeratorT<ItemType>' or 'ItemType'")
137class ARCANE_CORE_EXPORT ItemLocalIdToItemConverter
139 template <
typename ItemType_>
friend class ItemLocalIdToItemConverterT;
143 explicit ItemLocalIdToItemConverter(
IItemFamily* family);
174template <
typename ItemType_>
class ItemLocalIdToItemConverterT
175:
public ItemLocalIdToItemConverter
179 using ItemType = ItemType_;
184 using ItemLocalIdToItemConverter::ItemLocalIdToItemConverter;
189 inline constexpr ARCCORE_HOST_DEVICE ItemType
operator[](ItemLocalIdType local_id)
const;
191 inline constexpr ARCCORE_HOST_DEVICE ItemType
operator[](
Int32 local_id)
const;
Declarations of types on entities.
Class to convert a CellLocalId to a cell.
Class to convert a DoFLocalId to a degree of freedom.
Class to convert an EdgeLocalId to an edge.
Class to convert a FaceLocalId to a face.
Interface of an entity family.
Enumerator over a typed list of connected entities of type ItemType.
Enumerator over a list of entities connected to another.
Internal structure of a mesh entity.
Index of an ItemType entity in a variable.
Class to convert an ItemLocalId to an entity (Item).
constexpr __host__ __device__ ItemType operator[](ItemLocalIdType local_id) const
Entity of local ID local_id.
ItemLocalIdToItemConverter()=default
Default constructor.
constexpr __host__ __device__ Item operator[](ItemLocalId local_id) const
Entity of local ID local_id.
Index of an Item in a variable.
Internal shared structure of a mesh entity.
Base class for a mesh element.
Class to convert a NodeLocalId to an edge.
Class to convert a ParticleLocalId to a particle.
View of an array of elements of type T.
constexpr __host__ __device__ pointer data() const noexcept
Pointer to the start of the view.
constexpr __host__ __device__ SizeType size() const noexcept
Returns the size of the array.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int32_t Int32
Signed integer type of 32 bits.