#include <arcane/impl/internal/ArrayData.h>
Classes | |
| class | Impl |
Public Types | |
| typedef ArrayDataT< DataType > | ThatClass |
| typedef IArrayDataT< DataType > | DataInterfaceType |
| Public Types inherited from Arcane::IArrayDataT< DataType > | |
| typedef IArrayDataT< DataType > | ThatClass |
Public Member Functions | |
| ArrayDataT (ITraceMng *trace) | |
| ArrayDataT (const DataStorageBuildInfo &dsbi) | |
| ArrayDataT (const ArrayDataT< DataType > &rhs) | |
| Integer | dimension () const override |
| Dimension. 0 for a scalar, 1 for a mono-dim array, 2 for a bi-dim array. | |
| Integer | multiTag () const override |
| Multi-tag. 0 if not multiple, 1 if multiple, 2 if multiple for MultiArray variables (obsolete). | |
| eDataType | dataType () const override |
| Data type. | |
| void | serialize (ISerializer *sbuf, IDataOperation *operation) override |
| Serializes the data by applying the operation. | |
| void | serialize (ISerializer *sbuf, Int32ConstArrayView ids, IDataOperation *operation) override |
| Serialize the data for the indices ids. | |
| Array< DataType > & | value () override |
| Data value. | |
| const Array< DataType > & | value () const override |
| Constant data value. | |
| ConstArrayView< DataType > | view () const override |
| Constant view on the data. | |
| ArrayView< DataType > | view () override |
| View on the data. | |
| void | resize (Integer new_size) override |
| Resize the data. | |
| IData * | clone () override |
| Clone the data. The created instance must be destroyed by the 'delete' operator. | |
| IData * | cloneEmpty () override |
| Clone the data but without elements. The created instance must be destroyed by the 'delete' operator. | |
| Ref< IData > | cloneRef () override |
| Clone the data. | |
| Ref< IData > | cloneEmptyRef () override |
| Clone the data but without elements. | |
| DataStorageTypeInfo | storageTypeInfo () const override |
| Information about the data container type. | |
| DataInterfaceType * | cloneTrue () override |
| Clone the data. | |
| DataInterfaceType * | cloneTrueEmpty () override |
| Clone the data but without elements. | |
| Ref< DataInterfaceType > | cloneTrueRef () override |
| Clone the data. | |
| Ref< DataInterfaceType > | cloneTrueEmptyRef () override |
| Clone the data but without elements. | |
| void | fillDefault () override |
| Fills the data with its default value. | |
| void | setName (const String &name) override |
| Sets the name of the data (internal). | |
| Ref< ISerializedData > | createSerializedDataRef (bool use_basic_type) const override |
| Serialize the data. | |
| void | allocateBufferForSerializedData (ISerializedData *sdata) override |
| Allocate memory to read the serialized values sdata. | |
| void | assignSerializedData (const ISerializedData *sdata) override |
| Assign the serialized values sdata to the data. | |
| void | copy (const IData *data) override |
| Copy the data data into the current instance. | |
| void | swapValues (IData *data) override |
| Swap the values of data with those of the instance. | |
| void | computeHash (IHashAlgorithm *algo, ByteArray &output) const override |
| Compute a hash key on this data. | |
| void | computeHash (DataHashInfo &hash_info) const |
| ArrayShape | shape () const override |
| Array shape for a 1D or 2D data item. | |
| void | setShape (const ArrayShape &new_shape) override |
| Sets the array shape. | |
| void | setAllocationInfo (const DataAllocationInfo &v) override |
| Sets the allocation information. | |
| DataAllocationInfo | allocationInfo () const override |
| Allocation information. | |
| void | visit (IArrayDataVisitor *visitor) override |
| Applies the visitor to the data. | |
| void | visit (IDataVisitor *visitor) override |
| Applies the visitor to the data. | |
| void | visitScalar (IScalarDataVisitor *) override |
| Apply the visitor to the data. | |
| void | visitArray (IArrayDataVisitor *visitor) override |
| Apply the visitor to the data. | |
| void | visitArray2 (IArray2DataVisitor *) override |
| Apply the visitor to the data. | |
| void | swapValuesDirect (ThatClass *true_data) |
| void | changeAllocator (const MemoryAllocationOptions &alloc_info) |
| IArrayDataInternalT< DataType > * | _internal () override |
| IDataInternal * | _commonInternal () override |
| Public Member Functions inherited from Arcane::ReferenceCounterImpl | |
| void | addReference () |
| void | removeReference () |
| void | _internalAddReference () |
| bool | _internalRemoveReference () |
| Public Member Functions inherited from Arcane::IData | |
| virtual void | visitMultiArray2 (IMultiArray2DataVisitor *visitor) |
| Apply the visitor to the data. | |
Static Public Member Functions | |
| static DataStorageTypeInfo | staticStorageTypeInfo () |
Private Member Functions | |
| ARCCORE_DEFINE_REFERENCE_COUNTED_INCLASS_METHODS () | |
| void | _serialize (ISerializer *sbuf, Span< const Int32 > ids, IDataOperation *operation) |
| IArrayDataT< DataType > * | _cloneTrue () const |
| IArrayDataT< DataType > * | _cloneTrueEmpty () const |
| void | _setShape () |
Private Attributes | |
| UniqueArray< DataType > | m_value |
| Data. | |
| ITraceMng * | m_trace |
| IArrayDataInternalT< DataType > * | m_internal |
| ArrayShape | m_shape |
| DataAllocationInfo | m_allocation_info |
Friends | |
| class | Impl |
Array data of type T.
Definition at line 47 of file ArrayData.h.
| typedef IArrayDataT<DataType> Arcane::ArrayDataT< DataType >::DataInterfaceType |
Definition at line 58 of file ArrayData.h.
| typedef ArrayDataT<DataType> Arcane::ArrayDataT< DataType >::ThatClass |
Definition at line 57 of file ArrayData.h.
|
explicit |
Definition at line 51 of file ArrayData.inst.h.
|
explicit |
Definition at line 77 of file ArrayData.inst.h.
| Arcane::ArrayDataT< DataType >::ArrayDataT | ( | const ArrayDataT< DataType > & | rhs | ) |
Definition at line 63 of file ArrayData.inst.h.
|
override |
Definition at line 89 of file ArrayData.inst.h.
|
inlineprivate |
Definition at line 156 of file ArrayData.h.
|
inlineprivate |
Definition at line 157 of file ArrayData.h.
|
inlineoverridevirtual |
Implements Arcane::IData.
Definition at line 138 of file ArrayData.h.
|
inlineoverridevirtual |
Implements Arcane::IArrayDataT< DataType >.
Definition at line 137 of file ArrayData.h.
|
private |
Definition at line 284 of file ArrayData.inst.h.
|
private |
Definition at line 472 of file ArrayData.inst.h.
|
overridevirtual |
Allocate memory to read the serialized values sdata.
This method sets sdata->setBuffer(), which will contain the memory needed to read the serialized data.
Implements Arcane::IData.
Definition at line 154 of file ArrayData.inst.h.
References ARCANE_THROW, Arcane::ISerializedData::baseDataType(), dataType(), m_value, Arcane::ISerializedData::memorySize(), Arcane::ISerializedData::nbElement(), Arcane::ISerializedData::setWritableBytes(), and Arcane::ISerializedData::shape().
|
inlineoverridevirtual |
|
overridevirtual |
Assign the serialized values sdata to the data.
The buffer containing the serialization values must have be allocated by calling allocateBufferForSerializedData().
Implements Arcane::IData.
Definition at line 179 of file ArrayData.inst.h.
| void Arcane::ArrayDataT< DataType >::changeAllocator | ( | const MemoryAllocationOptions & | alloc_info | ) |
Definition at line 494 of file ArrayData.inst.h.
|
inlineoverridevirtual |
Clone the data. The created instance must be destroyed by the 'delete' operator.
Implements Arcane::IData.
Definition at line 79 of file ArrayData.h.
|
inlineoverridevirtual |
Clone the data but without elements. The created instance must be destroyed by the 'delete' operator.
Implements Arcane::IData.
Definition at line 80 of file ArrayData.h.
|
inlineoverridevirtual |
Clone the data but without elements.
Implements Arcane::IData.
Definition at line 82 of file ArrayData.h.
References cloneTrueEmpty(), and Arcane::makeRef().
|
inlineoverridevirtual |
Clone the data.
Implements Arcane::IData.
Definition at line 81 of file ArrayData.h.
References cloneTrue(), and Arcane::makeRef().
|
inlineoverridevirtual |
Clone the data.
Implements Arcane::IArrayDataT< DataType >.
Definition at line 84 of file ArrayData.h.
Referenced by cloneRef().
|
inlineoverridevirtual |
Clone the data but without elements.
Implements Arcane::IArrayDataT< DataType >.
Definition at line 85 of file ArrayData.h.
Referenced by cloneEmptyRef().
|
inlineoverridevirtual |
Clone the data but without elements.
Implements Arcane::IArrayDataT< DataType >.
Definition at line 91 of file ArrayData.h.
References Arcane::makeRef().
|
inlineoverridevirtual |
Clone the data.
Implements Arcane::IArrayDataT< DataType >.
Definition at line 86 of file ArrayData.h.
References Arcane::makeRef().
| void Arcane::ArrayDataT< DataType >::computeHash | ( | DataHashInfo & | hash_info | ) | const |
Definition at line 429 of file ArrayData.inst.h.
|
overridevirtual |
Compute a hash key on this data.
The key is added to output. The length of the key depends on the algorithm used.
Implements Arcane::IData.
Definition at line 416 of file ArrayData.inst.h.
References Arcane::IHashAlgorithm::computeHash64(), and m_value.
|
overridevirtual |
Copy the data data into the current instance.
The data data must be of the same type as the instance.
Implements Arcane::IData.
Definition at line 439 of file ArrayData.inst.h.
References ARCANE_THROW, and m_value.
|
overridevirtual |
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.
Implements Arcane::IData.
Definition at line 124 of file ArrayData.inst.h.
References Arcane::Array< T >::add(), Arcane::arcaneCreateSerializedDataRef(), dataType(), m_value, shape(), and Arcane::SpanImpl< T, SizeType, Extent >::size().
|
inlineoverridevirtual |
Data type.
Implements Arcane::IData.
Definition at line 71 of file ArrayData.h.
Referenced by allocateBufferForSerializedData(), and createSerializedDataRef().
|
inlineoverridevirtual |
Dimension. 0 for a scalar, 1 for a mono-dim array, 2 for a bi-dim array.
Implements Arcane::IData.
Definition at line 69 of file ArrayData.h.
|
overridevirtual |
Fills the data with its default value.
Implements Arcane::IData.
Definition at line 398 of file ArrayData.inst.h.
References m_value.
|
inlineoverridevirtual |
Multi-tag. 0 if not multiple, 1 if multiple, 2 if multiple for MultiArray variables (obsolete).
Implements Arcane::IData.
Definition at line 70 of file ArrayData.h.
|
inlineoverridevirtual |
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.
Implements Arcane::IData.
Definition at line 78 of file ArrayData.h.
References m_value.
|
overridevirtual |
Serializes the data by applying the operation.
Implements Arcane::IData.
Definition at line 189 of file ArrayData.inst.h.
References ARCANE_FATAL, ARCANE_THROW, Arcane::arcaneIsDebug(), Arcane::Array< T >::data(), Arcane::ISerializer::getInt64(), Arcane::ISerializer::getSpan(), Arcane::Trace::High, Arcane::Trace::Highest, m_value, Arcane::ISerializer::mode(), Arcane::ISerializer::ModeGet, Arcane::ISerializer::ModePut, Arcane::ISerializer::putInt64(), Arcane::ISerializer::putSpan(), Arcane::ISerializer::ReadAdd, Arcane::ISerializer::readMode(), Arcane::ISerializer::ReadReplace, Arcane::ISerializer::reserveInt64(), and Arcane::ISerializer::reserveSpan().
|
overridevirtual |
Serialize the data for the indices ids.
This operation only makes sense for data of dimension 1 or more.
Implements Arcane::IData.
Definition at line 275 of file ArrayData.inst.h.
|
overridevirtual |
Sets the allocation information.
Implements Arcane::IData.
Definition at line 482 of file ArrayData.inst.h.
References m_value.
|
overridevirtual |
Sets the name of the data (internal).
Implements Arcane::IData.
Definition at line 407 of file ArrayData.inst.h.
References m_value.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
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.
Implements Arcane::IData.
Definition at line 105 of file ArrayData.h.
Referenced by createSerializedDataRef().
|
static |
Definition at line 101 of file ArrayData.inst.h.
|
overridevirtual |
Information about the data container type.
Implements Arcane::IData.
Definition at line 115 of file ArrayData.inst.h.
|
overridevirtual |
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.
Implements Arcane::IData.
Definition at line 451 of file ArrayData.inst.h.
References ARCANE_THROW.
| void Arcane::ArrayDataT< DataType >::swapValuesDirect | ( | ThatClass * | true_data | ) |
Definition at line 463 of file ArrayData.inst.h.
|
inlineoverridevirtual |
Constant data value.
Implements Arcane::IArrayDataT< DataType >.
Definition at line 75 of file ArrayData.h.
References m_value.
|
inlineoverridevirtual |
Data value.
Implements Arcane::IArrayDataT< DataType >.
Definition at line 74 of file ArrayData.h.
References m_value.
|
inlineoverridevirtual |
Constant view on the data.
Implements Arcane::IArrayDataT< DataType >.
Definition at line 76 of file ArrayData.h.
References m_value.
|
inlineoverridevirtual |
View on the data.
Implements Arcane::IArrayDataT< DataType >.
Definition at line 77 of file ArrayData.h.
References m_value.
|
inlineoverridevirtual |
Applies the visitor to the data.
Implements Arcane::IArrayData.
Definition at line 109 of file ArrayData.h.
|
inlineoverridevirtual |
Applies the visitor to the data.
Implements Arcane::IArrayData.
Definition at line 113 of file ArrayData.h.
|
inlineoverridevirtual |
Apply the visitor to the data.
If the data is not a 1D array, an exception NotSupportedException is thrown.
Implements Arcane::IData.
Definition at line 121 of file ArrayData.h.
|
inlineoverridevirtual |
Apply the visitor to the data.
If the data is not a 2D array, an exception NotSupportedException is thrown.
Implements Arcane::IData.
Definition at line 125 of file ArrayData.h.
References ARCANE_THROW.
|
inlineoverridevirtual |
Apply the visitor to the data.
If the data is not scalar, a NotSupportedException is thrown.
Implements Arcane::IData.
Definition at line 117 of file ArrayData.h.
References ARCANE_THROW.
|
friend |
Definition at line 53 of file ArrayData.h.
|
private |
Definition at line 151 of file ArrayData.h.
|
private |
Definition at line 149 of file ArrayData.h.
|
private |
Definition at line 150 of file ArrayData.h.
|
private |
Definition at line 148 of file ArrayData.h.
|
private |
Data.
Definition at line 147 of file ArrayData.h.
Referenced by allocateBufferForSerializedData(), computeHash(), copy(), createSerializedDataRef(), fillDefault(), resize(), serialize(), setAllocationInfo(), setName(), value(), value(), view(), and view().