Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
AbstractDataVisitor.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2023 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/* AbstractDataVisitor.cc (C) 2000-2023 */
9/* */
10/* Visiteur abstrait pour une donnée. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/utils/NotImplementedException.h"
15#include "arcane/utils/TraceInfo.h"
16#include "arcane/AbstractDataVisitor.h"
17#include "arcane/IData.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28void AbstractDataVisitor::
29applyDataVisitor(IScalarData* data)
30{
31 data->visitScalar(this);
32}
33
34void AbstractDataVisitor::
35applyDataVisitor(IArrayData* data)
36{
37 data->visitArray(this);
38}
39
40void AbstractDataVisitor::
41applyDataVisitor(IArray2Data* data)
42{
43 data->visitArray2(this);
44}
45
46/*---------------------------------------------------------------------------*/
47/*---------------------------------------------------------------------------*/
48
49void AbstractScalarDataVisitor::
50_throwException(eDataType dt)
51{
52 String s = String::format("scalar visitor not implemented for data type '{0}'",
53 dataTypeName(dt));
54 throw NotImplementedException(A_FUNCINFO,s);
55}
56
57void AbstractScalarDataVisitor::
58applyVisitor(IScalarDataT<Byte>* data)
59{
60 ARCANE_UNUSED(data);
61 _throwException(DT_Byte);
62}
63
64void AbstractScalarDataVisitor::
65applyVisitor(IScalarDataT<Real>* data)
66{
67 ARCANE_UNUSED(data);
68 _throwException(DT_Real);
69}
70
71void AbstractScalarDataVisitor::
72applyVisitor(IScalarDataT<Int16>* data)
73{
74 ARCANE_UNUSED(data);
75 _throwException(DT_Int16);
76}
77
78void AbstractScalarDataVisitor::
79applyVisitor(IScalarDataT<Int32>* data)
80{
81 ARCANE_UNUSED(data);
82 _throwException(DT_Int32);
83}
84
85void AbstractScalarDataVisitor::
86applyVisitor(IScalarDataT<Int64>* data)
87{
88 ARCANE_UNUSED(data);
89 _throwException(DT_Int64);
90}
91
92void AbstractScalarDataVisitor::
93applyVisitor(IScalarDataT<Real2>* data)
94{
95 ARCANE_UNUSED(data);
96 _throwException(DT_Real2);
97}
98
99void AbstractScalarDataVisitor::
100applyVisitor(IScalarDataT<Real3>* data)
101{
102 ARCANE_UNUSED(data);
103 _throwException(DT_Real3);
104}
105
106void AbstractScalarDataVisitor::
107applyVisitor(IScalarDataT<Real2x2>* data)
108{
109 ARCANE_UNUSED(data);
110 _throwException(DT_Real2x2);
111}
112
113void AbstractScalarDataVisitor::
114applyVisitor(IScalarDataT<Real3x3>* data)
115{
116 ARCANE_UNUSED(data);
117 _throwException(DT_Real3x3);
118}
119
120void AbstractScalarDataVisitor::
121applyVisitor(IScalarDataT<String>* data)
122{
123 ARCANE_UNUSED(data);
124 _throwException(DT_String);
125}
126
127/*---------------------------------------------------------------------------*/
128/*---------------------------------------------------------------------------*/
129
130void AbstractArrayDataVisitor::
131_throwException(eDataType dt)
132{
133 String s = String::format("array visitor not implemented for data type '{0}'",
134 dataTypeName(dt));
135 throw NotImplementedException(A_FUNCINFO,s);
136}
137
138void AbstractArrayDataVisitor::
139applyVisitor(IArrayDataT<Byte>* data)
140{
141 ARCANE_UNUSED(data);
142 _throwException(DT_Byte);
143}
144
145void AbstractArrayDataVisitor::
146applyVisitor(IArrayDataT<Real>* data)
147{
148 ARCANE_UNUSED(data);
149 _throwException(DT_Real);
150}
151
152void AbstractArrayDataVisitor::
153applyVisitor(IArrayDataT<Int16>* data)
154{
155 ARCANE_UNUSED(data);
156 _throwException(DT_Int16);
157}
158
159void AbstractArrayDataVisitor::
160applyVisitor(IArrayDataT<Int32>* data)
161{
162 ARCANE_UNUSED(data);
163 _throwException(DT_Int32);
164}
165
166void AbstractArrayDataVisitor::
167applyVisitor(IArrayDataT<Int64>* data)
168{
169 ARCANE_UNUSED(data);
170 _throwException(DT_Int64);
171}
172
173void AbstractArrayDataVisitor::
174applyVisitor(IArrayDataT<Real2>* data)
175{
176 ARCANE_UNUSED(data);
177 _throwException(DT_Real2);
178}
179
180void AbstractArrayDataVisitor::
181applyVisitor(IArrayDataT<Real3>* data)
182{
183 ARCANE_UNUSED(data);
184 _throwException(DT_Real3);
185}
186
187void AbstractArrayDataVisitor::
188applyVisitor(IArrayDataT<Real2x2>* data)
189{
190 ARCANE_UNUSED(data);
191 _throwException(DT_Real2x2);
192}
193
194void AbstractArrayDataVisitor::
195applyVisitor(IArrayDataT<Real3x3>* data)
196{
197 ARCANE_UNUSED(data);
198 _throwException(DT_Real3x3);
199}
200
201void AbstractArrayDataVisitor::
202applyVisitor(IArrayDataT<String>* data)
203{
204 ARCANE_UNUSED(data);
205 _throwException(DT_String);
206}
207
208/*---------------------------------------------------------------------------*/
209/*---------------------------------------------------------------------------*/
210
211void AbstractArray2DataVisitor::
212_throwException(eDataType dt)
213{
214 String s = String::format("array2 visitor not implemented for data type '{0}'",
215 dataTypeName(dt));
216 throw NotImplementedException(A_FUNCINFO,s);
217}
218
219void AbstractArray2DataVisitor::
220applyVisitor(IArray2DataT<Byte>* data)
221{
222 ARCANE_UNUSED(data);
223 _throwException(DT_Byte);
224}
225
226void AbstractArray2DataVisitor::
227applyVisitor(IArray2DataT<Real>* data)
228{
229 ARCANE_UNUSED(data);
230 _throwException(DT_Real);
231}
232
233void AbstractArray2DataVisitor::
234applyVisitor(IArray2DataT<Int16>* data)
235{
236 ARCANE_UNUSED(data);
237 _throwException(DT_Int16);
238}
239
240void AbstractArray2DataVisitor::
241applyVisitor(IArray2DataT<Int32>* data)
242{
243 ARCANE_UNUSED(data);
244 _throwException(DT_Int32);
245}
246
247void AbstractArray2DataVisitor::
248applyVisitor(IArray2DataT<Int64>* data)
249{
250 ARCANE_UNUSED(data);
251 _throwException(DT_Int64);
252}
253
254void AbstractArray2DataVisitor::
255applyVisitor(IArray2DataT<Real2>* data)
256{
257 ARCANE_UNUSED(data);
258 _throwException(DT_Real2);
259}
260
261void AbstractArray2DataVisitor::
262applyVisitor(IArray2DataT<Real3>* data)
263{
264 ARCANE_UNUSED(data);
265 _throwException(DT_Real3);
266}
267
268void AbstractArray2DataVisitor::
269applyVisitor(IArray2DataT<Real2x2>* data)
270{
271 ARCANE_UNUSED(data);
272 _throwException(DT_Real2x2);
273}
274
275void AbstractArray2DataVisitor::
276applyVisitor(IArray2DataT<Real3x3>* data)
277{
278 ARCANE_UNUSED(data);
279 _throwException(DT_Real3x3);
280}
281
282/*---------------------------------------------------------------------------*/
283/*---------------------------------------------------------------------------*/
284
285void AbstractMultiArray2DataVisitor::
286_throwException(eDataType dt)
287{
288 String s = String::format("multiarray2 visitor not implemented for data type '{0}'",
289 dataTypeName(dt));
290 throw NotImplementedException(A_FUNCINFO,s);
291}
292#if 0
293void AbstractMultiArray2DataVisitor::
294applyVisitor(IMultiArray2DataT<Byte>* data)
295{
296 ARCANE_UNUSED(data);
297 _throwException(DT_Byte);
298}
299
300void AbstractMultiArray2DataVisitor::
301applyVisitor(IMultiArray2DataT<Real>* data)
302{
303 ARCANE_UNUSED(data);
304 _throwException(DT_Real);
305}
306
307void AbstractMultiArray2DataVisitor::
308applyVisitor(IMultiArray2DataT<Int16>* data)
309{
310 ARCANE_UNUSED(data);
311 _throwException(DT_Int16);
312}
313
314void AbstractMultiArray2DataVisitor::
315applyVisitor(IMultiArray2DataT<Int32>* data)
316{
317 ARCANE_UNUSED(data);
318 _throwException(DT_Int32);
319}
320
321void AbstractMultiArray2DataVisitor::
322applyVisitor(IMultiArray2DataT<Int64>* data)
323{
324 ARCANE_UNUSED(data);
325 _throwException(DT_Int64);
326}
327
328void AbstractMultiArray2DataVisitor::
329applyVisitor(IMultiArray2DataT<Real2>* data)
330{
331 ARCANE_UNUSED(data);
332 _throwException(DT_Real2);
333}
334
335void AbstractMultiArray2DataVisitor::
336applyVisitor(IMultiArray2DataT<Real3>* data)
337{
338 ARCANE_UNUSED(data);
339 _throwException(DT_Real3);
340}
341
342void AbstractMultiArray2DataVisitor::
343applyVisitor(IMultiArray2DataT<Real2x2>* data)
344{
345 ARCANE_UNUSED(data);
346 _throwException(DT_Real2x2);
347}
348
349void AbstractMultiArray2DataVisitor::
350applyVisitor(IMultiArray2DataT<Real3x3>* data)
351{
352 ARCANE_UNUSED(data);
353 _throwException(DT_Real3x3);
354}
355#endif
356
357/*---------------------------------------------------------------------------*/
358/*---------------------------------------------------------------------------*/
359
360}
361
362/*---------------------------------------------------------------------------*/
363/*---------------------------------------------------------------------------*/
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
eDataType
Type d'une donnée.
Definition DataTypes.h:39
@ DT_Real2x2
Donnée de type tenseur 3x3.
Definition DataTypes.h:48
@ DT_Int16
Donnée de type entier 16 bits.
Definition DataTypes.h:42
@ DT_Real3x3
Donnée de type tenseur 3x3.
Definition DataTypes.h:49
@ DT_Int32
Donnée de type entier 32 bits.
Definition DataTypes.h:43
@ DT_Real3
Donnée de type vecteur 3.
Definition DataTypes.h:47
@ DT_Int64
Donnée de type entier 64 bits.
Definition DataTypes.h:44
@ DT_String
Donnée de type chaîne de caractère UTF-8.
Definition DataTypes.h:45
@ DT_Real2
Donnée de type vecteur 2.
Definition DataTypes.h:46
@ DT_Real
Donnée de type réel.
Definition DataTypes.h:41
@ DT_Byte
Donnée de type octet.
Definition DataTypes.h:40
const char * dataTypeName(eDataType type)
Nom du type de donnée.
Definition DataTypes.cc:70