Arcane  4.1.12.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
26{
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
34class ARCANE_CORE_EXPORT IIncrementalItemSourceConnectivity
35{
37
38 protected:
39
40 virtual ~IIncrementalItemSourceConnectivity() = default;
41
42 public:
43
45 virtual IItemFamily* sourceFamily() const = 0;
46
47 //TODO: use an event-based mechanism.
49 virtual void notifySourceFamilyLocalIdChanged(Int32ConstArrayView new_to_old_ids) = 0;
50
52 virtual void notifySourceItemAdded(ItemLocalId item) = 0;
53
66 virtual void reserveMemoryForNbSourceItems(Int32 n, bool pre_alloc_connectivity);
67
69 virtual void notifyReadFromDump() = 0;
70
73
74 private:
75
76 // Interfaces reserved to Arcane
77
80};
81
82/*---------------------------------------------------------------------------*/
83/*---------------------------------------------------------------------------*/
84
88class ARCANE_CORE_EXPORT IIncrementalItemTargetConnectivity
89{
91
92 protected:
93
94 virtual ~IIncrementalItemTargetConnectivity() = default;
95
96 public:
97
98 //TODO: use an event-based mechanism.
101
104};
105
106/*---------------------------------------------------------------------------*/
107/*---------------------------------------------------------------------------*/
108
115class ARCANE_CORE_EXPORT IIncrementalItemConnectivity
119{
121
122 public:
123
124 //TODO make 'protected' once everyone uses the reference counter
126
127 public:
128
130 virtual String name() const = 0;
131
134
136 virtual IItemFamily* targetFamily() const = 0;
137
139 virtual void addConnectedItem(ItemLocalId source_item, ItemLocalId target_local_id) = 0;
140
155 virtual void setConnectedItems(ItemLocalId source_item, Int32ConstArrayView target_local_ids);
156
158 virtual void removeConnectedItem(ItemLocalId source_item, ItemLocalId target_local_id) = 0;
159
161 virtual void removeConnectedItems(ItemLocalId source_item) = 0;
162
164 virtual void replaceConnectedItem(ItemLocalId source_item, Integer index, ItemLocalId target_local_id) = 0;
165
167 virtual void replaceConnectedItems(ItemLocalId source_item, Int32ConstArrayView target_local_ids) = 0;
168
170 virtual bool hasConnectedItem(ItemLocalId source_item, ItemLocalId target_local_id) const = 0;
171
178 virtual Int32 maxNbConnectedItem() const = 0;
179
181 virtual Integer preAllocatedSize() const = 0;
182
184 virtual void setPreAllocatedSize(Integer value) = 0;
185
187 virtual void dumpStats(std::ostream& out) const = 0;
188
191};
192
193/*---------------------------------------------------------------------------*/
194/*---------------------------------------------------------------------------*/
195
196} // End namespace Arcane
197
198/*---------------------------------------------------------------------------*/
199/*---------------------------------------------------------------------------*/
200
201#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:83
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:482
std::int32_t Int32
Signed integer type of 32 bits.