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 IData * | clone ()=0 |
| Clone the data. The created instance must be destroyed by the 'delete' operator. | |
| virtual IData * | cloneEmpty ()=0 |
| Clone the data but without elements. The created instance must be destroyed by the 'delete' operator. | |
| virtual Ref< IData > | cloneRef ()=0 |
| Clone the data. | |
| virtual Ref< IData > | cloneEmptyRef ()=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< ISerializedData > | createSerializedDataRef (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 |
Interface of a data item.
This class manages the memory associated with a variable.
|
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().
|
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().
|
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().
|
pure virtual |
|
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().
|
pure virtual |
|
pure virtual |
Serialize the data for the indices ids.
This operation only makes sense for data of dimension 1 or more.
References serialize().
|
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().
|
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().
|
pure virtual |
Applies the visitor to the data.
Implemented in Arcane::IArrayData, and Arcane::IScalarData.
References visit().
Referenced by visit().
|
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().
|
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().
|
virtual |
Apply the visitor to the data.
If the data is not a 2D array, an exception NotSupportedException is thrown.
Definition at line 55 of file Data.cc.
References ARCANE_THROW.
Referenced by visitArray2().
|
pure virtual |
Apply the visitor to the data.
If the data is not scalar, a NotSupportedException is thrown.
References visitScalar().
Referenced by visitScalar().