12#ifndef ARCANE_CORE_DATATYPE_SCALARVARIANT_H
13#define ARCANE_CORE_DATATYPE_SCALARVARIANT_H
17#include "arcane/utils/String.h"
18#include "arcane/utils/Real2.h"
19#include "arcane/utils/Real3.h"
20#include "arcane/utils/Real2x2.h"
21#include "arcane/utils/Real3x3.h"
23#include "arcane/core/datatype/VariantBase.h"
38class ARCANE_DATATYPE_EXPORT ScalarVariant
45 ScalarVariant(
const ScalarVariant& v);
46 ScalarVariant(
Real v);
47 ScalarVariant(
Real2 v);
48 ScalarVariant(
Real3 v);
51 ScalarVariant(
Int32 v);
52 ScalarVariant(
Int64 v);
53 ScalarVariant(
bool v);
54 ScalarVariant(
const String& v);
57 ScalarVariant& operator=(
const ScalarVariant& v);
59 bool isInteger()
const {
return m_type == TInt32 ||
m_type == TInt64; }
66 void setValue(
Real2 v)
71 void setValue(
Real3 v)
86 void setValue(
Int32 v)
91 void setValue(
Int64 v)
101 void setValue(
const String& v)
107 void value(
Real& v)
const { v = m_real_value; }
108 void value(
Real2& v)
const { v = m_real2_value; }
109 void value(
Real3& v)
const { v = m_real3_value; }
110 void value(
Real2x2& v)
const { v = m_real2x2_value; }
111 void value(
Real3x3& v)
const { v = m_real3x3_value; }
112 void value(
Int32& v)
const { v = m_int32_value; }
113 void value(
Int64& v)
const { v = m_int64_value; }
114 void value(
bool& v)
const { v = m_bool_value; }
115 void value(
String& v)
const { v = m_string_value; }
117 Real asReal()
const {
return m_real_value; }
118 Real2 asReal2()
const {
return m_real2_value; }
119 Real3 asReal3()
const {
return m_real3_value; }
120 Real2x2 asReal2x2()
const {
return m_real2x2_value; }
121 Real3x3 asReal3x3()
const {
return m_real3x3_value; }
123 Int32 asInt32()
const {
return m_int32_value; }
124 Int64 asInt64()
const {
return m_int64_value; }
125 bool asBool()
const {
return m_bool_value; }
126 const String& asString()
const {
return m_string_value; }
Class managing a 2-dimensional real vector.
Class managing a 2x2 matrix of reals.
Class managing a 3-dimensional real vector.
Class managing a 3x3 real matrix.
Unicode character string.
eType m_type
Guaranteed valid type of the value.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.
double Real
Type representing a real number.
std::int32_t Int32
Signed integer type of 32 bits.