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

Base class for a data set option. More...

#include <arcane/core/CaseOptionBase.h>

Inheritance diagram for Arcane::CaseOptionBase:
Collaboration diagram for Arcane::CaseOptionBase:

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.
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.
virtual ICaseFunctionfunction () 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

CaseOptionBasePrivatem_p
 Implementation.

Detailed Description

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.

Constructor & Destructor Documentation

◆ CaseOptionBase() [1/2]

Arcane::CaseOptionBase::CaseOptionBase ( const CaseOptionBuildInfo & cob)
protected

Definition at line 94 of file CaseOptionBase.cc.

◆ ~CaseOptionBase()

Arcane::CaseOptionBase::~CaseOptionBase ( )
virtual

Definition at line 104 of file CaseOptionBase.cc.

◆ CaseOptionBase() [2/2]

Arcane::CaseOptionBase::CaseOptionBase ( const CaseOptionBase & from)
privatedelete

Copy constructor.

The copy constructor is private because the option should not be copied, notably due to the ICaseFunction which is unique.

Member Function Documentation

◆ _checkIsInitialized()

void Arcane::CaseOptionBase::_checkIsInitialized ( ) const
protected

Definition at line 348 of file CaseOptionBase.cc.

◆ _checkMinMaxOccurs()

void Arcane::CaseOptionBase::_checkMinMaxOccurs ( Integer nb_occur)
protected

Definition at line 359 of file CaseOptionBase.cc.

◆ _defaultValue()

String Arcane::CaseOptionBase::_defaultValue ( ) const
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().

Here is the caller graph for this function:

◆ _isInitialized()

bool Arcane::CaseOptionBase::_isInitialized ( ) const
protected

Definition at line 339 of file CaseOptionBase.cc.

◆ _search()

◆ _setCategoryDefaultValue()

void Arcane::CaseOptionBase::_setCategoryDefaultValue ( )
private

Definition at line 260 of file CaseOptionBase.cc.

◆ _setDefaultValue()

void Arcane::CaseOptionBase::_setDefaultValue ( const String & def_value)
protected

Definition at line 176 of file CaseOptionBase.cc.

◆ _setIsInitialized()

void Arcane::CaseOptionBase::_setIsInitialized ( )
protected

Definition at line 330 of file CaseOptionBase.cc.

◆ _setTranslatedName()

void Arcane::CaseOptionBase::_setTranslatedName ( )
private

Definition at line 242 of file CaseOptionBase.cc.

◆ _xpathFullName()

String Arcane::CaseOptionBase::_xpathFullName ( ) const
protected

Definition at line 400 of file CaseOptionBase.cc.

◆ addAlternativeNodeName()

void Arcane::CaseOptionBase::addAlternativeNodeName ( const String & lang,
const String & name )

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.

References m_p, and name().

Referenced by updateFromFunction().

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

◆ addDefaultValue()

void Arcane::CaseOptionBase::addDefaultValue ( const String & category,
const String & value )

Adds the default value value to the category category.

Definition at line 321 of file CaseOptionBase.cc.

References m_p.

Referenced by updateFromFunction().

Here is the caller graph for this function:

◆ caseDocument()

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().

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

◆ caseDocumentFragment()

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().

Here is the caller graph for this function:

◆ caseMng()

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().

Here is the caller graph for this function:

◆ checkIsInitialized()

void Arcane::CaseOptionBase::checkIsInitialized ( ) const
inline

Throws an exception if the option has not been initialized.

Definition at line 140 of file CaseOptionBase.h.

References checkIsInitialized().

Referenced by checkIsInitialized().

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

◆ function()

virtual ICaseFunction * Arcane::CaseOptionBase::function ( ) const
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().

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

◆ isOptional()

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().

Here is the caller graph for this function:

◆ maxOccurs()

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().

Here is the caller graph for this function:

◆ minOccurs()

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().

Here is the caller graph for this function:

◆ name()

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().

Here is the caller graph for this function:

◆ parentOptionList()

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().

Here is the caller graph for this function:

◆ print()

virtual void Arcane::CaseOptionBase::print ( const String & lang,
std::ostream & o ) const
pure virtual

◆ rootElement()

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().

Here is the caller graph for this function:

◆ search()

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.

◆ setRootElement()

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().

Here is the caller graph for this function:

◆ subDomain()

ISubDomain * Arcane::CaseOptionBase::subDomain ( ) const

Sub-domain manager.

Definition at line 140 of file CaseOptionBase.cc.

References m_p.

Referenced by print().

Here is the caller graph for this function:

◆ traceMng()

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().

Here is the caller graph for this function:

◆ translatedName()

String Arcane::CaseOptionBase::translatedName ( const String & lang) const

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().

Here is the call graph for this function:

◆ trueName()

String Arcane::CaseOptionBase::trueName ( ) const

Returns the true name (untranslated) of the option.

Definition at line 197 of file CaseOptionBase.cc.

References m_p.

◆ updateFromFunction()

virtual void Arcane::CaseOptionBase::updateFromFunction ( Real current_time,
Integer current_iteration )
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().

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

◆ visit()

virtual void Arcane::CaseOptionBase::visit ( ICaseDocumentVisitor * visitor) const
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().

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

Member Data Documentation

◆ m_p


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