Reference to a scalar variable. More...
#include <arcane/core/VariableRefScalar.h>
Public Types | |
| typedef DataType | ElementType |
| Type of the variable elements. | |
| typedef VariableRef | BaseClass |
| Type of the base class. | |
| typedef VariableScalarT< DataType > | PrivatePartType |
| typedef VariableRefScalarT< DataType > | ThatClass |
Public Member Functions | |
| VariableRefScalarT (const VariableBuildInfo &b) | |
| Constructs a reference to a scalar variable specified in vb. | |
| VariableRefScalarT (const VariableRefScalarT< DataType > &rhs) | |
| Constructs a reference from rhs. | |
| VariableRefScalarT (IVariable *var) | |
| Constructs a reference from var. | |
| void | refersTo (const VariableRefScalarT< DataType > &rhs) |
| Positions the instance's reference to the variable rhs. | |
| virtual bool | isArrayVariable () const |
| virtual Integer | arraySize () const |
| If the variable is an array, returns its dimension, otherwise returns 0. | |
| virtual void | updateFromInternal () |
| Updates from the internal part. | |
| ArrayView< DataType > | asArray () |
| ConstArrayView< DataType > | asArray () const |
| void | operator= (const DataType &v) |
| VariableRefScalarT< DataType > & | operator= (const VariableRefScalarT< DataType > &v) |
| void | reset () |
| Resets the variable to its default value. | |
| const DataType & | operator() () const |
| Scalar value. | |
| const DataType & | value () const |
| Scalar value. | |
| bool | isEqual (const DataType &v) const |
| Compares the variable with the value v. | |
| bool | isZero () const |
| Compares the variable with the value 0. | |
| bool | isNearlyEqual (const DataType &v) const |
| Compares the variable with the value v. | |
| bool | isNearlyZero () const |
| Compares the variable with the value 0. | |
| void | assign (const DataType &v) |
| Assigns the value v to the variable. | |
| void | reduce (Parallel::eReduceType type) |
| Performs a type type reduction on the variable. | |
| void | swapValues (VariableRefScalarT< DataType > &rhs) |
| Exchange the values of variable rhs with those of the instance. | |
| Public Member Functions inherited from Arcane::VariableRef | |
| virtual | ~VariableRef () |
| Releases resources. | |
| ISubDomain * | subDomain () const |
| Sub-domain associated with the variable (TODO deprecate end of 2023). | |
| IVariableMng * | variableMng () const |
| Variable manager associated with the variable. | |
| String | name () const |
| Variable name. | |
| virtual eDataType | dataType () const |
| Variable type (Real, Integer, ...). | |
| virtual void | print (std::ostream &o) const |
| Prints the variable value. | |
| virtual IModule * | module () const |
| Module associated with the variable (or nullptr, if none). | |
| virtual int | property () const |
| Variable properties. | |
| virtual int | referenceProperty () const |
| Reference properties (internal). | |
| virtual void | setProperty (int property) |
| Sets the property property. | |
| virtual void | unsetProperty (int property) |
| Unsets the property property. | |
| virtual void | registerVariable () |
| Registers the variable (internal). | |
| virtual void | unregisterVariable () |
| Unregisters the variable (internal). | |
| IVariable * | variable () const |
| Associated variable. | |
| virtual Integer | checkIfSync (int max_print=0) |
| Checks if the variable is synchronized. | |
| virtual Integer | checkIfSameOnAllReplica (int max_print=0) |
| Checks if the variable has the same values on all replicas. | |
| void | setUsed (bool v) |
| bool | isUsed () const |
| virtual void | internalSetUsed (bool) |
| const String & | assignmentStackTrace () const |
| Call stack at the time of assigning this instance. | |
| void | addTag (const String &tagname, const String &tagvalue) |
| Adds the tag tagname with the value tagvalue. | |
| void | removeTag (const String &tagname) |
| Removes the tag tagname. | |
| bool | hasTag (const String &tagname) const |
| true if the variable has the tag tagname | |
| String | tagValue (const String &tagname) const |
| Value of the tag tagname. The string is null if the tag does not exist. | |
| void | update () |
| Recalculates the variable if necessary. | |
| void | setUpToDate () |
| Indicates that the variable has just been updated. | |
| Int64 | modifiedTime () |
| Time when the variable was updated. | |
| void | addDependCurrentTime (const VariableRef &var) |
| Adds var to the dependency list at the current time. | |
| void | addDependCurrentTime (const VariableRef &var, const TraceInfo &tinfo) |
| Adds var to the dependency list at the current time with trace info tinfo. | |
| void | addDependPreviousTime (const VariableRef &var) |
| Adds var to the dependency list at the previous time. | |
| void | addDependPreviousTime (const VariableRef &var, const TraceInfo &tinfo) |
| Adds var to the dependency list at the previous time with trace info tinfo. | |
| void | removeDepend (const VariableRef &var) |
| Removes var from the dependency list. | |
| template<typename ClassType> | |
| void | setComputeFunction (ClassType *instance, void(ClassType::*func)()) |
| Sets the variable's recalculation function. | |
| template<typename ClassType> | |
| void | setComputeFunction (ClassType *instance, void(ClassType::*func)(), const TraceInfo &tinfo) |
| Sets the variable's recalculation function. | |
| VariableRef * | previousReference () |
| Previous reference (or null) to variable(). | |
| VariableRef * | nextReference () |
| Next reference (or null) to variable(). | |
| void | setPreviousReference (VariableRef *v) |
| void | setNextReference (VariableRef *v) |
Protected Member Functions | |
| VariableRefScalarT () | |
| Default constructor. | |
| Protected Member Functions inherited from Arcane::VariableRef | |
| VariableRef (const VariableBuildInfo &vbi) | |
| Constructs a reference to a variable with the infos vbi. | |
| VariableRef (const VariableRef &from) | |
| Copy constructor. | |
| VariableRef (IVariable *var) | |
| Constructs a reference to a variable var. | |
| VariableRef & | operator= (const VariableRef &from) |
| Copy assignment operator. | |
| VariableRef () | |
| Default constructor. | |
| void | _setComputeFunction (IVariableComputeFunction *v) |
| void | _internalInit (IVariable *) |
| Internal initialization of the variable. | |
| IVariable * | _variable () const |
| Referenced variable. | |
| void | _executeUpdateFunctors () |
| void | _internalAssignVariable (const VariableRef &var) |
Additional Inherited Members | |
| static void | setTraceCreation (bool v) |
| static bool | hasTraceCreation () |
| bool | m_has_trace = false |
Reference to a scalar variable.
The operator operator()() allows access to the variable's value for read-only purposes. To modify the variable's value, you must use the assign() method or the operator operator=(). Note that assignment triggers a reference update and can be costly.
Definition at line 41 of file VariableRefScalar.h.
| typedef VariableRef Arcane::VariableRefScalarT< DataType >::BaseClass |
Type of the base class.
Definition at line 49 of file VariableRefScalar.h.
| typedef DataType Arcane::VariableRefScalarT< DataType >::ElementType |
Type of the variable elements.
Definition at line 47 of file VariableRefScalar.h.
| typedef VariableScalarT<DataType> Arcane::VariableRefScalarT< DataType >::PrivatePartType |
Definition at line 51 of file VariableRefScalar.h.
| typedef VariableRefScalarT<DataType> Arcane::VariableRefScalarT< DataType >::ThatClass |
Definition at line 53 of file VariableRefScalar.h.
|
explicit |
Constructs a reference to a scalar variable specified in vb.
Definition at line 72 of file VariableRefScalar.cc.
References Arcane::VariableRef::_internalInit(), and Arcane::VariableRef::VariableRef().
Referenced by refersTo(), swapValues(), and VariableRefScalarT().
| Arcane::VariableRefScalarT< DataType >::VariableRefScalarT | ( | const VariableRefScalarT< DataType > & | rhs | ) |
Constructs a reference from rhs.
Definition at line 96 of file VariableRefScalar.cc.
References updateFromInternal(), Arcane::VariableRef::VariableRef(), and VariableRefScalarT().
|
explicit |
Constructs a reference from var.
Definition at line 84 of file VariableRefScalar.cc.
References Arcane::VariableRef::_internalInit(), and Arcane::VariableRef::VariableRef().
|
inlineprotected |
Default constructor.
Definition at line 74 of file VariableRefScalar.h.
|
inlinevirtual |
If the variable is an array, returns its dimension, otherwise returns 0.
Reimplemented from Arcane::VariableRef.
Definition at line 81 of file VariableRefScalar.h.
|
inline |
Definition at line 86 of file VariableRefScalar.h.
|
inline |
Definition at line 87 of file VariableRefScalar.h.
| void Arcane::VariableRefScalarT< DataType >::assign | ( | const DataType & | v | ) |
Assigns the value v to the variable.
Definition at line 120 of file VariableRefScalar.cc.
Referenced by reduce(), and Arcane::VariableRefScalarT< Byte >::reset().
|
inlinevirtual |
Definition at line 80 of file VariableRefScalar.h.
|
inline |
Compares the variable with the value v.
Definition at line 110 of file VariableRefScalar.h.
|
inline |
Compares the variable with the value v.
For a floating-point type, the comparison is done within an epsilon, defined in float_info<T>::nearlyEpsilon().
Definition at line 130 of file VariableRefScalar.h.
|
inline |
Compares the variable with the value 0.
Definition at line 138 of file VariableRefScalar.h.
|
inline |
Compares the variable with the value 0.
Definition at line 119 of file VariableRefScalar.h.
|
inline |
Scalar value.
Definition at line 102 of file VariableRefScalar.h.
|
inline |
Definition at line 91 of file VariableRefScalar.h.
|
inline |
Definition at line 92 of file VariableRefScalar.h.
| void Arcane::VariableRefScalarT< DataType >::reduce | ( | Parallel::eReduceType | type | ) |
Performs a type type reduction on the variable.
Definition at line 149 of file VariableRefScalar.cc.
References assign(), and Arcane::VariableRef::variableMng().
| void Arcane::VariableRefScalarT< DataType >::refersTo | ( | const VariableRefScalarT< DataType > & | rhs | ) |
Positions the instance's reference to the variable rhs.
Definition at line 108 of file VariableRefScalar.cc.
References Arcane::VariableRef::operator=(), updateFromInternal(), and VariableRefScalarT().
|
inline |
Resets the variable to its default value.
Definition at line 99 of file VariableRefScalar.h.
| void Arcane::VariableRefScalarT< DataType >::swapValues | ( | VariableRefScalarT< DataType > & | rhs | ) |
Exchange the values of variable rhs with those of the instance.
Definition at line 175 of file VariableRefScalar.cc.
References VariableRefScalarT().
|
virtual |
Updates from the internal part.
Reimplemented from Arcane::VariableRef.
Definition at line 162 of file VariableRefScalar.cc.
References Arcane::VariableRef::updateFromInternal().
Referenced by refersTo(), and VariableRefScalarT().
|
inline |
Scalar value.
Definition at line 105 of file VariableRefScalar.h.