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

Interface of a data item. More...

#include <arcane/core/IData.h>

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

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

◆ 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.

References allocateBufferForSerializedData().

Referenced by allocateBufferForSerializedData().

◆ 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().

References assignSerializedData().

Referenced by assignSerializedData().

◆ 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.

References computeHash().

Referenced by computeHash().

◆ 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.

References copy().

Referenced by copy().

◆ 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.

References createSerializedDataRef().

Referenced by createSerializedDataRef().

◆ 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.

References resize().

Referenced by resize().

◆ serialize()

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.

References serialize().

◆ 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.

References shape().

Referenced by shape().

◆ 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.

References swapValues().

Referenced by swapValues().

◆ visit()

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

Applies the visitor to the data.

Implemented in Arcane::IArrayData, and Arcane::IScalarData.

References visit().

Referenced by visit().

◆ 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.

References visitArray().

Referenced by visitArray().

◆ 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.

References visitArray2(), and visitMultiArray2().

Referenced by visitArray2().

◆ 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 Data.cc.

References ARCANE_THROW.

Referenced by visitArray2().

◆ 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.

References visitScalar().

Referenced by visitScalar().


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