2424namespace Arcane ::Materials
2525{
2626
27-
2827/* ---------------------------------------------------------------------------*/
2928/* ---------------------------------------------------------------------------*/
3029/* !
@@ -47,12 +46,22 @@ class ARCANE_CORE_EXPORT ComponentItemInternalLocalId
4746
4847/* ---------------------------------------------------------------------------*/
4948/* ---------------------------------------------------------------------------*/
50-
49+ /* !
50+ * \internal
51+ * \brief Informations partagées sur les 'ComponentItemInternal'.
52+ *
53+ * Il y a 3 instances de cette classe : une pour les AllEnvCell, une pour les
54+ * EnvCell et une pour les MatCell. Ces instances sont gérées par la classe
55+ * ComponentItemInternalData. Il est possible de conserver un pointeur sur
56+ * les intances de cette classe car ils sont valides durant toute la vie
57+ * d'un MeshMaterialMng.
58+ */
5159class ARCANE_CORE_EXPORT ComponentItemSharedInfo
5260{
5361 friend class ComponentItemInternal ;
5462 friend class ComponentItemInternalData ;
5563 friend class CellComponentCellEnumerator ;
64+ friend class ConstituentItemLocalIdList ;
5665
5766 private:
5867
@@ -61,6 +70,10 @@ class ARCANE_CORE_EXPORT ComponentItemSharedInfo
6170 static ComponentItemSharedInfo* null_shared_info_pointer;
6271 static ComponentItemSharedInfo* _nullInstance () { return null_shared_info_pointer; }
6372
73+ private:
74+
75+ inline ComponentItemInternal* _itemInternal (ComponentItemInternalLocalId id);
76+
6477 private:
6578
6679 // NOTE : Cette classe est partagée avec le wrapper C#
@@ -76,45 +89,74 @@ class ARCANE_CORE_EXPORT ComponentItemSharedInfo
7689/* ---------------------------------------------------------------------------*/
7790/* ---------------------------------------------------------------------------*/
7891
79- namespace matimpl
92+ }
93+
94+ namespace Arcane ::Materials::matimpl
95+ {
96+
97+ /* ---------------------------------------------------------------------------*/
98+ /* ---------------------------------------------------------------------------*/
99+ /* !
100+ * \internal
101+ */
102+ class ARCANE_CORE_EXPORT ComponentItemInternalLocalIdListView
103+ {
104+ private:
105+
106+ ComponentItemSharedInfo* m_component_shared_info = nullptr ;
107+ ArrayView<ComponentItemInternalLocalId> m_ids;
108+ };
109+
110+ /* ---------------------------------------------------------------------------*/
111+ /* ---------------------------------------------------------------------------*/
112+
113+ class ARCANE_CORE_EXPORT ConstituentItemBase
80114{
81- class ARCANE_CORE_EXPORT ConstituentItemBase
115+ friend Arcane::Materials::ComponentCell;
116+ friend Arcane::Materials::AllEnvCell;
117+ friend Arcane::Materials::EnvCell;
118+ friend Arcane::Materials::MatCell;
119+
120+ public:
121+
122+ ARCCORE_HOST_DEVICE constexpr ConstituentItemBase (ComponentItemInternal* component_item)
123+ : m_component_item(component_item)
82124 {
83- friend Arcane::Materials::ComponentCell;
84- friend Arcane::Materials::AllEnvCell;
85- friend Arcane::Materials::EnvCell;
86- friend Arcane::Materials::MatCell;
125+ }
87126
88- public:
127+ public:
89128
90- ARCCORE_HOST_DEVICE constexpr ConstituentItemBase (ComponentItemInternal* component_item)
91- : m_component_item(component_item)
92- {
93- }
129+ ARCCORE_HOST_DEVICE constexpr friend bool
130+ operator ==(const ConstituentItemBase& a, const ConstituentItemBase& b)
131+ {
132+ return a.m_component_item == b.m_component_item ;
133+ }
134+ ARCCORE_HOST_DEVICE constexpr friend bool
135+ operator !=(const ConstituentItemBase& a, const ConstituentItemBase& b)
136+ {
137+ return a.m_component_item != b.m_component_item ;
138+ }
94139
95- public :
140+ private :
96141
97- ARCCORE_HOST_DEVICE constexpr friend bool
98- operator ==(const ConstituentItemBase& a, const ConstituentItemBase& b)
99- {
100- return a.m_component_item == b.m_component_item ;
101- }
102- ARCCORE_HOST_DEVICE constexpr friend bool
103- operator !=(const ConstituentItemBase& a, const ConstituentItemBase& b)
104- {
105- return a.m_component_item != b.m_component_item ;
106- }
142+ ARCCORE_HOST_DEVICE constexpr ComponentItemInternal* _internal () const { return m_component_item; }
107143
108- private:
144+ private:
109145
110- ARCCORE_HOST_DEVICE constexpr ComponentItemInternal* _internal () const { return m_component_item; }
146+ ComponentItemInternal* m_component_item = nullptr ;
147+ };
111148
112- private:
149+ /* ---------------------------------------------------------------------------*/
150+ /* ---------------------------------------------------------------------------*/
113151
114- ComponentItemInternal* m_component_item = nullptr ;
115- };
116152} // namespace matimpl
117153
154+ /* ---------------------------------------------------------------------------*/
155+ /* ---------------------------------------------------------------------------*/
156+
157+ namespace Arcane ::Materials
158+ {
159+
118160/* ---------------------------------------------------------------------------*/
119161/* ---------------------------------------------------------------------------*/
120162/* !
@@ -310,6 +352,15 @@ class ARCANE_CORE_EXPORT ComponentItemInternal
310352/* ---------------------------------------------------------------------------*/
311353/* ---------------------------------------------------------------------------*/
312354
355+ inline ComponentItemInternal* ComponentItemSharedInfo::
356+ _itemInternal (ComponentItemInternalLocalId id)
357+ {
358+ return m_component_item_internal_view.ptrAt (id.localId ());
359+ }
360+
361+ /* ---------------------------------------------------------------------------*/
362+ /* ---------------------------------------------------------------------------*/
363+
313364} // End namespace Arcane::Materials
314365
315366/* ---------------------------------------------------------------------------*/
0 commit comments