12#ifndef ARCANE_CORE_ITEMARRAYENUMERATOR_H
13#define ARCANE_CORE_ITEMARRAYENUMERATOR_H
17#include "arcane/core/Item.h"
31class ARCANE_CORE_EXPORT ItemArrayEnumerator
36 typedef ItemPtr* Iterator;
43 , m_items_local_id(ids.
data())
44 , m_items_internal(items_internal.
data())
47 ItemArrayEnumerator(
const Int32* ids,
Integer nb_item,
const ItemPtr* items_internal)
50 , m_items_local_id(ids)
51 , m_items_internal(items_internal)
57 inline void operator++()
61 inline bool hasNext()
const
63 return m_current < m_end;
65 inline Integer itemLocalId()
const
67 return m_items_local_id[m_current];
73 inline Item operator*()
const
75 return Item(m_items_internal, m_items_local_id[m_current]);
82 const Int32* ARCANE_RESTRICT m_items_local_id;
83 const ItemPtr* m_items_internal;
92template <
typename ItemType>
93class ItemArrayEnumeratorT
94:
public ItemArrayEnumerator
99 : ItemArrayEnumerator(ids, items_internal)
102 ItemArrayEnumeratorT(
const Int32* ids,
Integer nb_item,
const ItemPtr* items_internal)
103 : ItemArrayEnumerator(ids, nb_item, items_internal)
106 inline ItemType operator*()
const
108 return ItemType(m_items_internal, m_items_local_id[m_current]);
constexpr const_pointer data() const noexcept
Pointer to the allocated memory.
constexpr Integer size() const noexcept
Number of elements in the array.
Base class for a mesh element.
-- 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.
ConstArrayView< ItemInternal * > ItemInternalList
Type of the internal list of entities.
std::int32_t Int32
Signed integer type of 32 bits.