12#ifndef ARCANE_CORE_ITEMENUMERATOR_H
13#define ARCANE_CORE_ITEMENUMERATOR_H
17#include "arcane/core/ItemInternalEnumerator.h"
18#include "arcane/core/Item.h"
19#include "arcane/core/EnumeratorTraceWrapper.h"
20#include "arcane/core/IItemEnumeratorTracer.h"
21#include "arcane/core/ItemEnumeratorBase.h"
45class ItemEnumeratorCS;
59:
public ItemEnumeratorBaseT<Item>
61 friend class ItemEnumeratorCS;
62 friend class ItemGroup;
63 friend class ItemVector;
64 friend class ItemVectorView;
65 friend class ItemPairEnumerator;
66 template <
int Extent>
friend class ItemConnectedListView;
72 friend class ItemEnumeratorBaseT<
Item>;
73 friend class ItemEnumeratorBaseT<
Node>;
75 friend class ItemEnumeratorBaseT<
Edge>;
76 friend class ItemEnumeratorBaseT<
Face>;
77 friend class ItemEnumeratorBaseT<
Cell>;
78 friend class ItemEnumeratorBaseT<
Particle>;
79 friend class ItemEnumeratorBaseT<
DoF>;
80 friend ARCANE_CORE_EXPORT
void _arcaneInternalItemEnumeratorSwigSet(
const ItemEnumerator* ie,
ItemEnumeratorPOD* vpod);
85 using BaseClass = ItemEnumeratorBaseT<Item>;
89 ItemEnumerator() =
default;
92 : BaseClass(view,
nullptr)
96 : BaseClass(rhs,
true)
106 template <
int E> ItemEnumerator(
const ItemConnectedListView<E>& rhs)
114 : BaseClass(items, local_ids, agroup)
119 ARCANE_DEPRECATED_REASON(
"Y2022: Internal to Arcane. Use other constructor")
121 : BaseClass(items, local_ids, n, agroup)
124 ARCANE_DEPRECATED_REASON(
"Y2022: Internal to Arcane. Use other constructor")
126 : BaseClass(items, local_ids, agroup)
129 ARCANE_DEPRECATED_REASON(
"Y2022: Internal to Arcane. Use other constructor")
131 : BaseClass(view, agroup)
138 : BaseClass(s, local_ids)
147 static ItemEnumerator fromItemEnumerator(
const ItemEnumerator& rhs)
149 return ItemEnumerator(rhs);
156 : BaseClass(view,
index, agroup, item_base)
158 ItemSharedInfo* _sharedInfo()
const {
return _internalItemBase().m_shared_info; }
168inline ItemEnumeratorBase::
171, m_index(rhs.
index())
172, m_group_impl(rhs.
group())
180template <
typename ItemType>
inline ItemEnumeratorBaseT<ItemType>::
182: ItemEnumeratorBase(rhs, v)
183, m_item(rhs._internalItemBase())
190inline ItemEnumeratorBase::
193, m_index(rhs.index())
194, m_group_impl(rhs.group())
201template <
typename ItemType>
inline ItemEnumeratorBaseT<ItemType>::
202ItemEnumeratorBaseT(
const ItemEnumerator& rhs)
203: ItemEnumeratorBase(rhs)
204, m_item(rhs._internalItemBase())
235template <
typename ItemType>
237:
public ItemEnumeratorBaseT<ItemType>
242 using LocalIdType =
typename ItemType::LocalIdType;
243 using BaseClass = ItemEnumeratorBaseT<ItemType>;
248 template <
typename I1,
typename I2>
friend class ItemPairEnumeratorT;
252 ItemEnumeratorT() =
default;
262 [[deprecated(
"Y2021: Use strongly typed enumerator (Node, Face, Cell, ...) instead of generic (Item) enumerator")]]
267 [[deprecated(
"Y2021: Use strongly typed enumerator (Node, Face, Cell, ...) instead of generic (Item) enumerator")]]
274 ARCANE_DEPRECATED_REASON(
"Y2022: Internal to Arcane. Use other constructor")
276 : BaseClass(items, local_ids, n, agroup)
279 ARCANE_DEPRECATED_REASON(
"Y2022: Internal to Arcane. Use other constructor")
281 : BaseClass(items, local_ids, agroup)
284 ARCANE_DEPRECATED_REASON(
"Y2022: Internal to Arcane. Use other constructor")
286 : BaseClass(view, agroup)
300 : BaseClass(items, local_ids, agroup)
307 : BaseClass(s, local_ids)
329 ItemEnumeratorT(
const ItemEnumerator& rhs,
bool v)
340 return ItemEnumerator(m_shared_info, m_index_view._localIds());
356template <
typename ItemType>
inline ItemLocalId::
358: m_local_id(enumerator.asItemLocalId())
367: m_local_id(enumerator.asItemLocalId())
374template <
typename ItemType>
inline ItemLocalId::
376: m_local_id(enumerator.asItemLocalId())
407#define ARCANE_CHECK_ENUMERATOR(enumerator, testgroup) \
408 ARCANE_ASSERT(((enumerator).group() == (testgroup).internal()), ("Invalid access on partial data using enumerator not associated to underlying group %s", testgroup.name().localstr()))
413#define A_ENUMERATE_ITEM(_EnumeratorClassName, iname, view) \
414 for (A_TRACE_ITEM_ENUMERATOR(_EnumeratorClassName) iname(_EnumeratorClassName ::fromItemEnumerator((view).enumerator()) A_TRACE_ENUMERATOR_WHERE); iname.hasNext(); ++iname)
416#define A_ENUMERATE_ITEM_NO_TRACE(_EnumeratorClassName, iname, view) \
417 for (_EnumeratorClassName iname(_EnumeratorClassName ::fromItemEnumerator((view).enumerator())); iname.hasNext(); ++iname)
423#define ENUMERATE_NO_TRACE_(type, name, group) A_ENUMERATE_ITEM_NO_TRACE(::Arcane::ItemEnumeratorT<type>, name, group)
426#define ENUMERATE_(type, name, group) A_ENUMERATE_ITEM(::Arcane::ItemEnumeratorT<type>, name, group)
429#define ENUMERATE_GENERIC(type, name, group) A_ENUMERATE_ITEM(::Arcane::ItemEnumeratorT<type>, name, group)
432#define ENUMERATE_ITEM(name, group) A_ENUMERATE_ITEM(::Arcane::ItemEnumerator, name, group)
434#define ENUMERATE_ITEMWITHNODES(name, group) ENUMERATE_ (::Arcane::ItemWithNodes, name, group)
437#define ENUMERATE_NODE(name, group) ENUMERATE_ (::Arcane::Node, name, group)
440#define ENUMERATE_EDGE(name, group) ENUMERATE_ (::Arcane::Edge, name, group)
443#define ENUMERATE_FACE(name, group) ENUMERATE_ (::Arcane::Face, name, group)
446#define ENUMERATE_CELL(name, group) ENUMERATE_ (::Arcane::Cell, name, group)
449#define ENUMERATE_PARTICLE(name, group) ENUMERATE_ (::Arcane::Particle, name, group)
452#define ENUMERATE_DOF(name, group) ENUMERATE_ (::Arcane::DoF, name, group)
464#define ENUMERATE_ITEMPAIR(_item_type1, _item_type2, _name, _array) \
465 for (::Arcane::ItemPairEnumeratorT<_item_type1, _item_type2> _name(_array); _name.hasNext(); ++_name)
471#define ENUMERATE_ITEMPAIR_DIRECT(_name, _array) \
472 for (::Arcane::ItemPairEnumerator _name(_array); _name.hasNext(); ++_name)
484#define ENUMERATE_SUB_ITEM(_item_type, _name, _parent_item) \
485 for (::Arcane::ItemEnumeratorT<_item_type> _name(_parent_item.subItems()); _name.hasNext(); ++_name)
491#define ENUMERATE_SUB_ITEM_DIRECT(_name, _parent_item) \
492 for (::Arcane::ItemInternalEnumerator _name(_parent_item.subItems()); _name.hasNext(); ++_name)
Types and macros for iterating over mesh entities connected to another entity.
Enumerator over a typed list of connected entities of type ItemType.
Enumerator over a list of entities connected to another.
View of a list of entities connected to another.
View of a list of entities connected to another entity.
Base class for specialized views of entity information.
View of a list to obtain information about entities.
Index of an ItemType entity in a variable.
Index of an Item in a variable.
View on a typed array of entities.
View on a vector of entities.
Mesh element based on nodes (Edge,Face,Cell).
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.
std::int32_t Int32
Signed integer type of 32 bits.