Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
ArrayVariant.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/* ArrayVariant.h (C) 2000-2018 */
9/* */
10/* Type de base polymorphe pour les tableaux mono-dim (dimension 1). */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_DATATYPE_ARRAYVARIANT_H
13#define ARCANE_DATATYPE_ARRAYVARIANT_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/ArrayView.h"
18#include "arcane/utils/Iostream.h"
19
20#include "arcane/datatype/VariantBase.h"
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25ARCANE_BEGIN_NAMESPACE
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29
30class Real2;
31class Real3;
32class Real2x2;
33class Real3x3;
34
35/*---------------------------------------------------------------------------*/
36/*---------------------------------------------------------------------------*/
43class ARCANE_DATATYPE_EXPORT ArrayVariant
44: public VariantBase
45{
46 public:
47 ArrayVariant(eType type,Integer size);
58
59 public:
60
61 Integer size() const;
62
63 void value(ArrayView<Real>& v) const { v = m_real_value; }
64 void value(ArrayView<Real2>& v) const { v = m_real2_value; }
65 void value(ArrayView<Real3>& v) const { v = m_real3_value; }
66 void value(ArrayView<Real2x2>& v) const { v = m_real2x2_value; }
67 void value(ArrayView<Real3x3>& v) const { v = m_real3x3_value; }
68 void value(ArrayView<Int32>& v) const { v = m_int32_value; }
69 void value(ArrayView<Int64>& v) const { v = m_int64_value; }
70 void value(ArrayView<bool>& v) const { v = m_bool_value; }
71 void value(ArrayView<String>& v) const { v = m_string_value; }
72
73 ArrayView<Real> asReal() { return m_real_value; }
74 ArrayView<Real2> asReal2() { return m_real2_value; }
75 ArrayView<Real3> asReal3() { return m_real3_value; }
76 ArrayView<Real2x2> asReal2x2() { return m_real2x2_value; }
77 ArrayView<Real3x3> asReal3x3() { return m_real3x3_value; }
78 ArrayView<Integer> asInteger();
79 ArrayView<Int32> asInt32() { return m_int32_value; }
80 ArrayView<bool> asBool() { return m_bool_value; }
81 ArrayView<String> asString() { return m_string_value; }
82
83 ConstArrayView<Real> asReal() const { return m_real_value; }
84 ConstArrayView<Real2> asReal2() const { return m_real2_value; }
85 ConstArrayView<Real3> asReal3() const { return m_real3_value; }
86 ConstArrayView<Real2x2> asReal2x2() const { return m_real2x2_value; }
87 ConstArrayView<Real3x3> asReal3x3() const { return m_real3x3_value; }
88 ConstArrayView<Integer> asInteger() const;
89 ConstArrayView<Int32> asInt32() const { return m_int32_value; }
90 ConstArrayView<Int64> asInt64() const { return m_int64_value; }
91 ConstArrayView<bool> asBool() const { return m_bool_value; }
92 ConstArrayView<String> asString() const { return m_string_value; }
93
94 public:
95
96
97 private:
108
109 void _destroy();
110};
111
112ARCANE_DATATYPE_EXPORT std::ostream&
113operator<<(std::ostream& s, const ArrayVariant& x);
114
115/*---------------------------------------------------------------------------*/
116/*---------------------------------------------------------------------------*/
117
118ARCANE_END_NAMESPACE
119
120/*---------------------------------------------------------------------------*/
121/*---------------------------------------------------------------------------*/
122
123#endif
Type de base polymorphe pour les tableaux (dimension 1).
ArrayView< bool > m_bool_value
Valeur de type tableau de booleens.
ArrayView< Real2 > m_real2_value
Valeur de type tableau de Real2.
ArrayView< Int64 > m_int64_value
Valeur de type tableau d'entiers 64 bits.
ArrayView< Real2x2 > m_real2x2_value
Valeur de type tableau de Real2x2.
ArrayView< Int32 > m_int32_value
Valeur de type tableau d'entiers 32 bits.
ArrayView< String > m_string_value
Valeur de type tableau de chaines.
ArrayView< Real3 > m_real3_value
Valeur de type tableau de Real3.
ArrayView< Real > m_real_value
Valeur de type tableau de reels.
void * m_allocated_array
Non nul si tableau alloué par le variant.
ArrayView< Real3x3 > m_real3x3_value
Valeur de type tableau de Real3x3.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
Classe de base pour les types polymorphes.
Definition VariantBase.h:32