Base class for a data set option. More...
#include <arcane/core/CaseOptionBase.h>
Public Member Functions | |
| 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. | |
| ICaseMng * | caseMng () const |
| Case manager. | |
| ICaseOptionList * | parentOptionList () const |
| Parent OptionList. | |
| ITraceMng * | traceMng () const |
| Trace manager. | |
| ISubDomain * | subDomain () const |
| Sub-domain manager. | |
| ICaseDocument * | caseDocument () const |
| Returns the document manager. | |
| ICaseDocumentFragment * | caseDocumentFragment () 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. | |
| virtual ICaseFunction * | function () const =0 |
| Returns the function linked to this option or nullptr if none exists. | |
| 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. | |
| virtual void | visit (ICaseDocumentVisitor *visitor) const =0 |
| Applies the visitor to this option. | |
| void | checkIsInitialized () const |
| Throws an exception if the option has not been initialized. | |
Protected Member Functions | |
| 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) |
| virtual void | _search (bool is_phase1)=0 |
| void | _setIsInitialized () |
| bool | _isInitialized () const |
| void | _checkIsInitialized () const |
| void | _checkMinMaxOccurs (Integer nb_occur) |
| String | _xpathFullName () const |
Private Member Functions | |
| void | _setTranslatedName () |
| void | _setCategoryDefaultValue () |
| CaseOptionBase (const CaseOptionBase &from)=delete | |
| Copy constructor. | |
| CaseOptionBase & | operator= (const CaseOptionBase &from)=delete |
| Copy assignment operator. | |
Private Attributes | |
| CaseOptionBasePrivate * | m_p |
| Implementation. | |
Base class for a data set option.
Links the option with the name m_name to the corresponding DOM node.
Definition at line 50 of file CaseOptionBase.h.
|
protected |
Definition at line 94 of file CaseOptionBase.cc.
|
virtual |
Definition at line 104 of file CaseOptionBase.cc.
|
privatedelete |
Copy constructor.
The copy constructor is private because the option should not be copied, notably due to the ICaseFunction which is unique.
|
protected |
Definition at line 348 of file CaseOptionBase.cc.
|
protected |
Definition at line 359 of file CaseOptionBase.cc.
|
protected |
Returns the default value of the option or 0 if none exists.
Definition at line 167 of file CaseOptionBase.cc.
References m_p.
Referenced by Arcane::CaseOptionExtended::_search(), Arcane::CaseOptionMultiExtended::_search(), Arcane::CaseOptionMultiSimpleT< T >::_search(), and Arcane::CaseOptionSimpleT< T >::_search().
|
protected |
Definition at line 339 of file CaseOptionBase.cc.
|
protectedpure virtual |
Implemented in Arcane::CaseOptionExtended, Arcane::CaseOptionMultiExtended, Arcane::CaseOptionMultiSimpleT< T >, Arcane::CaseOptionMultiSimpleT< Arcane::Integer >, Arcane::CaseOptionMultiSimpleT< Arcane::String >, Arcane::CaseOptionSimpleT< T >, Arcane::CaseOptionSimpleT< bool >, Arcane::CaseOptionSimpleT< BoolArray >, Arcane::CaseOptionSimpleT< Int32 >, Arcane::CaseOptionSimpleT< Int32Array >, Arcane::CaseOptionSimpleT< Int64 >, Arcane::CaseOptionSimpleT< Int64Array >, Arcane::CaseOptionSimpleT< Integer >, Arcane::CaseOptionSimpleT< IntegerArray >, Arcane::CaseOptionSimpleT< Real >, Arcane::CaseOptionSimpleT< Real2 >, Arcane::CaseOptionSimpleT< Real2Array >, Arcane::CaseOptionSimpleT< Real2x2 >, Arcane::CaseOptionSimpleT< Real2x2Array >, Arcane::CaseOptionSimpleT< Real3 >, Arcane::CaseOptionSimpleT< Real3Array >, Arcane::CaseOptionSimpleT< Real3x3 >, Arcane::CaseOptionSimpleT< Real3x3Array >, Arcane::CaseOptionSimpleT< RealArray >, Arcane::CaseOptionSimpleT< String >, and Arcane::CaseOptionSimpleT< StringArray >.
|
private |
Definition at line 260 of file CaseOptionBase.cc.
|
protected |
Definition at line 176 of file CaseOptionBase.cc.
|
protected |
Definition at line 330 of file CaseOptionBase.cc.
|
private |
Definition at line 242 of file CaseOptionBase.cc.
|
protected |
Definition at line 400 of file CaseOptionBase.cc.
Adds a translation for the option name.
Adds the option name name corresponding to the language lang. If a translation already exists for this language, it is replaced by this one.
Definition at line 312 of file CaseOptionBase.cc.
Referenced by updateFromFunction().
Adds the default value value to the category category.
Definition at line 321 of file CaseOptionBase.cc.
References m_p.
Referenced by updateFromFunction().
| ICaseDocument * Arcane::CaseOptionBase::caseDocument | ( | ) | const |
Returns the document manager.
Definition at line 149 of file CaseOptionBase.cc.
References Arcane::ICaseMng::caseDocument(), and caseMng().
Referenced by print().
| ICaseDocumentFragment * Arcane::CaseOptionBase::caseDocumentFragment | ( | ) | const |
Returns the document associated with this option.
Definition at line 158 of file CaseOptionBase.cc.
References m_p.
Referenced by Arcane::CaseOptionExtended::_search(), Arcane::CaseOptionMultiExtended::_search(), Arcane::CaseOptionMultiSimpleT< T >::_search(), Arcane::CaseOptionSimpleT< T >::_search(), and print().
| ICaseMng * Arcane::CaseOptionBase::caseMng | ( | ) | const |
Case manager.
Definition at line 113 of file CaseOptionBase.cc.
References m_p.
Referenced by Arcane::CaseOptionMultiExtended::_search(), Arcane::CaseOptionMultiSimpleT< T >::_search(), caseDocument(), print(), and Arcane::CaseOptionSimpleT< T >::updateFromFunction().
|
inline |
Throws an exception if the option has not been initialized.
Definition at line 140 of file CaseOptionBase.h.
References checkIsInitialized().
Referenced by checkIsInitialized().
|
pure virtual |
Returns the function linked to this option or nullptr if none exists.
Implemented in Arcane::CaseOptionExtended, Arcane::CaseOptionMultiEnum, Arcane::CaseOptionMultiExtended, Arcane::CaseOptionMultiSimpleT< T >, Arcane::CaseOptionMultiSimpleT< Arcane::Integer >, Arcane::CaseOptionMultiSimpleT< Arcane::String >, and Arcane::CaseOptionSimple.
References function(), isOptional(), maxOccurs(), and minOccurs().
Referenced by function().
| bool Arcane::CaseOptionBase::isOptional | ( | ) | const |
Allows knowing if an option is optional.
Definition at line 233 of file CaseOptionBase.cc.
References m_p.
Referenced by Arcane::CaseOptionMultiExtended::_search(), Arcane::CaseOptionMultiSimpleT< T >::_search(), and function().
| Integer Arcane::CaseOptionBase::maxOccurs | ( | ) | const |
Maximum number of occurrences (for a multiple option) (-1 == unbounded).
Definition at line 224 of file CaseOptionBase.cc.
References m_p.
Referenced by Arcane::CaseOptionMultiExtended::_search(), Arcane::CaseOptionMultiSimpleT< T >::_search(), and function().
| Integer Arcane::CaseOptionBase::minOccurs | ( | ) | const |
Minimum number of occurrences (for a multiple option).
Definition at line 215 of file CaseOptionBase.cc.
References m_p.
Referenced by Arcane::CaseOptionMultiExtended::_search(), Arcane::CaseOptionMultiSimpleT< T >::_search(), and function().
| String Arcane::CaseOptionBase::name | ( | ) | const |
Returns the option name corresponding to the data set language.
Definition at line 206 of file CaseOptionBase.cc.
References m_p.
Referenced by Arcane::CaseOptionExtended::_search(), Arcane::CaseOptionMultiExtended::_search(), Arcane::CaseOptionMultiSimpleT< T >::_search(), Arcane::CaseOptionSimpleT< T >::_search(), addAlternativeNodeName(), updateFromFunction(), Arcane::CaseOptionSimpleT< T >::updateFromFunction(), and Arcane::CaseOptionSimple::xpathFullName().
| ICaseOptionList * Arcane::CaseOptionBase::parentOptionList | ( | ) | const |
Parent OptionList.
Definition at line 122 of file CaseOptionBase.cc.
References m_p.
Referenced by Arcane::CaseOptionExtended::_search(), Arcane::CaseOptionMultiExtended::_search(), and print().
|
pure virtual |
Prints the option value in the language lang, to the stream o.
Implemented in Arcane::CaseOptionEnum, Arcane::CaseOptionExtended, Arcane::CaseOptionMultiEnum, Arcane::CaseOptionMultiExtended, Arcane::CaseOptionMultiSimpleT< T >, Arcane::CaseOptionMultiSimpleT< Arcane::Integer >, Arcane::CaseOptionMultiSimpleT< Arcane::String >, Arcane::CaseOptionSimpleT< T >, Arcane::CaseOptionSimpleT< bool >, Arcane::CaseOptionSimpleT< BoolArray >, Arcane::CaseOptionSimpleT< Int32 >, Arcane::CaseOptionSimpleT< Int32Array >, Arcane::CaseOptionSimpleT< Int64 >, Arcane::CaseOptionSimpleT< Int64Array >, Arcane::CaseOptionSimpleT< Integer >, Arcane::CaseOptionSimpleT< IntegerArray >, Arcane::CaseOptionSimpleT< Real >, Arcane::CaseOptionSimpleT< Real2 >, Arcane::CaseOptionSimpleT< Real2Array >, Arcane::CaseOptionSimpleT< Real2x2 >, Arcane::CaseOptionSimpleT< Real2x2Array >, Arcane::CaseOptionSimpleT< Real3 >, Arcane::CaseOptionSimpleT< Real3Array >, Arcane::CaseOptionSimpleT< Real3x3 >, Arcane::CaseOptionSimpleT< Real3x3Array >, Arcane::CaseOptionSimpleT< RealArray >, Arcane::CaseOptionSimpleT< String >, and Arcane::CaseOptionSimpleT< StringArray >.
References caseDocument(), caseDocumentFragment(), caseMng(), parentOptionList(), rootElement(), setRootElement(), subDomain(), and traceMng().
| XmlNode Arcane::CaseOptionBase::rootElement | ( | ) | const |
Returns the root element of the DOM.
Definition at line 303 of file CaseOptionBase.cc.
References m_p.
Referenced by Arcane::CaseOptionExtended::_search(), Arcane::CaseOptionMultiExtended::_search(), Arcane::CaseOptionMultiSimpleT< T >::_search(), Arcane::CaseOptionSimpleT< T >::_search(), print(), and Arcane::CaseOptionSimple::xpathFullName().
| void Arcane::CaseOptionBase::search | ( | bool | is_phase1 | ) |
Retrieves the value from the configuration file for the variable.
Definition at line 186 of file CaseOptionBase.cc.
| void Arcane::CaseOptionBase::setRootElement | ( | const XmlNode & | root_element | ) |
Positions the root element at root_element.
Definition at line 294 of file CaseOptionBase.cc.
References m_p.
Referenced by print().
| ISubDomain * Arcane::CaseOptionBase::subDomain | ( | ) | const |
Sub-domain manager.
Definition at line 140 of file CaseOptionBase.cc.
References m_p.
Referenced by print().
| ITraceMng * Arcane::CaseOptionBase::traceMng | ( | ) | const |
Trace manager.
Definition at line 131 of file CaseOptionBase.cc.
References m_p.
Referenced by Arcane::CaseOptionExtended::_search(), Arcane::CaseOptionMultiExtended::_search(), and print().
Name of the option in the language lang. Returns name() if no translation exists.
Definition at line 280 of file CaseOptionBase.cc.
References m_p, and Arcane::String::null().
| String Arcane::CaseOptionBase::trueName | ( | ) | const |
Returns the true name (untranslated) of the option.
Definition at line 197 of file CaseOptionBase.cc.
References m_p.
|
pure virtual |
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.
Implemented in Arcane::CaseOptionEnum, Arcane::CaseOptionExtended, Arcane::CaseOptionMultiEnum, Arcane::CaseOptionMultiExtended, Arcane::CaseOptionMultiSimpleT< T >, Arcane::CaseOptionMultiSimpleT< Arcane::Integer >, Arcane::CaseOptionMultiSimpleT< Arcane::String >, Arcane::CaseOptionSimpleT< T >, Arcane::CaseOptionSimpleT< bool >, Arcane::CaseOptionSimpleT< BoolArray >, Arcane::CaseOptionSimpleT< Int32 >, Arcane::CaseOptionSimpleT< Int32Array >, Arcane::CaseOptionSimpleT< Int64 >, Arcane::CaseOptionSimpleT< Int64Array >, Arcane::CaseOptionSimpleT< Integer >, Arcane::CaseOptionSimpleT< IntegerArray >, Arcane::CaseOptionSimpleT< Real >, Arcane::CaseOptionSimpleT< Real2 >, Arcane::CaseOptionSimpleT< Real2Array >, Arcane::CaseOptionSimpleT< Real2x2 >, Arcane::CaseOptionSimpleT< Real2x2Array >, Arcane::CaseOptionSimpleT< Real3 >, Arcane::CaseOptionSimpleT< Real3Array >, Arcane::CaseOptionSimpleT< Real3x3 >, Arcane::CaseOptionSimpleT< Real3x3Array >, Arcane::CaseOptionSimpleT< RealArray >, Arcane::CaseOptionSimpleT< String >, and Arcane::CaseOptionSimpleT< StringArray >.
References addAlternativeNodeName(), addDefaultValue(), name(), and updateFromFunction().
Referenced by updateFromFunction().
|
pure virtual |
Applies the visitor to this option.
Implemented in Arcane::CaseOptionEnum, Arcane::CaseOptionExtended, Arcane::CaseOptionMultiEnum, Arcane::CaseOptionMultiExtended, Arcane::CaseOptionMultiSimpleT< T >, Arcane::CaseOptionMultiSimpleT< Arcane::Integer >, Arcane::CaseOptionMultiSimpleT< Arcane::String >, and Arcane::CaseOptionSimple.
References visit().
Referenced by visit().
|
private |
Implementation.
Definition at line 160 of file CaseOptionBase.h.
Referenced by _defaultValue(), addAlternativeNodeName(), addDefaultValue(), caseDocumentFragment(), caseMng(), isOptional(), maxOccurs(), minOccurs(), name(), parentOptionList(), rootElement(), setRootElement(), subDomain(), traceMng(), translatedName(), and trueName().