Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::CaseOptionSimple Class Referenceabstract

Base class for simple options (single value). More...

#include <arcane/core/CaseOptionSimple.h>

Inheritance diagram for Arcane::CaseOptionSimple:
Collaboration diagram for Arcane::CaseOptionSimple:

Public Member Functions

 CaseOptionSimple (const CaseOptionBuildInfo &cob)
 CaseOptionSimple (const CaseOptionBuildInfo &cob, const String &physical_unit)
bool isPresent () const
 Returns true if the option is present.
 ARCANE_DEPRECATED_LONG_TERM ("Y2022: Do not access XML item from option") XmlNode element() const
 Returns the element of the option.
ICaseFunctionfunction () const override
 Function associated with this option (0 if none).
virtual IStandardFunctionstandardFunction () const
 Standard function associated with this option (0 if none).
bool hasChangedSinceLastIteration () const
 Indicates if the value has changed since the last iteration.
String xpathFullName () const
 Full name in the format provided by the XPath standard.
String defaultPhysicalUnit () const
 Default physical unit for this option (null if no unit), specified in the .axl file.
String physicalUnit () const
 Physical unit specified in the data set (null if no unit).
IPhysicalUnitConverterphysicalUnitConverter () const
 Physical unit converter.
bool isOptional () const
 Indicates if the option is optional.
bool hasValidValue () const
 Indicates if the option has an invalid value.
void visit (ICaseDocumentVisitor *visitor) const override
 Applies the visitor to this option.
Public Member Functions inherited from Arcane::CaseOptionBase
String trueName () const
 Returns the true name (untranslated) of the option.
String name () const
 Returns the option name corresponding to the data set language.
String translatedName (const String &lang) const
 Name of the option in the language lang. Returns name() if no translation exists.
void search (bool is_phase1)
 Retrieves the value from the configuration file for the variable.
virtual void print (const String &lang, std::ostream &o) const =0
 Prints the option value in the language lang, to the stream o.
ICaseMngcaseMng () const
 Case manager.
ICaseOptionListparentOptionList () const
 Parent OptionList.
ITraceMngtraceMng () const
 Trace manager.
ISubDomainsubDomain () const
 Sub-domain manager.
ICaseDocumentcaseDocument () const
 Returns the document manager.
ICaseDocumentFragmentcaseDocumentFragment () const
 Returns the document associated with this option.
void setRootElement (const XmlNode &root_element)
 Positions the root element at root_element.
XmlNode rootElement () const
 Returns the root element of the DOM.
Integer minOccurs () const
 Minimum number of occurrences (for a multiple option).
Integer maxOccurs () const
 Maximum number of occurrences (for a multiple option) (-1 == unbounded).
bool isOptional () const
 Allows knowing if an option is optional.
virtual void updateFromFunction (Real current_time, Integer current_iteration)=0
 Updates the option value from a function.
void addAlternativeNodeName (const String &lang, const String &name)
 Adds a translation for the option name.
void addDefaultValue (const String &category, const String &value)
 Adds the default value value to the category category.
void checkIsInitialized () const
 Throws an exception if the option has not been initialized.

Protected Member Functions

void _search (bool is_phase1) override
virtual bool _allowPhysicalUnit ()=0
void _setChangedSinceLastIteration (bool has_changed)
void _searchFunction (XmlNode &velem)
void _setPhysicalUnit (const String &value)
void _setHasValidValue (bool v)
XmlNode _element () const
Protected Member Functions inherited from Arcane::CaseOptionBase
 CaseOptionBase (const CaseOptionBuildInfo &cob)
String _defaultValue () const
 Returns the default value of the option or 0 if none exists.
void _setDefaultValue (const String &def_value)
void _setIsInitialized ()
bool _isInitialized () const
void _checkIsInitialized () const
void _checkMinMaxOccurs (Integer nb_occur)
String _xpathFullName () const

Static Protected Member Functions

static String _convertFunctionRealToString (ICaseFunction *func, Real t)
static String _convertFunctionIntegerToString (ICaseFunction *func, Integer t)

Private Attributes

XmlNode m_element
 Option element.
ICaseFunctionm_function = nullptr
 Associated function (or nullptr).
IStandardFunctionm_standard_function = nullptr
IPhysicalUnitConverterm_unit_converter = nullptr
 Unit converter (nullptr if not needed). Valid only for 'Real' options.
bool m_changed_since_last_iteration = false
bool m_is_optional = false
bool m_has_valid_value = false
String m_default_physical_unit
String m_physical_unit

Detailed Description

Base class for simple options (single value).

Definition at line 83 of file CaseOptionSimple.h.

Constructor & Destructor Documentation

◆ CaseOptionSimple() [1/2]

Arcane::CaseOptionSimple::CaseOptionSimple ( const CaseOptionBuildInfo & cob)
explicit

Definition at line 111 of file CaseOptionSimple.cc.

◆ CaseOptionSimple() [2/2]

Arcane::CaseOptionSimple::CaseOptionSimple ( const CaseOptionBuildInfo & cob,
const String & physical_unit )

Definition at line 122 of file CaseOptionSimple.cc.

◆ ~CaseOptionSimple()

Arcane::CaseOptionSimple::~CaseOptionSimple ( )

Definition at line 134 of file CaseOptionSimple.cc.

Member Function Documentation

◆ _convertFunctionIntegerToString()

String Arcane::CaseOptionSimple::_convertFunctionIntegerToString ( ICaseFunction * func,
Integer t )
staticprotected

Definition at line 862 of file CaseOptionSimple.cc.

◆ _convertFunctionRealToString()

String Arcane::CaseOptionSimple::_convertFunctionRealToString ( ICaseFunction * func,
Real t )
staticprotected

Definition at line 851 of file CaseOptionSimple.cc.

◆ _element()

XmlNode Arcane::CaseOptionSimple::_element ( ) const
inlineprotected

Definition at line 171 of file CaseOptionSimple.h.

◆ _search()

◆ _searchFunction()

void Arcane::CaseOptionSimple::_searchFunction ( XmlNode & velem)
protected

Definition at line 223 of file CaseOptionSimple.cc.

◆ _setChangedSinceLastIteration()

void Arcane::CaseOptionSimple::_setChangedSinceLastIteration ( bool has_changed)
protected

Definition at line 257 of file CaseOptionSimple.cc.

◆ _setHasValidValue()

void Arcane::CaseOptionSimple::_setHasValidValue ( bool v)
inlineprotected

Definition at line 170 of file CaseOptionSimple.h.

◆ _setPhysicalUnit()

void Arcane::CaseOptionSimple::_setPhysicalUnit ( const String & value)
protected

Definition at line 205 of file CaseOptionSimple.cc.

◆ ARCANE_DEPRECATED_LONG_TERM()

Arcane::CaseOptionSimple::ARCANE_DEPRECATED_LONG_TERM ( "Y2022: Do not access XML item from option" ) const
inline

Returns the element of the option.

Deprecated
The internal implementation should not be used to allow for the use of a format other than XML in the future.

Definition at line 103 of file CaseOptionSimple.h.

References m_element.

◆ defaultPhysicalUnit()

String Arcane::CaseOptionSimple::defaultPhysicalUnit ( ) const

Default physical unit for this option (null if no unit), specified in the .axl file.

Definition at line 287 of file CaseOptionSimple.cc.

◆ function()

ICaseFunction * Arcane::CaseOptionSimple::function ( ) const
inlineoverridevirtual

Function associated with this option (0 if none).

If a function is associated with the option, the values of this latter are recalculated automatically at each iteration.

Implements Arcane::CaseOptionBase.

Definition at line 112 of file CaseOptionSimple.h.

References m_function.

Referenced by Arcane::CaseOptionSimpleT< T >::updateFromFunction(), Arcane::CaseOptionSimpleT< T >::valueAtParameter(), and Arcane::CaseOptionSimpleT< T >::valueAtParameter().

Here is the caller graph for this function:

◆ hasChangedSinceLastIteration()

bool Arcane::CaseOptionSimple::hasChangedSinceLastIteration ( ) const

Indicates if the value has changed since the last iteration.

The value can only change if a function is associated with the option. The method returns true if the option's value is different from the previous iteration. This method also works in case of rollback.

Definition at line 266 of file CaseOptionSimple.cc.

◆ hasValidValue()

bool Arcane::CaseOptionSimple::hasValidValue ( ) const
inline

Indicates if the option has an invalid value.

This is always the case, unless the option is optional (isOptional()==true) and not provided.

Definition at line 159 of file CaseOptionSimple.h.

Referenced by Arcane::CaseOptionExtended::print(), and Arcane::CaseOptionSimpleT< T >::print().

Here is the caller graph for this function:

◆ isOptional()

bool Arcane::CaseOptionSimple::isOptional ( ) const
inline

Indicates if the option is optional.

If an optional option is not provided, its value is undefined and should therefore not be used.

Definition at line 151 of file CaseOptionSimple.h.

Referenced by Arcane::CaseOptionExtended::_search(), and Arcane::CaseOptionSimpleT< T >::_search().

Here is the caller graph for this function:

◆ isPresent()

bool Arcane::CaseOptionSimple::isPresent ( ) const
inline

Returns true if the option is present.

Definition at line 95 of file CaseOptionSimple.h.

References m_element.

Referenced by Arcane::ArcaneCaseMeshService::createMesh(), Arcane::CaseOptionExtended::setDefaultValue(), Arcane::CaseOptionSimpleT< T >::setDefaultValue(), Arcane::CaseOptionEnumT< EnumType >::valueIfPresentOrArgument(), Arcane::CaseOptionExtendedT< T >::valueIfPresentOrArgument(), and Arcane::CaseOptionSimpleT< Real >::valueIfPresentOrArgument().

Here is the caller graph for this function:

◆ physicalUnit()

String Arcane::CaseOptionSimple::physicalUnit ( ) const

Physical unit specified in the data set (null if no unit).

Definition at line 214 of file CaseOptionSimple.cc.

◆ physicalUnitConverter()

IPhysicalUnitConverter * Arcane::CaseOptionSimple::physicalUnitConverter ( ) const
inline

Physical unit converter.

This converter only exists for 'Real' or 'RealArray' type options. It is null if the option does not have a unit.

Definition at line 144 of file CaseOptionSimple.h.

References m_unit_converter.

Referenced by Arcane::CaseOptionSimpleT< T >::_search(), Arcane::CaseOptionSimpleT< T >::updateFromFunction(), Arcane::CaseOptionSimpleT< T >::valueAtParameter(), and Arcane::CaseOptionSimpleT< T >::valueAtParameter().

Here is the caller graph for this function:

◆ standardFunction()

virtual IStandardFunction * Arcane::CaseOptionSimple::standardFunction ( ) const
inlinevirtual

Standard function associated with this option (0 if none).

A standard function has a specific prototype and can be called directly. Unlike function(), the presence of a standard function does not change the value of the option.

Definition at line 120 of file CaseOptionSimple.h.

References m_standard_function.

◆ visit()

void Arcane::CaseOptionSimple::visit ( ICaseDocumentVisitor * visitor) const
overridevirtual

Applies the visitor to this option.

Implements Arcane::CaseOptionBase.

Definition at line 296 of file CaseOptionSimple.cc.

◆ xpathFullName()

String Arcane::CaseOptionSimple::xpathFullName ( ) const

Full name in the format provided by the XPath standard.

Definition at line 275 of file CaseOptionSimple.cc.

References m_element, Arcane::CaseOptionBase::name(), and Arcane::CaseOptionBase::rootElement().

Referenced by Arcane::CaseOptionExtended::_search(), and Arcane::CaseOptionExtended::setDefaultValue().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_changed_since_last_iteration

bool Arcane::CaseOptionSimple::m_changed_since_last_iteration = false
private

Definition at line 183 of file CaseOptionSimple.h.

◆ m_default_physical_unit

String Arcane::CaseOptionSimple::m_default_physical_unit
private

Definition at line 186 of file CaseOptionSimple.h.

◆ m_element

XmlNode Arcane::CaseOptionSimple::m_element
private

Option element.

Definition at line 178 of file CaseOptionSimple.h.

Referenced by ARCANE_DEPRECATED_LONG_TERM(), isPresent(), and xpathFullName().

◆ m_function

ICaseFunction* Arcane::CaseOptionSimple::m_function = nullptr
private

Associated function (or nullptr).

Definition at line 179 of file CaseOptionSimple.h.

Referenced by function().

◆ m_has_valid_value

bool Arcane::CaseOptionSimple::m_has_valid_value = false
private

Definition at line 185 of file CaseOptionSimple.h.

◆ m_is_optional

bool Arcane::CaseOptionSimple::m_is_optional = false
private

Definition at line 184 of file CaseOptionSimple.h.

◆ m_physical_unit

String Arcane::CaseOptionSimple::m_physical_unit
private

Definition at line 187 of file CaseOptionSimple.h.

◆ m_standard_function

IStandardFunction* Arcane::CaseOptionSimple::m_standard_function = nullptr
private

Associated standard function (or nullpt)

Definition at line 180 of file CaseOptionSimple.h.

Referenced by standardFunction().

◆ m_unit_converter

IPhysicalUnitConverter* Arcane::CaseOptionSimple::m_unit_converter = nullptr
private

Unit converter (nullptr if not needed). Valid only for 'Real' options.

Definition at line 182 of file CaseOptionSimple.h.

Referenced by physicalUnitConverter().


The documentation for this class was generated from the following files: