Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::CaseOptionEnumT< EnumType > Class Template Reference

Enumerated data set option. More...

#include <arcane/core/CaseOptionEnum.h>

Inheritance diagram for Arcane::CaseOptionEnumT< EnumType >:
Collaboration diagram for Arcane::CaseOptionEnumT< EnumType >:

Public Member Functions

 CaseOptionEnumT (const CaseOptionBuildInfo &cob, const String &type_name)
EnumType value () const
 Option value.
 operator EnumType () const
 Option value.
EnumType operator() () const
 Option value.
void setDefaultValue (EnumType def_value)
 Sets the default value of the option.
EnumType valueIfPresentOrArgument (EnumType arg_value)
 Returns the option value if isPresent()==true, otherwise arg_value.
Public Member Functions inherited from Arcane::CaseOptionEnum
 CaseOptionEnum (const CaseOptionBuildInfo &cob, const String &type_name)
virtual void print (const String &lang, std::ostream &o) const
 Prints the option value in the language lang, to the stream o.
virtual void updateFromFunction (Real current_time, Integer current_iteration)
 Updates the option value from a function.
void addEnumValue (CaseOptionEnumValue *value, bool do_clone)
CaseOptionEnumValuesenumValues () const
virtual void visit (ICaseDocumentVisitor *visitor) const
 Applies the visitor to this option.
int enumValueAsInt () const
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 void _setOptionValue (int i)
 Sets the option value to v.
virtual int _optionValue () const
 Returns the option value.
Protected Member Functions inherited from Arcane::CaseOptionEnum
virtual void _search (bool is_phase1)
virtual bool _allowPhysicalUnit ()
void _setEnumDefaultValue (int def_value)
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

EnumType m_value
 Option value.

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

template<class EnumType>
class Arcane::CaseOptionEnumT< EnumType >

Enumerated data set option.

T is the computer type of the enumeration.

Definition at line 220 of file CaseOptionEnum.h.

Constructor & Destructor Documentation

◆ CaseOptionEnumT()

template<class EnumType>
Arcane::CaseOptionEnumT< EnumType >::CaseOptionEnumT ( const CaseOptionBuildInfo & cob,
const String & type_name )
inline

Definition at line 225 of file CaseOptionEnum.h.

Member Function Documentation

◆ _optionValue()

template<class EnumType>
virtual int Arcane::CaseOptionEnumT< EnumType >::_optionValue ( ) const
inlineprotectedvirtual

Returns the option value.

Implements Arcane::CaseOptionEnum.

Definition at line 274 of file CaseOptionEnum.h.

References m_value.

◆ _setOptionValue()

template<class EnumType>
virtual void Arcane::CaseOptionEnumT< EnumType >::_setOptionValue ( int v)
inlineprotectedvirtual

Sets the option value to v.

Implements Arcane::CaseOptionEnum.

Definition at line 270 of file CaseOptionEnum.h.

References m_value.

◆ operator EnumType()

template<class EnumType>
Arcane::CaseOptionEnumT< EnumType >::operator EnumType ( ) const
inline

Option value.

Definition at line 240 of file CaseOptionEnum.h.

◆ operator()()

template<class EnumType>
EnumType Arcane::CaseOptionEnumT< EnumType >::operator() ( ) const
inline

Option value.

Definition at line 243 of file CaseOptionEnum.h.

References value().

Here is the call graph for this function:

◆ setDefaultValue()

template<class EnumType>
void Arcane::CaseOptionEnumT< EnumType >::setDefaultValue ( EnumType def_value)
inline

Sets the default value of the option.

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

Definition at line 251 of file CaseOptionEnum.h.

◆ value()

template<class EnumType>
EnumType Arcane::CaseOptionEnumT< EnumType >::value ( ) const
inline

Option value.

Definition at line 233 of file CaseOptionEnum.h.

References m_value.

Referenced by Arcane::CaseOptionEnumT< Arcane::eMeshCellDimensionKind >::operator Arcane::eMeshCellDimensionKind(), and operator()().

Here is the caller graph for this function:

◆ valueIfPresentOrArgument()

template<class EnumType>
EnumType Arcane::CaseOptionEnumT< EnumType >::valueIfPresentOrArgument ( EnumType arg_value)
inline

Returns the option value if isPresent()==true, otherwise arg_value.

Definition at line 257 of file CaseOptionEnum.h.

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

Here is the call graph for this function:

Member Data Documentation

◆ m_value

template<class EnumType>
EnumType Arcane::CaseOptionEnumT< EnumType >::m_value
private

Option value.

Definition at line 265 of file CaseOptionEnum.h.

Referenced by _optionValue(), _setOptionValue(), value(), and valueIfPresentOrArgument().


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