Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
ItemPairGroupImpl.h
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/* ItemPairGroupImpl.h (C) 2000-2025 */
9/* */
10/* Implementation of an array of lists of entities. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_ITEMPAIRGROUPIMPL_H
13#define ARCANE_CORE_ITEMPAIRGROUPIMPL_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18#include "arcane/core/SharedReference.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29
30/*!
31 * \internal
32 * \brief Implementation of an array of lists of entities.
33 */
34class ARCANE_CORE_EXPORT ItemPairGroupImpl
35: public SharedReference
36{
37 public:
38
39 ItemPairGroupImpl();
40 ItemPairGroupImpl(const ItemGroup& group, const ItemGroup& sub_group);
41 ~ItemPairGroupImpl() override; //!< Releases resources
42
43 public:
44
45 static ItemPairGroupImpl* shared_null;
46 static ItemPairGroupImpl* checkSharedNull();
47
48 public:
49
50 virtual ISharedReference& sharedReference() { return *this; }
51
52 public:
53
54 //! Group name
55 const String& name() const;
56
57 //! Number of references on the group.
58 virtual Integer nbRef() const { return refCount(); }
59
60 //! Returns true if the group is null.
61 bool null() const;
62
63 //! Mesh to which the group belongs (0 for the null group).
64 IMesh* mesh() const;
65
66 //! Group kind. This is the kind of its elements.
67 eItemKind itemKind() const;
68
69 //! Group kind. This is the kind of its elements.
70 eItemKind subItemKind() const;
71
72 //! Family to which the group belongs (or 0 if none)
73 IItemFamily* itemFamily() const;
74
75 //! Family to which the group belongs (or 0 if none)
76 IItemFamily* subItemFamily() const;
77
78 //! Group of entities
79 const ItemGroup& itemGroup() const;
80
81 //! Group of sub-entities
82 const ItemGroup& subItemGroup() const;
83
84 //! Number of entities in the group
85 Integer size() const;
86
87 //! Invalidates the group
88 void invalidate(bool force_recompute);
89
90 //! Checks that the group is valid.
91 void checkValid();
92
93 /*!
94 * \brief Updates the group if necessary.
95 *
96 * A group must be updated when it becomes invalid, for example
97 * following a call to invalidate().
98 * \retval true if the group was updated,
99 * \retval false otherwise.
100 */
101 bool checkNeedUpdate();
102
103 //! Changes the indices of the group's entities
104 void changeIds(IntegerConstArrayView old_to_new_ids);
105
106 /*!
107 * \internal
108 */
109 Array<Int64>& unguardedIndexes() const;
110
111 /*!
112 * \internal
113 */
114 Array<Int32>& unguardedLocalIds() const;
115
116 /*!
117 * \internal
118 */
119 void setComputeFunctor(IFunctor* functor);
120
121 Int64ArrayView indexes();
122
123 Span<const Int32> subItemsLocalId();
124
125 private:
126
127 ItemPairGroupImplPrivate* m_p = nullptr; //!< Group implementation
128
129 public:
130
131 void addRef() override;
132 void removeRef() override;
133
134 private:
135
136 void deleteMe() override;
137};
138
139/*---------------------------------------------------------------------------*/
140/*---------------------------------------------------------------------------*/
141
142} // namespace Arcane
143
144/*---------------------------------------------------------------------------*/
145/*---------------------------------------------------------------------------*/
146
147#endif
Declarations of types on entities.
Base class for 1D data vectors.
Interface of an entity family.
Definition IItemFamily.h:83
Interface of a reference counter.
Mesh entity group.
Definition ItemGroup.h:51
Integer size() const
Number of entities in the group.
const String & name() const
Group name.
bool checkNeedUpdate()
Updates the group if necessary.
void checkValid()
Checks that the group is valid.
virtual Integer nbRef() const
Number of references on the group.
void removeRef() override
Decrements the reference counter.
void addRef() override
Increments the reference counter.
void changeIds(IntegerConstArrayView old_to_new_ids)
Changes the indices of the group's entities.
void invalidate(bool force_recompute)
Invalidates the group.
Int32 refCount() const override
Returns the value of the reference counter.
View of an array of elements of type T.
Definition Span.h:635
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
ArrayView< Int64 > Int64ArrayView
C equivalent of a 1D array of 64-bit integers.
Definition UtilsTypes.h:451
Int32 Integer
Type representing an integer.
eItemKind
Mesh entity type.
ConstArrayView< Integer > IntegerConstArrayView
C equivalent of a 1D array of integers.
Definition UtilsTypes.h:486