Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::StringScalarData Class Reference

Scalar data of a unicode string. More...

Inheritance diagram for Arcane::StringScalarData:
Collaboration diagram for Arcane::StringScalarData:

Classes

class  Internal

Public Types

typedef String DataType
typedef StringScalarData ThatClass
typedef IScalarDataT< StringDataInterfaceType
Public Types inherited from Arcane::IScalarDataT< String >
typedef IScalarDataT< StringThatClass

Public Member Functions

 StringScalarData (ITraceMng *trace)
 StringScalarData (const DataStorageBuildInfo &dsbi)
 StringScalarData (const StringScalarData &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.
DataType & value () override
 Data value.
const DataType & value () const override
 Data value.
void resize (Integer) override
 Resize the data.
IDataclone () override
 Clone the data. The created instance must be destroyed by the 'delete' operator.
IDatacloneEmpty () override
 Clone the data but without elements. The created instance must be destroyed by the 'delete' operator.
Ref< IDatacloneRef () override
 Clone the data.
Ref< IDatacloneEmptyRef () override
 Clone the data but without elements.
DataStorageTypeInfo storageTypeInfo () const override
 Information about the data container type.
StringScalarData * cloneTrue () override
 Clone the data.
StringScalarData * 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< ISerializedDatacreateSerializedDataRef (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 &) override
 Sets the array shape.
void setAllocationInfo (const DataAllocationInfo &v) override
 Sets the allocation information.
DataAllocationInfo allocationInfo () const override
 Allocation information.
void visit (IScalarDataVisitor *visitor) override
 Applies the visitor to the data.
void visit (IDataVisitor *visitor) override
 Applies the visitor to the data.
void visitScalar (IScalarDataVisitor *visitor) override
 Apply the visitor to the data.
void visitArray (IArrayDataVisitor *visitor) override
 Apply the visitor to the data.
void visitArray2 (IArray2DataVisitor *visitor) override
 Apply the visitor to the data.
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 ()

Private Attributes

DataType m_value
 Data.
ITraceMngm_trace
Internal m_internal
DataAllocationInfo m_allocation_info

Detailed Description

Scalar data of a unicode string.

Definition at line 49 of file StringScalarData.cc.

Member Typedef Documentation

◆ DataInterfaceType

typedef IScalarDataT<String> Arcane::StringScalarData::DataInterfaceType

Definition at line 59 of file StringScalarData.cc.

◆ DataType

typedef String Arcane::StringScalarData::DataType

Definition at line 57 of file StringScalarData.cc.

◆ ThatClass

typedef StringScalarData Arcane::StringScalarData::ThatClass

Definition at line 58 of file StringScalarData.cc.

Constructor & Destructor Documentation

◆ StringScalarData() [1/3]

Arcane::StringScalarData::StringScalarData ( ITraceMng * trace)
inlineexplicit

Definition at line 86 of file StringScalarData.cc.

◆ StringScalarData() [2/3]

Arcane::StringScalarData::StringScalarData ( const DataStorageBuildInfo & dsbi)
explicit

Definition at line 169 of file StringScalarData.cc.

◆ StringScalarData() [3/3]

Arcane::StringScalarData::StringScalarData ( const StringScalarData & rhs)
inline

Definition at line 91 of file StringScalarData.cc.

Member Function Documentation

◆ _commonInternal()

IDataInternal * Arcane::StringScalarData::_commonInternal ( )
inlineoverridevirtual

Implements Arcane::IData.

Definition at line 152 of file StringScalarData.cc.

◆ allocateBufferForSerializedData()

void Arcane::StringScalarData::allocateBufferForSerializedData ( ISerializedData * sdata)
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 223 of file StringScalarData.cc.

References Arcane::ISerializedData::allocateMemory(), Arcane::ISerializedData::baseDataType(), Arcane::DT_Byte, and Arcane::ISerializedData::memorySize().

Here is the call graph for this function:

◆ allocationInfo()

DataAllocationInfo Arcane::StringScalarData::allocationInfo ( ) const
inlineoverridevirtual

Allocation information.

Implements Arcane::IData.

Definition at line 140 of file StringScalarData.cc.

◆ assignSerializedData()

void Arcane::StringScalarData::assignSerializedData ( const ISerializedData * sdata)
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 235 of file StringScalarData.cc.

References Arcane::ISerializedData::baseDataType(), Arcane::ISerializedData::constBytes(), Arcane::DT_Byte, m_value, and Arcane::ISerializedData::nbBaseElement().

Here is the call graph for this function:

◆ clone()

IData * Arcane::StringScalarData::clone ( )
inlineoverridevirtual

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

Implements Arcane::IData.

Definition at line 108 of file StringScalarData.cc.

References cloneTrue().

Here is the call graph for this function:

◆ cloneEmpty()

IData * Arcane::StringScalarData::cloneEmpty ( )
inlineoverridevirtual

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

Implements Arcane::IData.

Definition at line 109 of file StringScalarData.cc.

References cloneTrueEmpty().

Here is the call graph for this function:

◆ cloneEmptyRef()

Ref< IData > Arcane::StringScalarData::cloneEmptyRef ( )
inlineoverridevirtual

Clone the data but without elements.

Implements Arcane::IData.

Definition at line 111 of file StringScalarData.cc.

References cloneTrueEmpty(), and Arcane::makeRef().

Here is the call graph for this function:

◆ cloneRef()

Ref< IData > Arcane::StringScalarData::cloneRef ( )
inlineoverridevirtual

Clone the data.

Implements Arcane::IData.

Definition at line 110 of file StringScalarData.cc.

References cloneTrue(), and Arcane::makeRef().

Here is the call graph for this function:

◆ cloneTrue()

StringScalarData * Arcane::StringScalarData::cloneTrue ( )
inlineoverridevirtual

Clone the data.

Implements Arcane::IScalarDataT< String >.

Definition at line 113 of file StringScalarData.cc.

Referenced by clone(), and cloneRef().

Here is the caller graph for this function:

◆ cloneTrueEmpty()

StringScalarData * Arcane::StringScalarData::cloneTrueEmpty ( )
inlineoverridevirtual

Clone the data but without elements.

Implements Arcane::IScalarDataT< String >.

Definition at line 114 of file StringScalarData.cc.

Referenced by cloneEmpty(), and cloneEmptyRef().

Here is the caller graph for this function:

◆ cloneTrueEmptyRef()

Ref< DataInterfaceType > Arcane::StringScalarData::cloneTrueEmptyRef ( )
inlineoverridevirtual

Clone the data but without elements.

Implements Arcane::IScalarDataT< String >.

Definition at line 120 of file StringScalarData.cc.

References Arcane::makeRef().

Here is the call graph for this function:

◆ cloneTrueRef()

Ref< DataInterfaceType > Arcane::StringScalarData::cloneTrueRef ( )
inlineoverridevirtual

Clone the data.

Implements Arcane::IScalarDataT< String >.

Definition at line 115 of file StringScalarData.cc.

References Arcane::makeRef().

Here is the call graph for this function:

◆ computeHash() [1/2]

void Arcane::StringScalarData::computeHash ( DataHashInfo & hash_info) const

Definition at line 314 of file StringScalarData.cc.

◆ computeHash() [2/2]

void Arcane::StringScalarData::computeHash ( IHashAlgorithm * algo,
ByteArray & output ) const
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 304 of file StringScalarData.cc.

References Arcane::IHashAlgorithm::computeHash64(), and m_value.

Here is the call graph for this function:

◆ copy()

void Arcane::StringScalarData::copy ( const IData * data)
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 324 of file StringScalarData.cc.

References m_value, and Arcane::IScalarDataT< DataType >::value().

Here is the call graph for this function:

◆ createSerializedDataRef()

Ref< ISerializedData > Arcane::StringScalarData::createSerializedDataRef ( bool use_basic_type) const
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 201 of file StringScalarData.cc.

References Arcane::Array< T >::add(), Arcane::arcaneCreateSerializedDataRef(), Arcane::DT_Byte, m_value, Arcane::ConstArrayView< T >::size(), and Arcane::SpanImpl< T, SizeType, Extent >::size().

Here is the call graph for this function:

◆ dataType()

eDataType Arcane::StringScalarData::dataType ( ) const
inlineoverridevirtual

Data type.

Implements Arcane::IData.

Definition at line 102 of file StringScalarData.cc.

◆ dimension()

Integer Arcane::StringScalarData::dimension ( ) const
inlineoverridevirtual

Dimension. 0 for a scalar, 1 for a mono-dim array, 2 for a bi-dim array.

Implements Arcane::IData.

Definition at line 100 of file StringScalarData.cc.

◆ fillDefault()

void Arcane::StringScalarData::fillDefault ( )
inlineoverridevirtual

Fills the data with its default value.

Implements Arcane::IData.

Definition at line 125 of file StringScalarData.cc.

References m_value.

◆ multiTag()

Integer Arcane::StringScalarData::multiTag ( ) const
inlineoverridevirtual

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

Implements Arcane::IData.

Definition at line 101 of file StringScalarData.cc.

◆ resize()

void Arcane::StringScalarData::resize ( Integer new_size)
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 107 of file StringScalarData.cc.

◆ serialize() [1/2]

void Arcane::StringScalarData::serialize ( ISerializer * sbuf,
IDataOperation * operation )
overridevirtual

Serializes the data by applying the operation.

Implements Arcane::IData.

Definition at line 255 of file StringScalarData.cc.

References Arcane::ISerializer::get(), m_value, Arcane::ISerializer::mode(), Arcane::ISerializer::ModeGet, Arcane::ISerializer::ModePut, Arcane::ISerializer::put(), Arcane::ISerializer::ReadAdd, Arcane::ISerializer::readMode(), Arcane::ISerializer::ReadReplace, and Arcane::ISerializer::reserve().

Here is the call graph for this function:

◆ serialize() [2/2]

void Arcane::StringScalarData::serialize ( ISerializer * sbuf,
Int32ConstArrayView ids,
IDataOperation * operation )
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 283 of file StringScalarData.cc.

◆ setAllocationInfo()

void Arcane::StringScalarData::setAllocationInfo ( const DataAllocationInfo & v)
inlineoverridevirtual

Sets the allocation information.

Implements Arcane::IData.

Definition at line 139 of file StringScalarData.cc.

◆ setName()

void Arcane::StringScalarData::setName ( const String & name)
overridevirtual

Sets the name of the data (internal).

Implements Arcane::IData.

Definition at line 295 of file StringScalarData.cc.

◆ setShape()

void Arcane::StringScalarData::setShape ( const ArrayShape & new_shape)
inlineoverridevirtual

Sets the array shape.

Implements Arcane::IData.

Definition at line 138 of file StringScalarData.cc.

◆ shape()

ArrayShape Arcane::StringScalarData::shape ( ) const
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 137 of file StringScalarData.cc.

◆ staticStorageTypeInfo()

DataStorageTypeInfo Arcane::StringScalarData::staticStorageTypeInfo ( )
static

Definition at line 179 of file StringScalarData.cc.

◆ storageTypeInfo()

DataStorageTypeInfo Arcane::StringScalarData::storageTypeInfo ( ) const
overridevirtual

Information about the data container type.

Implements Arcane::IData.

Definition at line 192 of file StringScalarData.cc.

◆ swapValues()

void Arcane::StringScalarData::swapValues ( IData * data)
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 336 of file StringScalarData.cc.

References m_value, and Arcane::IScalarDataT< DataType >::value().

Here is the call graph for this function:

◆ value() [1/2]

const DataType & Arcane::StringScalarData::value ( ) const
inlineoverridevirtual

Data value.

Implements Arcane::IScalarDataT< String >.

Definition at line 106 of file StringScalarData.cc.

References m_value.

◆ value() [2/2]

DataType & Arcane::StringScalarData::value ( )
inlineoverridevirtual

Data value.

Implements Arcane::IScalarDataT< String >.

Definition at line 105 of file StringScalarData.cc.

References m_value.

◆ visit() [1/2]

void Arcane::StringScalarData::visit ( IDataVisitor * visitor)
inlineoverridevirtual

Applies the visitor to the data.

Implements Arcane::IScalarData.

Definition at line 145 of file StringScalarData.cc.

◆ visit() [2/2]

void Arcane::StringScalarData::visit ( IScalarDataVisitor * visitor)
inlineoverridevirtual

Applies the visitor to the data.

Implements Arcane::IScalarData.

Definition at line 141 of file StringScalarData.cc.

◆ visitArray()

void Arcane::StringScalarData::visitArray ( IArrayDataVisitor * visitor)
overridevirtual

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 357 of file StringScalarData.cc.

◆ visitArray2()

void Arcane::StringScalarData::visitArray2 ( IArray2DataVisitor * visitor)
overridevirtual

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 366 of file StringScalarData.cc.

◆ visitScalar()

void Arcane::StringScalarData::visitScalar ( IScalarDataVisitor * visitor)
overridevirtual

Apply the visitor to the data.

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

Implements Arcane::IData.

Definition at line 348 of file StringScalarData.cc.

Member Data Documentation

◆ m_allocation_info

DataAllocationInfo Arcane::StringScalarData::m_allocation_info
private

Definition at line 163 of file StringScalarData.cc.

◆ m_internal

Internal Arcane::StringScalarData::m_internal
private

Definition at line 162 of file StringScalarData.cc.

◆ m_trace

ITraceMng* Arcane::StringScalarData::m_trace
private

Definition at line 161 of file StringScalarData.cc.

◆ m_value

DataType Arcane::StringScalarData::m_value
private

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