Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::IVariableMng Class Referenceabstract

Variable manager interface. More...

#include <arcane/core/IVariableMng.h>

Public Member Functions

virtual ~IVariableMng ()=default
 Frees resources.
virtual ISubDomainsubDomain ()=0
 Sub-domain manager.
virtual IParallelMngparallelMng () const =0
 Associated parallelism manager.
virtual ITraceMngtraceMng ()=0
 Message manager.
virtual IVariablecheckVariable (const VariableInfo &infos)=0
 Checks a variable.
virtual String generateTemporaryVariableName ()=0
 Generates a name for a temporary variable.
virtual void dumpList (std::ostream &, IModule *)=0
 Displays the list of variables managed by a module.
virtual void dumpList (std::ostream &)=0
 Displays the list of all variables managed by the manager.
virtual Real exportSize (const VariableCollection &vars)=0
 Estimated size for exporting variables.
virtual IObservablewriteObservable ()=0
 Observable for variables being written.
virtual IObservablereadObservable ()=0
 Observable for variables being read.
virtual void writeVariables (IDataWriter *writer, IVariableFilter *filter=0)=0
 Writes the variables.
virtual void writeVariables (IDataWriter *writer, const VariableCollection &vars)=0
 Exports the variables.
virtual void writeCheckpoint (ICheckpointWriter *writer)=0
virtual void writePostProcessing (IPostProcessorWriter *writer)=0
 Writes variables for post-processing.
virtual void readVariables (IDataReader *reader, IVariableFilter *filter=0)=0
 Reads all variables.
virtual void readCheckpoint (ICheckpointReader *reader)=0
virtual void readCheckpoint (const CheckpointReadInfo &infos)=0
virtual void variables (VariableRefCollection v, IModule *i)=0
 Gets all variables of module i.
virtual VariableCollection variables ()=0
 List of variables.
virtual VariableCollection usedVariables ()=0
 List of used variables.
virtual void notifyUsedVariableChanged ()=0
 Notifies the manager that a variable's state has changed.
virtual IVariablefindVariable (const String &name)=0
 Returns the variable named name or 0 if no such name exists.
virtual IVariablefindMeshVariable (IMesh *mesh, const String &name)=0
 Returns the mesh variable named name or 0 if no such name exists.
virtual IVariablefindVariableFullyQualified (const String &name)=0
 Returns the fully qualified variable named name or 0 if no such name exists.
virtual void dumpStats (std::ostream &ostr, bool is_verbose)=0
 Writes statistics about variables to the stream ostr.
virtual void dumpStatsJSON (JSONWriter &writer)=0
 Writes statistics with the writer writer.
virtual IVariableUtilitiesutilities () const =0
 Interface of associated utility functions.
virtual IVariableSynchronizerMngsynchronizerMng () const =0
 Interface of the variable synchronization manager.
Events
virtual EventObservable< const VariableStatusChangedEventArgs & > & onVariableAdded ()=0
 Event sent when a variable is created.
virtual EventObservable< const VariableStatusChangedEventArgs & > & onVariableRemoved ()=0
 Event sent when a variable is destroyed.
virtual void build ()=0
 Constructs the instance members.
virtual void initialize ()=0
 Initializes the instance. The instance is not usable until this method has been called.
virtual void removeAllVariables ()=0
 Removes and destroys the variables managed by this manager.
virtual void detachMeshVariables (IMesh *mesh)=0
 Detaches variables associated with the mesh mesh.
virtual void addVariableRef (VariableRef *var)=0
 Adds a reference to a variable.
virtual void removeVariableRef (VariableRef *var)=0
 Removes a reference to a variable.
virtual void addVariable (IVariable *var)=0
 Adds a variable.
virtual void removeVariable (IVariable *var)=0
 Removes a variable.
virtual void initializeVariables (bool is_continue)=0
 Initializes the variables.
virtual ISubDomain_internalSubDomain () const =0
virtual IVariableMngInternal * _internalApi ()=0
 Internal Arcane API.

Detailed Description

Variable manager interface.

This manager contains the list of variables declared in the associated sub-domain subDomain(). It maintains the list of variables and allows them to be read or written.

Definition at line 57 of file IVariableMng.h.

Member Function Documentation

◆ addVariable()

virtual void Arcane::IVariableMng::addVariable ( IVariable * var)
pure virtual

Adds a variable.

Adds the variable var.

The validity of the variable is not checked (void checkVariable()).

Precondition
var != 0
var must not already be referenced.
Returns
the implementation associated with var.

References addVariable().

Referenced by addVariable().

◆ addVariableRef()

virtual void Arcane::IVariableMng::addVariableRef ( VariableRef * var)
pure virtual

Adds a reference to a variable.

Adds the reference var to the manager.

Precondition
var != 0
var must not already be referenced.
Returns
the implementation associated with var.

References addVariableRef().

Referenced by addVariableRef().

◆ build()

virtual void Arcane::IVariableMng::build ( )
pure virtual

Constructs the instance members.

The instance is not usable until this method has been called. This method must be called before initialize().

Warning
This method must only be called once.

References build().

Referenced by build().

◆ checkVariable()

virtual IVariable * Arcane::IVariableMng::checkVariable ( const VariableInfo & infos)
pure virtual

Checks a variable.

Checks that the variable named name characterized by infos is valid. This is true if and only if:

  • no variable named infos.name() already exists.
  • a variable named infos.name() exists and its type and kind match infos.

If the variable is not valid, an exception is thrown.

This operation is used when you want to create a new reference to a variable and ensure that it will be valid.

Exceptions
ExBadVariableKindTypeif the variable named infos.name() exists and its type and kind do not match those of infos.
Returns
the variable named infos.name() if it exists, 0 otherwise

References checkVariable().

Referenced by checkVariable().

◆ exportSize()

virtual Real Arcane::IVariableMng::exportSize ( const VariableCollection & vars)
pure virtual

Estimated size for exporting variables.

This operation estimates the number of megabytes that the exportation of variables vars will generate. If vars is empty, the estimation is based on all referenced variables.

The estimation only takes into account the memory used by the variables and not the writer used.

The estimation is local to the sub-domain. To obtain the total size of an export, you must determine the size per sub-domain and sum them up.

This method is collective

References exportSize().

Referenced by exportSize().

◆ generateTemporaryVariableName()

virtual String Arcane::IVariableMng::generateTemporaryVariableName ( )
pure virtual

Generates a name for a temporary variable.

To ensure the consistency of this name, all sub-domains must call this function.

References generateTemporaryVariableName().

Referenced by generateTemporaryVariableName().

◆ initialize()

virtual void Arcane::IVariableMng::initialize ( )
pure virtual

Initializes the instance. The instance is not usable until this method has been called.

Warning
This method must only be called once.

References initialize().

Referenced by initialize().

◆ initializeVariables()

virtual void Arcane::IVariableMng::initializeVariables ( bool is_continue)
pure virtual

Initializes the variables.

Iterates through the list of variables and initializes them. Only variables of a used module are initialized.

Parameters
is_continuetrue if resuming.

References initializeVariables().

Referenced by initializeVariables().

◆ readObservable()

virtual IObservable * Arcane::IVariableMng::readObservable ( )
pure virtual

Observable for variables being read.

Observers registered in this observable are called after reading variables (operation readVariables() or readCheckpoint()).

References readObservable().

Referenced by readObservable().

◆ readVariables()

virtual void Arcane::IVariableMng::readVariables ( IDataReader * reader,
IVariableFilter * filter = 0 )
pure virtual

Reads all variables.

Iterates through all variables managed by the manager and applies the reader reader to them. If filter is not null, it is applied to each variable and a variable is read only if the filter is true for that variable. Variables that are not read are not modified by this operation.

Deprecated
Use readVariable(IDataReader*)

This method is collective.

References readVariables().

Referenced by readVariables().

◆ removeVariable()

virtual void Arcane::IVariableMng::removeVariable ( IVariable * var)
pure virtual

Removes a variable.

Removes the variable var.

After calling this method, the variable must no longer be used.

Precondition
var != 0
var must have a single reference.

References removeVariable().

Referenced by removeVariable().

◆ removeVariableRef()

virtual void Arcane::IVariableMng::removeVariableRef ( VariableRef * var)
pure virtual

Removes a reference to a variable.

Removes the reference var from the manager.

If var is not referenced by the manager, nothing is done.

Precondition
var != 0

References removeVariableRef().

Referenced by removeVariableRef().

◆ writeObservable()

virtual IObservable * Arcane::IVariableMng::writeObservable ( )
pure virtual

Observable for variables being written.

Observers registered in this observable are called before writing variables (operation writeCheckpoint(), writeVariables() or writePostProcessing()).

References writeObservable().

Referenced by writeObservable().

◆ writePostProcessing()

virtual void Arcane::IVariableMng::writePostProcessing ( IPostProcessorWriter * writer)
pure virtual

Writes variables for post-processing.

Uses the post-processing service writer to write the variables. The caller must have positioned the fields of writer before this call, notably the list of variables to be post-processed. This method calls IPostProcessorWriter::notifyBeginWrite() before writing and IPostProcessorWriter::notifyEndWriter() at the end.

This method is collective.

References writePostProcessing().

Referenced by writePostProcessing().

◆ writeVariables() [1/2]

virtual void Arcane::IVariableMng::writeVariables ( IDataWriter * writer,
const VariableCollection & vars )
pure virtual

Exports the variables.

Exports the variables in the list vars. If vars is empty, it exports all variables in the base that are used.

References writeVariables().

◆ writeVariables() [2/2]

virtual void Arcane::IVariableMng::writeVariables ( IDataWriter * writer,
IVariableFilter * filter = 0 )
pure virtual

Writes the variables.

Iterates through all variables managed by the manager and applies the writer writer to them. If filter is not null, it is applied to each variable and a variable is written only if the filter is true for that variable.

This method is collective

References writeVariables().

Referenced by writeVariables(), and writeVariables().


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