Arcane  4.2.3.0
Developer documentation
Loading...
Searching...
No Matches
IIncrementalItemConnectivity.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/* IIncrementalItemConnectivity.h (C) 2000-2024 */
9/* */
10/* Incremental entity connectivity interface. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_IINCREMENTALITEMCONNECTIVITY_H
13#define ARCANE_CORE_IINCREMENTALITEMCONNECTIVITY_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/ArrayView.h"
18
20#include "arcane/core/IItemConnectivityAccessor.h"
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25namespace Arcane::mesh
26{
27class ItemFamily;
28}
29
30namespace Arcane
31{
32
33/*---------------------------------------------------------------------------*/
34/*---------------------------------------------------------------------------*/
35
39class ARCANE_CORE_EXPORT IIncrementalItemSourceConnectivity
40{
42
44 friend class mesh::ItemFamily;
45
46 protected:
47
48 virtual ~IIncrementalItemSourceConnectivity() = default;
49
50 public:
51
53 virtual IItemFamily* sourceFamily() const = 0;
54
55 //TODO: use an event-based mechanism.
57 virtual void notifySourceFamilyLocalIdChanged(Int32ConstArrayView new_to_old_ids) = 0;
58
60 virtual void notifySourceItemAdded(ItemLocalId item) = 0;
61
74 virtual void reserveMemoryForNbSourceItems(Int32 n, bool pre_alloc_connectivity);
75
77 virtual void notifyReadFromDump() = 0;
78
81
82 private:
83
84 // Interfaces reserved to Arcane
85
88};
89
90/*---------------------------------------------------------------------------*/
91/*---------------------------------------------------------------------------*/
92
96class ARCANE_CORE_EXPORT IIncrementalItemTargetConnectivity
97{
99
100 protected:
101
102 virtual ~IIncrementalItemTargetConnectivity() = default;
103
104 public:
105
106 //TODO: use an event-based mechanism.
109
112};
113
114/*---------------------------------------------------------------------------*/
115/*---------------------------------------------------------------------------*/
116
123class ARCANE_CORE_EXPORT IIncrementalItemConnectivity
127{
129
130 public:
131
132 //TODO make 'protected' once everyone uses the reference counter
134
135 public:
136
138 virtual String name() const = 0;
139
142
144 virtual IItemFamily* targetFamily() const = 0;
145
147 virtual void addConnectedItem(ItemLocalId source_item, ItemLocalId target_local_id) = 0;
148
163 virtual void setConnectedItems(ItemLocalId source_item, Int32ConstArrayView target_local_ids);
164
166 virtual void removeConnectedItem(ItemLocalId source_item, ItemLocalId target_local_id) = 0;
167
169 virtual void removeConnectedItems(ItemLocalId source_item) = 0;
170
172 virtual void replaceConnectedItem(ItemLocalId source_item, Integer index, ItemLocalId target_local_id) = 0;
173
175 virtual void replaceConnectedItems(ItemLocalId source_item, Int32ConstArrayView target_local_ids) = 0;
176
178 virtual bool hasConnectedItem(ItemLocalId source_item, ItemLocalId target_local_id) const = 0;
179
186 virtual Int32 maxNbConnectedItem() const = 0;
187
189 virtual Integer preAllocatedSize() const = 0;
190
192 virtual void setPreAllocatedSize(Integer value) = 0;
193
195 virtual void dumpStats(std::ostream& out) const = 0;
196
199};
200
201/*---------------------------------------------------------------------------*/
202/*---------------------------------------------------------------------------*/
203
204} // End namespace Arcane
205
206/*---------------------------------------------------------------------------*/
207/*---------------------------------------------------------------------------*/
208
209#endif
Declarations of types on entities.
#define ARCCORE_DECLARE_REFERENCE_COUNTED_INCLASS_METHODS()
Macro to declare the virtual methods managing reference counters.
Constant view of an array of type T.
Internal Arcane API for IIncrementalItemConnectivity.
Interface for managing an incremental connectivity.
virtual bool hasConnectedItem(ItemLocalId source_item, ItemLocalId target_local_id) const =0
Tests the existence of a connectivity between source_item and the entity with localId() target_local_...
virtual void replaceConnectedItem(ItemLocalId source_item, Integer index, ItemLocalId target_local_id)=0
Replaces the entity at index index of source_item with the entity with localId() target_local_id.
virtual String name() const =0
Name of the connectivity.
virtual void dumpStats(std::ostream &out) const =0
Dumps statistics on usage and memory used to the stream out.
virtual ConstArrayView< IItemFamily * > families() const =0
List of families (sourceFamily() + targetFamily()).
virtual void replaceConnectedItems(ItemLocalId source_item, Int32ConstArrayView target_local_ids)=0
Replaces the entities of source_item with the entities with localId() target_local_ids.
virtual void removeConnectedItems(ItemLocalId source_item)=0
Removes all entities connected to source_item.
virtual void removeConnectedItem(ItemLocalId source_item, ItemLocalId target_local_id)=0
Removes the entity with localId() target_local_id from the connectivity of source_item.
virtual void addConnectedItem(ItemLocalId source_item, ItemLocalId target_local_id)=0
Adds the entity with localId() target_local_id to the connectivity of source_item.
virtual IItemFamily * targetFamily() const =0
Target family.
virtual IIncrementalItemConnectivityInternal * _internalApi()=0
Internal Arcane API.
virtual Int32 maxNbConnectedItem() const =0
Maximum number of entities connected to a source entity.
virtual void setConnectedItems(ItemLocalId source_item, Int32ConstArrayView target_local_ids)
Allocates and positions entities connected to source_item.
virtual void setPreAllocatedSize(Integer value)=0
Sets the number of entities to pre-allocate for the connectivity of each entity.
virtual Integer preAllocatedSize() const =0
Number of entities pre-allocated for the connectivity of each entity.
Interface for the source of an incremental connectivity.
virtual void notifyReadFromDump()=0
Notifies the connectivity that a read has been performed from a dump.
virtual void reserveMemoryForNbSourceItems(Int32 n, bool pre_alloc_connectivity)
Reserves memory for n source entities.
virtual IItemFamily * sourceFamily() const =0
Source family.
virtual void notifySourceFamilyLocalIdChanged(Int32ConstArrayView new_to_old_ids)=0
Notifies the connectivity that the source family has been compacted.
virtual void _internalNotifySourceItemsAdded(Int32ConstArrayView items)
Notifies the connectivity that the entities items have been added to the source family.
virtual void notifySourceItemAdded(ItemLocalId item)=0
Notifies the connectivity that an entity has been added to the source family.
virtual Ref< IIncrementalItemSourceConnectivity > toSourceReference()=0
Returns a reference to the instance.
Interface for the target of an incremental connectivity.
virtual void notifyTargetFamilyLocalIdChanged(Int32ConstArrayView old_to_new_ids)=0
Notifies the connectivity that the target family has been compacted.
virtual Ref< IIncrementalItemTargetConnectivity > toTargetReference()=0
Returns a reference to the instance.
Interface to manage access to a connectivity.
Interface of an entity family.
Definition IItemFamily.h:85
Index of an Item in a variable.
Definition ItemLocalId.h:42
Reference to an instance.
-- 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.
Definition UtilsTypes.h:476
std::int32_t Int32
Signed integer type of 32 bits.