Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
ItemEnumerator.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* ItemEnumerator.cc (C) 2000-2024 */
9/* */
10/* Enumerator over groups of mesh entities. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
15
16#include "arcane/utils/Ref.h"
17
18/*---------------------------------------------------------------------------*/
19/*---------------------------------------------------------------------------*/
20
21namespace Arcane
22{
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27namespace
28{
29 Ref<IItemEnumeratorTracer> m_singleton_tracer;
30}
31
32/*---------------------------------------------------------------------------*/
33/*---------------------------------------------------------------------------*/
34
35IItemEnumeratorTracer* IItemEnumeratorTracer::
36singleton()
37{
38 return m_singleton_tracer.get();
39}
40
41/*---------------------------------------------------------------------------*/
42/*---------------------------------------------------------------------------*/
43
45{
46 public:
47
48 ItemSharedInfo* m_shared_info;
49 const Int32* m_local_ids;
50 Integer m_index;
51 Integer m_count;
52};
53
54void _arcaneInternalItemEnumeratorSwigSet(const ItemEnumerator* ie, ItemEnumeratorPOD* vpod)
55{
56 vpod->m_local_ids = ie->unguardedLocalIds();
57 vpod->m_index = ie->index();
58 vpod->m_count = ie->count();
59 vpod->m_shared_info = ie->_sharedInfo();
60}
61
62/*---------------------------------------------------------------------------*/
63/*---------------------------------------------------------------------------*/
64
65extern "C++" ARCANE_CORE_EXPORT void
66arcaneSetSingletonItemEnumeratorTracer(Ref<IItemEnumeratorTracer> tracer)
67{
68 m_singleton_tracer = tracer;
69}
70
71/*---------------------------------------------------------------------------*/
72/*---------------------------------------------------------------------------*/
73// For testing the validity of instantiations
74
76template class ItemVectorViewT<Cell>;
77
78template class ItemEnumeratorT<Node>;
79template class ItemEnumeratorT<Edge>;
80template class ItemEnumeratorT<Face>;
81template class ItemEnumeratorT<Cell>;
82template class ItemEnumeratorT<Particle>;
83template class ItemEnumeratorT<DoF>;
84
85/*---------------------------------------------------------------------------*/
86/*---------------------------------------------------------------------------*/
87
88} // End namespace Arcane
89
90/*---------------------------------------------------------------------------*/
91/*---------------------------------------------------------------------------*/
Types and macros for iterating over mesh entities.
Interface for an enumerator tracer on entities.
constexpr const Int32 * unguardedLocalIds() const
Local indices.
constexpr Integer count() const
Number of elements in the enumerator.
constexpr Integer index() const
Current index of the enumerator.
Enumerator over a typed list of entities of type ItemType.
Enumerator over a list of entities.
Internal shared structure of a mesh entity.
View on a typed array of entities.
Reference to an instance.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
std::int32_t Int32
Signed integer type of 32 bits.