Arcane  v3.14.10.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
VariantBase.h
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.h (C) 2000-2006 */
9/* */
10/* Classe de base pour les types polymorphes. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13#ifndef ARCANE_DATATYPE_VARIANTBASE_H
14#define ARCANE_DATATYPE_VARIANTBASE_H
15/*---------------------------------------------------------------------------*/
16/*---------------------------------------------------------------------------*/
17
18#include "arcane/datatype/DataTypes.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23ARCANE_BEGIN_NAMESPACE
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27/*!
28 * \internal
29 * \brief Classe de base pour les types polymorphes.
30 */
31class ARCANE_DATATYPE_EXPORT VariantBase
32{
33 public:
34 enum eType
35 {
36 TReal = 0,
37 TInt32 = 1,
38 TInt64 = 2,
39 TBool = 3,
40 TString = 4,
41 TReal2 = 5,
42 TReal3 = 6,
43 TReal2x2 = 7,
44 TReal3x3 = 8,
45 TUnknown = 9
46 };
47
48 public:
49 VariantBase(Integer dim, eType atype)
50 : m_dim(dim), m_type(atype) {}
51 virtual ~VariantBase() {}
52 public:
53 /*!
54 \brief Dimension du variant.
55
56 Les valeurs possibles sont les suivantes:
57 - 0 pour un scalaire,.
58 - 1 pour un tableau mono-dim ou variable scalaire du maillage.
59 */
60 Integer dimension() const { return m_dim; }
61 eType type() const { return m_type; }
62 const char* typeName() const { return typeName(m_type); }
63 static const char* typeName(eType type);
64 static eType fromDataType(eDataType type);
65
66 protected:
67 Integer m_dim; //!< dimension du variant.
68 eType m_type; //!< Type garanti valide de la valeur.
69};
70
71/*---------------------------------------------------------------------------*/
72/*---------------------------------------------------------------------------*/
73
74ARCANE_END_NAMESPACE
75
76/*---------------------------------------------------------------------------*/
77/*---------------------------------------------------------------------------*/
78
79#endif
80
Integer m_dim
dimension du variant.
Definition VariantBase.h:67
eType m_type
Type garanti valide de la valeur.
Definition VariantBase.h:68
Integer dimension() const
Dimension du variant.
Definition VariantBase.h:60