Arcane  v3.16.8.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
ItemGroupRangeIterator.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2025 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/* ItemGroupRangeIterator.h (C) 2000-2025 */
9/* */
10/* Intervalle d'itération sur les entités d'un groupe du maillage. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_ITEMGROUPRANGEITERATOR_H
13#define ARCANE_CORE_ITEMGROUPRANGEITERATOR_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/core/ItemInfoListView.h"
18#include "arcane/core/Item.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
31class ARCANE_CORE_EXPORT ItemGroupRangeIterator
32{
33 public:
34
35 typedef ItemInternal* ItemPtr;
36 typedef ItemPtr* Iterator;
37
38 ItemGroupRangeIterator(const ItemGroup& group);
39 ItemGroupRangeIterator();
40
41 public:
42
43 inline void operator++()
44 {
45 ++m_current;
46 }
47 inline bool hasNext() const
48 {
49 return m_current < m_end;
50 }
51 inline Integer itemLocalId() const
52 {
53 return m_items_local_ids[m_current];
54 }
55 inline Integer index() const
56 {
57 return m_current;
58 }
59 inline eItemKind kind() const
60 {
61 return m_kind;
62 }
63
64 protected:
65
66 eItemKind m_kind;
67 Integer m_current;
68 Integer m_end;
69 const Int32* ARCANE_RESTRICT m_items_local_ids;
70 ItemInfoListView m_items;
71};
72
73/*---------------------------------------------------------------------------*/
74/*---------------------------------------------------------------------------*/
78template <typename T>
79class ItemGroupRangeIteratorT
80: public ItemGroupRangeIterator
81{
82 public:
83
84 inline ItemGroupRangeIteratorT(const ItemGroup& group)
85 : ItemGroupRangeIterator(group)
86 {
87 }
88 inline ItemGroupRangeIteratorT()
89 : ItemGroupRangeIterator()
90 {
91 }
92
93 public:
94
95 T operator*() const
96 {
97 return T(m_items[m_items_local_ids[m_current]]);
98 }
99};
100
101/*---------------------------------------------------------------------------*/
102/*---------------------------------------------------------------------------*/
103
104} // namespace Arcane
105
106/*---------------------------------------------------------------------------*/
107/*---------------------------------------------------------------------------*/
108
109#endif
Groupe d'entités de maillage.
Definition ItemGroup.h:49
Vue sur une liste pour obtenir des informations sur les entités.
Structure interne d'une entité de maillage.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Int32 Integer
Type représentant un entier.
eItemKind
Genre d'entité de maillage.
std::int32_t Int32
Type entier signé sur 32 bits.