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

Option for the extended type dataset. More...

#include <arcane/core/CaseOptionExtended.h>

Inheritance diagram for Arcane::CaseOptionExtended:
Collaboration diagram for Arcane::CaseOptionExtended:

Public Member Functions

 CaseOptionExtended (const CaseOptionBuildInfo &cob, const String &type_name)
void print (const String &lang, std::ostream &o) const override
 Prints the option value in the language lang, to the stream o.
ICaseFunctionfunction () const override
 Returns the function linked to this option or nullptr if none exists.
void updateFromFunction (Real, Integer) override
 Updates the option value from a function.
void visit (ICaseDocumentVisitor *visitor) const override
 Applies the visitor to this option.
void setDefaultValue (const String &def_value)
 Sets the default value of the option.
Public Member Functions inherited from Arcane::CaseOptionSimple
 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.
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.
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

virtual bool _tryToConvert (const String &s)=0
void _search (bool is_phase1) override
 Searches for the option value in the data set.
bool _allowPhysicalUnit () override
String _typeName () const
Protected Member Functions inherited from Arcane::CaseOptionSimple
void _search (bool is_phase1) override
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

Private Attributes

String m_type_name
 Name of the option type.
String m_value
 Value of the option in unicode string format.

Additional Inherited Members

Static Protected Member Functions inherited from Arcane::CaseOptionSimple
static String _convertFunctionRealToString (ICaseFunction *func, Real t)
static String _convertFunctionIntegerToString (ICaseFunction *func, Integer t)

Detailed Description

Option for the extended type dataset.

Definition at line 34 of file CaseOptionExtended.h.

Constructor & Destructor Documentation

◆ CaseOptionExtended()

Arcane::CaseOptionExtended::CaseOptionExtended ( const CaseOptionBuildInfo & cob,
const String & type_name )
inline

Definition at line 39 of file CaseOptionExtended.h.

Member Function Documentation

◆ _allowPhysicalUnit()

bool Arcane::CaseOptionExtended::_allowPhysicalUnit ( )
inlineoverrideprotectedvirtual

Implements Arcane::CaseOptionSimple.

Definition at line 64 of file CaseOptionExtended.h.

◆ _search()

void Arcane::CaseOptionExtended::_search ( bool is_phase1)
overrideprotectedvirtual

Searches for the option value in the data set.

The found value is stored in m_value.

If the value is not present in the data set, it checks for a default value and uses it.

Implements Arcane::CaseOptionBase.

Definition at line 232 of file CaseOptionExtended.cc.

References Arcane::CaseOptionBase::_defaultValue(), Arcane::CaseOptionError::addInvalidTypeError(), Arcane::CaseOptionError::addOptionNotFoundError(), Arcane::CaseOptionBase::caseDocumentFragment(), Arcane::ITraceMng::info(), Arcane::CaseOptionSimple::isOptional(), m_value, Arcane::ICaseOptionList::meshHandle(), Arcane::CaseOptionBase::name(), Arcane::String::null(), Arcane::CaseOptionBase::parentOptionList(), Arcane::CaseOptionBase::rootElement(), Arcane::CaseOptionBase::traceMng(), and Arcane::CaseOptionSimple::xpathFullName().

Here is the call graph for this function:

◆ _typeName()

String Arcane::CaseOptionExtended::_typeName ( ) const
inlineprotected

Definition at line 66 of file CaseOptionExtended.h.

◆ function()

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

Returns the function linked to this option or nullptr if none exists.

Implements Arcane::CaseOptionBase.

Definition at line 47 of file CaseOptionExtended.h.

◆ print()

void Arcane::CaseOptionExtended::print ( const String & lang,
std::ostream & o ) const
overridevirtual

Prints the option value in the language lang, to the stream o.

Implements Arcane::CaseOptionBase.

Definition at line 273 of file CaseOptionExtended.cc.

References Arcane::CaseOptionSimple::hasValidValue(), and m_value.

Here is the call graph for this function:

◆ setDefaultValue()

void Arcane::CaseOptionExtended::setDefaultValue ( const String & def_value)

Sets the default value of the option.

If the option is not present in the dataset, its value will be that specified by the argument def_value; otherwise, calling this method has no effect.

Definition at line 198 of file CaseOptionExtended.cc.

References ARCANE_FATAL, Arcane::CaseOptionSimple::isPresent(), m_value, and Arcane::CaseOptionSimple::xpathFullName().

Here is the call graph for this function:

◆ updateFromFunction()

void Arcane::CaseOptionExtended::updateFromFunction ( Real current_time,
Integer current_iteration )
inlineoverridevirtual

Updates the option value from a function.

If the option is not linked to a workflow table, it does nothing. Otherwise, it uses current_time or current_iteration depending on the function parameter type to calculate the new option value. This value will then be normally accessible via the operator() method.

Implements Arcane::CaseOptionBase.

Definition at line 48 of file CaseOptionExtended.h.

◆ visit()

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

Applies the visitor to this option.

Implements Arcane::CaseOptionBase.

Definition at line 287 of file CaseOptionExtended.cc.

Member Data Documentation

◆ m_type_name

String Arcane::CaseOptionExtended::m_type_name
private

Name of the option type.

Definition at line 70 of file CaseOptionExtended.h.

◆ m_value

String Arcane::CaseOptionExtended::m_value
private

Value of the option in unicode string format.

Definition at line 71 of file CaseOptionExtended.h.

Referenced by _search(), print(), and setDefaultValue().


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