Arcane  v3.16.8.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
VariantBase.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2025 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.h (C) 2000-2025 */
9/* */
10/* Classe de base pour les types polymorphes. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13#ifndef ARCANE_CORE_DATATYPE_VARIANTBASE_H
14#define ARCANE_CORE_DATATYPE_VARIANTBASE_H
15/*---------------------------------------------------------------------------*/
16/*---------------------------------------------------------------------------*/
17
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
32class ARCANE_DATATYPE_EXPORT VariantBase
33{
34 public:
35 enum eType
36 {
37 TReal = 0,
38 TInt32 = 1,
39 TInt64 = 2,
40 TBool = 3,
41 TString = 4,
42 TReal2 = 5,
43 TReal3 = 6,
44 TReal2x2 = 7,
45 TReal3x3 = 8,
46 TUnknown = 9
47 };
48
49 public:
50 VariantBase(Integer dim, eType atype)
51 : m_dim(dim), m_type(atype) {}
52 virtual ~VariantBase() {}
53 public:
61 Integer dimension() const { return m_dim; }
62 eType type() const { return m_type; }
63 const char* typeName() const { return typeName(m_type); }
64 static const char* typeName(eType type);
65 static eType fromDataType(eDataType type);
66
67 protected:
69 eType m_type;
70};
71
72/*---------------------------------------------------------------------------*/
73/*---------------------------------------------------------------------------*/
74
75}
76
77/*---------------------------------------------------------------------------*/
78/*---------------------------------------------------------------------------*/
79
80#endif
81
Fichier contenant les définitions des types de données gérés par Arcane.
Integer m_dim
dimension du variant.
Definition VariantBase.h:68
eType m_type
Type garanti valide de la valeur.
Definition VariantBase.h:69
Integer dimension() const
Dimension du variant.
Definition VariantBase.h:61
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Int32 Integer
Type représentant un entier.