Two-dimensional array variable. More...
#include <arcane/core/VariableRefArray2.h>
Public Types | |
| typedef T | DataType |
| typedef Array2< T > | ValueType |
| typedef ConstArrayView< T > | ConstReturnReferenceType |
| typedef ArrayView< T > | ReturnReferenceType |
| typedef DataType | ElementType |
| Type of the variable elements. | |
| typedef VariableRef | BaseClass |
| Type of the base class. | |
| typedef Array2< DataType > | ContainerType |
| Type of the class managing the variable value. | |
| typedef Array2View< DataType > | ArrayBase |
| Type of the array used to access the variable. | |
| typedef Array2VariableT< DataType > | PrivatePartType |
| typedef VariableRefArray2T< DataType > | ThatClass |
Public Member Functions | |
| VariableRefArray2T (const VariableBuildInfo &vb) | |
| Constructs a reference to a 2D array variable specified in vb. | |
| VariableRefArray2T (const VariableRefArray2T< DataType > &rhs) | |
| Constructs a reference from rhs. | |
| VariableRefArray2T (IVariable *var) | |
| Constructs a reference from var. | |
| void | operator= (const VariableRefArray2T< DataType > &rhs) |
| Copy assignment operator. | |
| virtual | ~VariableRefArray2T () |
| Frees resources. | |
| virtual void | resize (Integer new_size) |
| Reallocates the number of elements in the first dimension of the array. | |
| void | resize (Integer dim1_size, Integer dim2_size) |
| Reallocates the number of elements in the array. | |
| void | fill (const DataType &value) |
| Fills the variable with the value value. | |
| void | refersTo (const VariableRefArray2T< DataType > &rhs) |
| Positions the instance 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. | |
| Integer | size () const |
| virtual void | updateFromInternal () |
| Updates from the internal part. | |
| ContainerType & | internalContainer () |
| Returns the container of the variable's values. | |
| IArray2DataInternalT< T > * | _internalTrueData () |
| 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) |
| Public Member Functions inherited from Arcane::Array2View< T > | |
| constexpr | Array2View (T *ptr, Integer dim1_size, Integer dim2_size) |
| Creates a 2D view of dimension [dim1_size][dim2_size]. | |
| constexpr | Array2View () |
| Creates an empty 2D view. | |
| constexpr Integer | dim1Size () const |
| Number of elements in the first dimension. | |
| constexpr Integer | dim2Size () const |
| Number of elements in the second dimension. | |
| constexpr Integer | totalNbElement () const |
| Total number of elements. | |
| constexpr ArrayView< T > | operator[] (Integer i) |
| constexpr ConstArrayView< T > | operator[] (Integer i) const |
| constexpr T | item (Integer i, Integer j) const |
| Value of element [i][j]. | |
| constexpr T | setItem (Integer i, Integer j, const T &value) |
| Positions element [i][j] to value. | |
| constexpr const T | operator() (Integer i, Integer j) const |
| Value of element [i][j]. | |
| constexpr T & | operator() (Integer i, Integer j) |
| Value of element [i][j]. | |
| constexpr T * | unguardedBasePointer () |
| Pointer to the allocated memory. | |
| constexpr T * | data () |
| Pointer to the allocated memory. | |
| constexpr | Array2View (T *ptr, Integer dim1_size, Integer dim2_size) |
| Creates a 2D view of dimension [dim1_size][dim2_size]. | |
| constexpr | Array2View () |
| Creates an empty 2D view. | |
| constexpr Integer | dim1Size () const |
| Number of elements in the first dimension. | |
| constexpr Integer | dim2Size () const |
| Number of elements in the second dimension. | |
| constexpr Integer | totalNbElement () const |
| Total number of elements. | |
| constexpr ArrayView< T > | operator[] (Integer i) |
| constexpr ConstArrayView< T > | operator[] (Integer i) const |
| constexpr T | item (Integer i, Integer j) const |
| Value of element [i][j]. | |
| constexpr T | setItem (Integer i, Integer j, const T &value) |
| Positions element [i][j] to value. | |
| constexpr const T | operator() (Integer i, Integer j) const |
| Value of element [i][j]. | |
| constexpr T & | operator() (Integer i, Integer j) |
| Value of element [i][j]. | |
| constexpr T * | unguardedBasePointer () |
| Pointer to the allocated memory. | |
| constexpr T * | data () |
| Pointer to the allocated memory. | |
Static Public Member Functions | |
| static VariableTypeInfo | _internalVariableTypeInfo () |
| static VariableInfo | _internalVariableInfo (const VariableBuildInfo &vbi) |
| static void | setTraceCreation (bool v) |
| static bool | hasTraceCreation () |
Additional Inherited Members | |
| 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) |
| bool | m_has_trace = false |
Two-dimensional array variable.
This variable manages classic 2D arrays.
Definition at line 35 of file VariableRefArray2.h.
| typedef Array2View<DataType> Arcane::VariableRefArray2T< T >::ArrayBase |
Type of the array used to access the variable.
Definition at line 53 of file VariableRefArray2.h.
| typedef VariableRef Arcane::VariableRefArray2T< T >::BaseClass |
Type of the base class.
Definition at line 49 of file VariableRefArray2.h.
| typedef ConstArrayView<T> Arcane::VariableRefArray2T< T >::ConstReturnReferenceType |
Definition at line 43 of file VariableRefArray2.h.
| typedef Array2<DataType> Arcane::VariableRefArray2T< T >::ContainerType |
Type of the class managing the variable value.
Definition at line 51 of file VariableRefArray2.h.
| typedef T Arcane::VariableRefArray2T< T >::DataType |
Definition at line 41 of file VariableRefArray2.h.
| typedef DataType Arcane::VariableRefArray2T< T >::ElementType |
Type of the variable elements.
Definition at line 47 of file VariableRefArray2.h.
| typedef Array2VariableT<DataType> Arcane::VariableRefArray2T< T >::PrivatePartType |
Definition at line 55 of file VariableRefArray2.h.
| typedef ArrayView<T> Arcane::VariableRefArray2T< T >::ReturnReferenceType |
Definition at line 44 of file VariableRefArray2.h.
| typedef VariableRefArray2T<DataType> Arcane::VariableRefArray2T< T >::ThatClass |
Definition at line 57 of file VariableRefArray2.h.
| typedef Array2<T> Arcane::VariableRefArray2T< T >::ValueType |
Definition at line 42 of file VariableRefArray2.h.
| Arcane::VariableRefArray2T< DataType >::VariableRefArray2T | ( | const VariableBuildInfo & | vb | ) |
Constructs a reference to a 2D array variable specified in vb.
Definition at line 75 of file VariableRefArray2.cc.
References Arcane::VariableRef::_internalInit(), and Arcane::VariableRef::VariableRef().
Referenced by operator=(), refersTo(), and VariableRefArray2T().
| Arcane::VariableRefArray2T< DataType >::VariableRefArray2T | ( | const VariableRefArray2T< DataType > & | rhs | ) |
Constructs a reference from rhs.
Definition at line 87 of file VariableRefArray2.cc.
References Arcane::Array2View< T >::Array2View(), updateFromInternal(), Arcane::VariableRef::VariableRef(), and VariableRefArray2T().
|
explicit |
Constructs a reference from var.
Definition at line 99 of file VariableRefArray2.cc.
References Arcane::VariableRef::_internalInit(), and Arcane::VariableRef::VariableRef().
|
virtual |
Frees resources.
Definition at line 122 of file VariableRefArray2.cc.
| IArray2DataInternalT< T > * Arcane::VariableRefArray2T< T >::_internalTrueData | ( | ) |
Definition at line 192 of file VariableRefArray2.cc.
|
static |
Definition at line 53 of file VariableRefArray2.cc.
|
static |
Definition at line 43 of file VariableRefArray2.cc.
|
inlinevirtual |
If the variable is an array, returns its dimension, otherwise returns 0.
Reimplemented from Arcane::VariableRef.
Definition at line 103 of file VariableRefArray2.h.
| void Arcane::VariableRefArray2T< DataType >::fill | ( | const DataType & | value | ) |
Fills the variable with the value value.
Definition at line 163 of file VariableRefArray2.cc.
| auto Arcane::VariableRefArray2T< T >::internalContainer | ( | ) |
Returns the container of the variable's values.
Calling this method is only possible for private variables (PPrivate property).
Definition at line 182 of file VariableRefArray2.cc.
|
inlinevirtual |
Definition at line 102 of file VariableRefArray2.h.
| void Arcane::VariableRefArray2T< DataType >::operator= | ( | const VariableRefArray2T< DataType > & | rhs | ) |
Copy assignment operator.
Definition at line 111 of file VariableRefArray2.cc.
References Arcane::VariableRef::operator=(), updateFromInternal(), and VariableRefArray2T().
| void Arcane::VariableRefArray2T< DataType >::refersTo | ( | const VariableRefArray2T< DataType > & | rhs | ) |
Positions the instance reference to the variable rhs.
Definition at line 131 of file VariableRefArray2.cc.
References Arcane::VariableRef::operator=(), updateFromInternal(), and VariableRefArray2T().
| void Arcane::VariableRefArray2T< DataType >::resize | ( | Integer | dim1_size, |
| Integer | dim2_size ) |
Reallocates the number of elements in the array.
Reallocates the array with dim1_size as the size of the first dimension and dim2_size as the size of the second.
Definition at line 153 of file VariableRefArray2.cc.
|
virtual |
Reallocates the number of elements in the first dimension of the array.
The number of elements in the second dimension is set to zero.
Definition at line 143 of file VariableRefArray2.cc.
|
inline |
Definition at line 104 of file VariableRefArray2.h.
|
virtual |
Updates from the internal part.
Reimplemented from Arcane::VariableRef.
Definition at line 172 of file VariableRefArray2.cc.
References Arcane::VariableRef::updateFromInternal().
Referenced by operator=(), refersTo(), and VariableRefArray2T().