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

Interface of a data item. More...

#include <arcane/core/IData.h>

Inheritance diagram for Arcane::IData:
Collaboration diagram for Arcane::IData:

Public Member Functions

virtual eDataType dataType () const =0
 Data type.
virtual Integer dimension () const =0
 Dimension. 0 for a scalar, 1 for a mono-dim array, 2 for a bi-dim array.
virtual Integer multiTag () const =0
 Multi-tag. 0 if not multiple, 1 if multiple, 2 if multiple for MultiArray variables (obsolete).
virtual IDataclone ()=0
 Clone the data. The created instance must be destroyed by the 'delete' operator.
virtual IDatacloneEmpty ()=0
 Clone the data but without elements. The created instance must be destroyed by the 'delete' operator.
virtual Ref< IDatacloneRef ()=0
 Clone the data.
virtual Ref< IDatacloneEmptyRef ()=0
 Clone the data but without elements.
virtual DataStorageTypeInfo storageTypeInfo () const =0
 Information about the data container type.
virtual void serialize (ISerializer *sbuf, IDataOperation *operation)=0
 Serializes the data by applying the operation.
virtual void resize (Integer new_size)=0
 Resize the data.
virtual void serialize (ISerializer *sbuf, Int32ConstArrayView ids, IDataOperation *operation)=0
 Serialize the data for the indices ids.
virtual void fillDefault ()=0
 Fills the data with its default value.
virtual void setName (const String &name)=0
 Sets the name of the data (internal).
virtual Ref< ISerializedDatacreateSerializedDataRef (bool use_basic_type) const =0
 Serialize the data.
virtual void assignSerializedData (const ISerializedData *sdata)=0
 Assign the serialized values sdata to the data.
virtual void allocateBufferForSerializedData (ISerializedData *sdata)=0
 Allocate memory to read the serialized values sdata.
virtual void copy (const IData *data)=0
 Copy the data data into the current instance.
virtual void swapValues (IData *data)=0
 Swap the values of data with those of the instance.
virtual void computeHash (IHashAlgorithm *algo, ByteArray &output) const =0
 Compute a hash key on this data.
virtual ArrayShape shape () const =0
 Array shape for a 1D or 2D data item.
virtual void setShape (const ArrayShape &new_shape)=0
 Sets the array shape.
virtual void setAllocationInfo (const DataAllocationInfo &v)=0
 Sets the allocation information.
virtual DataAllocationInfo allocationInfo () const =0
 Allocation information.
virtual void visit (IDataVisitor *visitor)=0
 Applies the visitor to the data.
virtual void visitScalar (IScalarDataVisitor *visitor)=0
 Apply the visitor to the data.
virtual void visitArray (IArrayDataVisitor *visitor)=0
 Apply the visitor to the data.
virtual void visitArray2 (IArray2DataVisitor *visitor)=0
 Apply the visitor to the data.
virtual void visitMultiArray2 (IMultiArray2DataVisitor *visitor)
 Apply the visitor to the data.
virtual IDataInternal_commonInternal ()=0

Private Member Functions

 ARCCORE_DECLARE_REFERENCE_COUNTED_INCLASS_METHODS ()

Detailed Description

Interface of a data item.

This class manages the memory associated with a variable.

Definition at line 33 of file IData.h.

Member Function Documentation

◆ _commonInternal()

virtual IDataInternal * Arcane::IData::_commonInternal ( )
pure virtual

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References _commonInternal().

Referenced by Arcane::VariableIOReaderMng::_checkHashFunction(), _commonInternal(), Arcane::VariablePrivate::computeComparisonHashCollective(), Arcane::VariableUtilsInternal::getDataInternal(), Arcane::VariableUtils::prefetchVariableAsync(), Arcane::VariableUtilsInternal::setFromMemoryBuffer(), and Arcane::VariableSynchronizer::synchronizeData().

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

◆ allocateBufferForSerializedData()

virtual void Arcane::IData::allocateBufferForSerializedData ( ISerializedData * sdata)
pure virtual

Allocate memory to read the serialized values sdata.

This method sets sdata->setBuffer(), which will contain the memory needed to read the serialized data.

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References allocateBufferForSerializedData().

Referenced by allocateBufferForSerializedData().

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

◆ allocationInfo()

virtual DataAllocationInfo Arcane::IData::allocationInfo ( ) const
pure virtual

Allocation information.

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References allocationInfo().

Referenced by allocationInfo(), and Arcane::Variable::allocationInfo().

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

◆ assignSerializedData()

virtual void Arcane::IData::assignSerializedData ( const ISerializedData * sdata)
pure virtual

Assign the serialized values sdata to the data.

The buffer containing the serialization values must have be allocated by calling allocateBufferForSerializedData().

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References assignSerializedData().

Referenced by assignSerializedData().

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

◆ clone()

virtual IData * Arcane::IData::clone ( )
pure virtual

Clone the data. The created instance must be destroyed by the 'delete' operator.

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References clone().

Referenced by clone().

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

◆ cloneEmpty()

virtual IData * Arcane::IData::cloneEmpty ( )
pure virtual

Clone the data but without elements. The created instance must be destroyed by the 'delete' operator.

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References cloneEmpty().

Referenced by cloneEmpty().

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

◆ cloneEmptyRef()

virtual Ref< IData > Arcane::IData::cloneEmptyRef ( )
pure virtual

Clone the data but without elements.

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References cloneEmptyRef().

Referenced by cloneEmptyRef().

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

◆ cloneRef()

virtual Ref< IData > Arcane::IData::cloneRef ( )
pure virtual

Clone the data.

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References cloneRef().

Referenced by cloneRef(), and Arcane::MemoryDataReaderWriter::write().

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

◆ computeHash()

virtual void Arcane::IData::computeHash ( IHashAlgorithm * algo,
ByteArray & output ) const
pure virtual

Compute a hash key on this data.

The key is added to output. The length of the key depends on the algorithm used.

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References computeHash().

Referenced by Arcane::VariableIOReaderMng::_checkHashFunction(), and computeHash().

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

◆ copy()

virtual void Arcane::IData::copy ( const IData * data)
pure virtual

Copy the data data into the current instance.

The data data must be of the same type as the instance.

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References copy().

Referenced by copy(), and Arcane::MemoryDataReaderWriter::read().

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

◆ createSerializedDataRef()

virtual Ref< ISerializedData > Arcane::IData::createSerializedDataRef ( bool use_basic_type) const
pure virtual

Serialize the data.

For performance reasons, the returned instance may directly reference the memory area of this data. Consequently, it is only valid as long as this data is not modified. If you wish to modify this instance, you must first clone it (via IData::cloneRef()) and then serialize the cloned data.

If use_basic_type is true, the data is serialized for a basic type, namely DT_Byte, DT_Int16, DT_Int32, DT_Int64 or DT_Real. Otherwise, the type can be a POD, namely DT_Byte, DT_Int16, DT_Int32, DT_Int64, DT_Real, DT_Real2, DT_Real3, DT_Real2x2, DT_Real3x3.

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References createSerializedDataRef().

Referenced by Arcane::VariableIOReaderMng::_checkHashFunction(), and createSerializedDataRef().

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

◆ dataType()

◆ dimension()

virtual Integer Arcane::IData::dimension ( ) const
pure virtual

◆ fillDefault()

virtual void Arcane::IData::fillDefault ( )
pure virtual

Fills the data with its default value.

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References fillDefault().

Referenced by fillDefault().

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

◆ multiTag()

virtual Integer Arcane::IData::multiTag ( ) const
pure virtual

Multi-tag. 0 if not multiple, 1 if multiple, 2 if multiple for MultiArray variables (obsolete).

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

◆ resize()

virtual void Arcane::IData::resize ( Integer new_size)
pure virtual

Resize the data.

This operation only makes sense for data of dimension 1 or more. If the new number of elements is greater than the old one, the values added to the data are not initialized.

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References resize().

Referenced by resize().

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

◆ serialize() [1/2]

virtual void Arcane::IData::serialize ( ISerializer * sbuf,
IDataOperation * operation )
pure virtual

Serializes the data by applying the operation.

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References serialize().

Referenced by serialize(), and serialize().

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

◆ serialize() [2/2]

virtual void Arcane::IData::serialize ( ISerializer * sbuf,
Int32ConstArrayView ids,
IDataOperation * operation )
pure virtual

Serialize the data for the indices ids.

This operation only makes sense for data of dimension 1 or more.

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References serialize().

Here is the call graph for this function:

◆ setAllocationInfo()

virtual void Arcane::IData::setAllocationInfo ( const DataAllocationInfo & v)
pure virtual

Sets the allocation information.

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References setAllocationInfo().

Referenced by setAllocationInfo(), and Arcane::Variable::setAllocationInfo().

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

◆ setName()

virtual void Arcane::IData::setName ( const String & name)
pure virtual

Sets the name of the data (internal).

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References setName().

Referenced by setName().

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

◆ setShape()

virtual void Arcane::IData::setShape ( const ArrayShape & new_shape)
pure virtual

Sets the array shape.

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References setShape().

Referenced by setShape().

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

◆ shape()

virtual ArrayShape Arcane::IData::shape ( ) const
pure virtual

Array shape for a 1D or 2D data item.

The shape is only considered for dimensions greater than 1. For a 1D data item, the shape is therefore by default {1}. For a 2D array, the shape defaults to {dim2_size}. It is possible to change the rank of the shape and its values as long as shape().totalNbElement()==dim2_size. For example, if the number of values dim2_size is 12, then it is possible to have { 12 }, { 6, 2 } or { 3, 2, 2 } as the shape.

The values are not preserved during a restart, so the shape must be repositioned in this case. It is up to the user to ensure that the shape is homogeneous across sub-domains.

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References shape().

Referenced by shape().

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

◆ storageTypeInfo()

virtual DataStorageTypeInfo Arcane::IData::storageTypeInfo ( ) const
pure virtual

Information about the data container type.

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References storageTypeInfo().

Referenced by storageTypeInfo().

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

◆ swapValues()

virtual void Arcane::IData::swapValues ( IData * data)
pure virtual

Swap the values of data with those of the instance.

The data IData must be of the same type as the instance. Only the values are swapped and other possible properties (such as the name, for example) are not modified.

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References swapValues().

Referenced by swapValues().

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

◆ visit()

virtual void Arcane::IData::visit ( IDataVisitor * visitor)
pure virtual

Applies the visitor to the data.

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::IArrayData, Arcane::IScalarData, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References visit().

Referenced by visit(), and Arcane::DumpW::write().

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

◆ visitArray()

virtual void Arcane::IData::visitArray ( IArrayDataVisitor * visitor)
pure virtual

Apply the visitor to the data.

If the data is not a 1D array, an exception NotSupportedException is thrown.

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References visitArray().

Referenced by visitArray().

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

◆ visitArray2()

virtual void Arcane::IData::visitArray2 ( IArray2DataVisitor * visitor)
pure virtual

Apply the visitor to the data.

If the data is not a 2D array, an exception NotSupportedException is thrown.

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References visitArray2(), and visitMultiArray2().

Referenced by visitArray2().

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

◆ visitMultiArray2()

void Arcane::IData::visitMultiArray2 ( IMultiArray2DataVisitor * visitor)
virtual

Apply the visitor to the data.

If the data is not a 2D array, an exception NotSupportedException is thrown.

Deprecated
This visitor is obsolete because there are no more IMultiArray2 implementations.

Definition at line 55 of file core/Data.cc.

References ARCANE_THROW.

Referenced by visitArray2().

Here is the caller graph for this function:

◆ visitScalar()

virtual void Arcane::IData::visitScalar ( IScalarDataVisitor * visitor)
pure virtual

Apply the visitor to the data.

If the data is not scalar, a NotSupportedException is thrown.

Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.

References visitScalar().

Referenced by visitScalar().

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

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