12#ifndef ARCANE_CASEOPTIONEXTENDED_H
13#define ARCANE_CASEOPTIONEXTENDED_H
17#include "arcane/utils/Array.h"
19#include "arcane/core/CaseOptionSimple.h"
34class ARCANE_CORE_EXPORT CaseOptionExtended
35:
public CaseOptionSimple
40 : CaseOptionSimple(cob)
46 void print(
const String& lang, std::ostream& o)
const override;
57 void setDefaultValue(
const String& def_value);
61 virtual bool _tryToConvert(
const String& s) = 0;
63 void _search(
bool is_phase1)
override;
64 bool _allowPhysicalUnit()
override {
return false; }
66 String _typeName()
const {
return m_type_name; }
94class CaseOptionExtendedT
95:
public CaseOptionExtended
100 : CaseOptionExtended(cob, type_name)
106 operator const T&()
const {
return value(); }
111 ARCANE_CASEOPTION_CHECK_IS_INITIALIZED;
121 ARCANE_CASEOPTION_CHECK_IS_INITIALIZED;
127 virtual bool _tryToConvert(
const String& s)
132 return _caseOptionConvert(*
this, s,
m_value);
148class ARCANE_CORE_EXPORT CaseOptionMultiExtended
149:
public CaseOptionBase
154 : CaseOptionBase(cob)
157 ~CaseOptionMultiExtended() {}
161 void print(
const String& lang, std::ostream& o)
const override;
168 virtual bool _tryToConvert(
const String& s,
Integer pos) = 0;
169 virtual void _allocate(
Integer size) = 0;
170 virtual bool _allowPhysicalUnit() {
return false; }
171 virtual Integer _nbElem()
const = 0;
172 String _typeName()
const {
return m_type_name; }
173 void _search(
bool is_phase1)
override;
192class CaseOptionMultiExtendedT
193:
public CaseOptionMultiExtended
203 : CaseOptionMultiExtended(cob, type_name)
210 bool _tryToConvert(
const String& s,
Integer pos)
override
216 return _caseOptionConvert(*
this, s, value);
220 m_values.resize(
size);
222 *view = m_values.view();
225 virtual Integer _nbElem()
const override {
return m_values.size(); }
229 UniqueArray<T> m_values;
constexpr ArrayView() noexcept
Constructs an empty view.
constexpr reference operator[](Integer i)
i-th element of the array.
constexpr Integer size() const noexcept
Returns the size of the array.
Information for building a dataset option.
const T & value() const
Option value.
const T & valueIfPresentOrArgument(const T &arg_value)
Returns the value of the option if isPresent()==true or otherwise arg_value.
const T & operator()() const
Option value.
T m_value
Value of the option.
void updateFromFunction(Real, Integer) override
Updates the option value from a function.
String m_type_name
Name of the option type.
ICaseFunction * function() const override
Returns the function linked to this option or nullptr if none exists.
String m_value
Value of the option in unicode string format.
void print(const String &lang, std::ostream &o) const override
Prints the option value in the language lang, to the stream o.
Option for the extended list of types dataset.
T Type
Type of the option.
ICaseFunction * function() const override
Returns the function linked to this option or nullptr if none exists.
String m_type_name
Name of the option type.
void updateFromFunction(Real, Integer) override
Updates the option value from a function.
UniqueArray< String > m_values
Values in unicode string format.
void print(const String &lang, std::ostream &o) const override
Prints the option value in the language lang, to the stream o.
bool isPresent() const
Returns true if the option is present.
Visitor interface for a dataset option.
Interface of a dataset function.
Unicode character string.
1D data vector with value semantics (STL style).
-- 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.