Arcane  v3.14.10.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
VariantBase.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 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/* VariantBase.cc (C) 2000-2004 */
9/* */
10/* Type de base polymorphe pour les tableaux mono-dim (dimension 1). */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14
15#include "arcane/utils/ArcanePrecomp.h"
16
17#include "arcane/datatype/VariantBase.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22ARCANE_BEGIN_NAMESPACE
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27ARCANE_DATATYPE_EXPORT const char* VariantBase::
28typeName(eType type)
29{
30 switch(type){
31 case TReal: return "Real";
32 case TInt32: return "Int32";
33 case TInt64: return "Int64";
34 case TBool: return "Bool";
35 case TString: return "String";
36 case TReal2: return "Real2";
37 case TReal3: return "Real3";
38 case TReal2x2: return "Real2x2";
39 case TReal3x3: return "Real3x3";
40 default:
41 break;
42 }
43 return "Unknown";
44}
45
46/*---------------------------------------------------------------------------*/
47/*---------------------------------------------------------------------------*/
48
49VariantBase::eType VariantBase::
50fromDataType(eDataType type)
51{
52 switch(type){
53 case DT_Real: return VariantBase::TReal;
54 case DT_Int32: return VariantBase::TInt32;
55 case DT_Int64: return VariantBase::TInt64;
56 case DT_String: return VariantBase::TString;
57 case DT_Real2: return VariantBase::TReal2;
58 case DT_Real3: return VariantBase::TReal3;
59 case DT_Real2x2: return VariantBase::TReal2x2;
60 case DT_Real3x3: return VariantBase::TReal3x3;
61 default:
62 break;
63 }
64 return VariantBase::TUnknown;
65}
66
67/*---------------------------------------------------------------------------*/
68/*---------------------------------------------------------------------------*/
69
70ARCANE_END_NAMESPACE
71
72/*---------------------------------------------------------------------------*/
73/*---------------------------------------------------------------------------*/
@ DT_Real2x2
Donnée de type tenseur 3x3.
Definition DataTypes.h:48
@ 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