Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
CaseFunction2.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 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/* CaseFunction2.h (C) 2000-2023 */
9/* */
10/* Data set function with explicit value type. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_CASEFUNCTION2_H
13#define ARCANE_CORE_CASEFUNCTION2_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/Real3.h"
18#include "arcane/core/CaseFunction.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
41class ARCANE_CORE_EXPORT CaseFunction2
42: public CaseFunction
43{
44 public:
45
48 : CaseFunction(cfbi)
49 {}
50
51 protected:
52
53 void value(Real param, Real& v) const override
54 {
55 v = valueAsReal(param);
56 }
57 void value(Real param, Integer& v) const override
58 {
59 v = valueAsInteger(param);
60 }
61 void value(Real param, bool& v) const override
62 {
63 v = valueAsBool(param);
64 }
65 void value(Real param, String& v) const override
66 {
67 v = valueAsString(param);
68 }
69 void value(Real param, Real3& v) const override
70 {
71 v = valueAsReal3(param);
72 }
73 void value(Integer param, Real& v) const override
74 {
75 v = valueAsReal(param);
76 }
77 void value(Integer param, Integer& v) const override
78 {
79 v = valueAsInteger(param);
80 }
81 void value(Integer param, bool& v) const override
82 {
83 v = valueAsBool(param);
84 }
85 void value(Integer param, String& v) const override
86 {
87 v = valueAsString(param);
88 }
89 void value(Integer param, Real3& v) const override
90 {
91 v = valueAsReal3(param);
92 }
93
94 public:
95
96 virtual Real valueAsReal(Real param) const = 0;
97 virtual Integer valueAsInteger(Real param) const = 0;
98 virtual bool valueAsBool(Real param) const = 0;
99 virtual String valueAsString(Real param) const = 0;
100 virtual Real3 valueAsReal3(Real param) const = 0;
101
102 virtual Real valueAsReal(Integer param) const = 0;
103 virtual Integer valueAsInteger(Integer param) const = 0;
104 virtual bool valueAsBool(Integer param) const = 0;
105 virtual String valueAsString(Integer param) const = 0;
106 virtual Real3 valueAsReal3(Integer param) const = 0;
107};
108
109/*---------------------------------------------------------------------------*/
110/*---------------------------------------------------------------------------*/
111
112} // namespace Arcane
113
114/*---------------------------------------------------------------------------*/
115/*---------------------------------------------------------------------------*/
116
117#endif
void value(Integer param, Real3 &v) const override
Value v of the option for parameter param.
void value(Integer param, String &v) const override
Value v of the option for parameter param.
void value(Real param, String &v) const override
Value v of the option for parameter param.
void value(Real param, Integer &v) const override
Value v of the option for parameter param.
void value(Real param, Real3 &v) const override
Value v of the option for parameter param.
void value(Real param, bool &v) const override
Value v of the option for parameter param.
void value(Real param, Real &v) const override
Value v of the option for parameter param.
CaseFunction2(const CaseFunctionBuildInfo &cfbi)
Constructs a data set function.
void value(Integer param, Real &v) const override
Value v of the option for parameter param.
void value(Integer param, Integer &v) const override
Value v of the option for parameter param.
Information to build an instance of CaseFunction.
CaseFunction(const CaseFunctionBuildInfo &info)
Constructs a dataset function.
Class managing a 3-dimensional real vector.
Definition Real3.h:132
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
double Real
Type representing a real number.