12#ifndef ARCANE_CORE_VARIABLEREF_H
13#define ARCANE_CORE_VARIABLEREF_H
17#include "arcane/utils/String.h"
19#include "arcane/core/IVariable.h"
20#include "arcane/core/VariableComputeFunction.h"
100 virtual void print(std::ostream& o)
const;
108 virtual int property()
const;
111 virtual int referenceProperty()
const;
114 virtual void setProperty(
int property);
117 virtual void unsetProperty(
int property);
120 virtual void registerVariable();
123 virtual void unregisterVariable();
131 virtual Integer checkIfSync(
int max_print = 0);
137 virtual Integer checkIfSameOnAllReplica(
int max_print = 0);
140 virtual void updateFromInternal();
147 void setUsed(
bool v) { m_variable->setUsed(v); }
148 bool isUsed()
const {
return m_variable->isUsed(); }
150 virtual void internalSetUsed(
bool ) {}
166 void addTag(
const String& tagname,
const String& tagvalue);
171 void removeTag(
const String& tagname);
173 bool hasTag(
const String& tagname)
const;
203 Int64 modifiedTime();
212 void addDependPreviousTime(
const VariableRef& var);
227 template <
typename ClassType>
void
240 template <
typename ClassType>
void
273 static void setTraceCreation(
bool v);
274 static bool hasTraceCreation();
329 void _executeUpdateFunctors();
331 bool m_has_trace =
false;
335 void _checkValid()
const
342 void _throwInvalid()
const;
343 bool _checkValidPropertyChanged(
int property);
344 void _setAssignmentStackTrace();
348 void _internalAssignVariable(
const VariableRef& var);
352 static bool m_static_has_trace_creation;
353 UpdateNotifyFunctorList* m_notify_functor_list =
nullptr;
367#include "arcane/core/VariableList.h"
Interface of the subdomain manager.
Interface of the functor class for recalculating a variable.
Variable manager interface.
Unicode character string.
Parameters necessary for building a variable.
Interface of the variable recalculation functor class.
Internal class to manage functors called when the variable is updated.
IModule * m_module
Associated module (or 0 if none).
VariableRef(const VariableBuildInfo &vbi)
Constructs a reference to a variable with the infos vbi.
VariableRef & operator=(const VariableRef &from)
Copy assignment operator.
bool m_is_registered
true if the variable has been registered
virtual eDataType dataType() const
Variable type (Real, Integer, ...).
VariableRef * m_previous_reference
Previous reference on m_variable.
virtual void print(std::ostream &o) const
Prints the variable value.
virtual IModule * module() const
Module associated with the variable (or nullptr, if none).
int m_reference_property
Reference properties.
String m_assignment_stack_trace
Call stack during variable assignment.
void setComputeFunction(ClassType *instance, void(ClassType::*func)(), const TraceInfo &tinfo)
Sets the variable's recalculation function.
IVariable * variable() const
Associated variable.
VariableRef * m_next_reference
Next reference on m_variable.
String name() const
Variable name.
const String & assignmentStackTrace() const
Call stack at the time of assigning this instance.
ISubDomain * subDomain() const
Sub-domain associated with the variable (TODO deprecate end of 2023).
virtual Integer arraySize() const
If the variable is an array, returns its dimension, otherwise returns 0.
void setComputeFunction(ClassType *instance, void(ClassType::*func)())
Sets the variable's recalculation function.
IVariable * m_variable
Associated variable.
IVariableMng * variableMng() const
Variable manager associated with the variable.
IVariable * _variable() const
Referenced variable.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.