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 |
Private Member Functions | |
| ARCCORE_DECLARE_REFERENCE_COUNTED_INCLASS_METHODS () | |
Interface of a data item.
This class manages the memory associated with a variable.
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
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().
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().
|
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().
|
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().
|
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().
|
pure virtual |
|
pure virtual |
Dimension. 0 for a scalar, 1 for a mono-dim array, 2 for a bi-dim array.
Implemented in Arcane::Array2DataT< DataType >, Arcane::ArrayDataT< DataType >, Arcane::NumArrayDataT< DataType, RankValue >, Arcane::ScalarDataT< DataType >, Arcane::StringArrayData, and Arcane::StringScalarData.
|
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().
|
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.
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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 core/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.
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().