DataTypeImpl Class Reference

#include <datatypebase.h>

Inheritance diagram for DataTypeImpl:

Classes

class  Instantiated
 
class  Primary
 

Public Member Functions

template<typename T , typename C >
 DataTypeImpl (const Id &type, const DataTypeImpl *underlying, const DataTypeImpl *element, const T *nullValue, const C *dummy, VALUEKIND flags=VALUEKIND::NONE, const NonvirtualInterfaceImplementation *impl=nullptr, VALUEKIND kind=ValueKindHelper< T, GetDirectlyReferencedType< T >::value >::KIND, const ParametricTypeInterface *pt=nullptr, const DataTypeImpl *extra=nullptr)
 
template<typename C >
 DataTypeImpl (const Id &type, const DataTypeImpl *underlying, const DataTypeImpl *element, const void *nullValue, Int size, Int alignment, const C *dummy, VALUEKIND kind, const ParametricTypeInterface *pt=nullptr, const DataTypeImpl *extra=nullptr)
 
 DataTypeImpl ()
 
 DataTypeImpl (const DataTypeImpl &src, const Id &typeId, VALUEKIND qualification, const ParametricTypeInterface *pt, VALUEKIND remove=VALUEKIND::NONE, Bool copyTypeArgs=true, const DataTypeImpl *element=nullptr)
 
const IdGetId () const
 
String ToString (const FormatStatement *formatStatement=nullptr) const
 
Int GetSize () const
 
Int GetAlignment () const
 
VALUEKIND GetValueKind () const
 
Bool CheckValueKind (VALUEKIND test) const
 
const DataTypeImplGetUnqualifiedType () const
 
const DataTypeGetUnderlyingType () const
 
const DataTypeGetElementType () const
 
const DataTypeImplGetDecayedType () const
 
Bool HasTypeArguments () const
 
const TypeArgumentsGetTypeArguments () const
 
const ParametricTypeInterfaceGetParametricType () const
 
const SimdInfoGetSimdInfo () const
 
const NonvirtualInterfaceImplementation * GetImplementation () const
 
const InterfaceDefinition *const * GetInterfaces () const
 
const Generic * GetNullValue () const
 
Result< void * > Create () const
 
void Construct (void *dest) const
 
void Construct (void *dest, Int dstride, Int count) const
 
void Destruct (const void *dest) const
 
void Destruct (const void *dest, Int dstride, Int count) const
 
void MoveConstruct (void *dest, void *src) const
 
void MoveConstruct (void *dest, Int dstride, void *src, Int sstride, Int count) const
 
void MoveFrom (void *dest, void *src) const
 
void MoveFrom (void *dest, Int dstride, void *src, Int sstride, Int count) const
 
Result< void > CopyFrom (void *dest, const void *src) const
 
Result< void > CopyFrom (void *dest, Int dstride, const void *src, Int sstride, Int count) const
 
void AddReference (const void *obj) const
 
void RemoveReference (const void *obj) const
 
String ToString (const void *s, const FormatStatement *formatStatement) const
 
Bool IsEqual (const void *s1, const void *s2, EQUALITY equality) const
 
COMPARERESULT Compare (const void *s1, const void *s2) const
 
HashInt GetHashCode (const void *s1) const
 
UniqueHash GetUniqueHashCode (const void *s1) const
 
Result< void > DescribeIO (const DataSerializeInterface &stream) const
 
Result< void > PrivateRegister () const
 
void PrivateSetStructType (const TupleDataType &tupleType, const Int *offsets)
 
void PrivateSetTypeArgs (StrongRef< const TypeArguments > &&args)
 
const StrongRef< const DataTypeImpl > & PrivateGetExtraType () const
 
Result< void > InitializeNullValue ()
 

Protected Types

enum class  FLAGS {
  NONE ,
  GLOBALLY_REFERENCED ,
  OWNS_NULL_VALUE
}
 

Protected Member Functions

enum maxon::DataTypeImpl::FLAGS MAXON_ENUM_FLAGS_CLASS (FLAGS)
 
 ~DataTypeImpl ()
 
void ResetRefs ()
 
void ResetNullValue ()
 
 MAXON_DISALLOW_COPY_AND_ASSIGN (DataTypeImpl)
 
void AddReference () const
 
void RemoveReference () const
 

Protected Attributes

const Id _id
 
const Int _size
 
const Int _alignment
 
VALUEKIND _valueKind
 
FLAGS _flags
 
StrongRef< const DataTypeImpl_underlying
 
StrongRef< const DataTypeImpl_elementType
 
StrongRef< const DataTypeImpl_extraType
 
const ParametricTypeInterface_parametricType
 
union {
   const NonvirtualInterfaceImplementation *   _implementation
 
   const InterfaceDefinition *const *   _interfaces
 
   const TypeArguments *   _typeArgs
 
MAXON_ENUM_FLAGS_CLASS
 
const void * _conversions [3]
 
const Generic * _nullValue
 
void(*const _construct )(const DataTypeImpl *type, void *dest, Int dstride, Int count)
 
void(*const _destruct )(const DataTypeImpl *type, const void *dest, Int dstride, Int count)
 
void(*const _moveConstruct )(const DataTypeImpl *type, void *dest, Int dstride, void *src, Int sstride, Int count)
 
void(*const _moveFrom )(const DataTypeImpl *type, void *dest, Int dstride, void *src, Int sstride, Int count)
 
Result< void >(*const _copyFrom )(const DataTypeImpl *type, void *dest, Int dstride, const void *src, Int sstride, Int count)
 
void(*const _addReference )(const DataTypeImpl *type, const void *obj)
 
void(*const _removeReference )(const DataTypeImpl *type, const void *obj)
 
String(*const _toString )(const DataTypeImpl *type, const void *s, const FormatStatement *formatStatement)
 
Bool(*const _isEqual )(const DataTypeImpl *type, const void *s1, const void *s2, EQUALITY equality)
 
COMPARERESULT(*const _compare )(const DataTypeImpl *type, const void *s1, const void *s2)
 
HashInt(*const _getHashCode )(const DataTypeImpl *type, const void *s1)
 
UniqueHash(*const _getUniqueHashCode )(const DataTypeImpl *type, const void *s1)
 
Result< void >(* _describeIO )(const DataTypeImpl *type, const DataSerializeInterface &stream)
 
Result< void * >(*const _newInstance )(const DataTypeImpl *type)
 
Result< void >(*const _initData )(const DataTypeImpl *type, DataMemBlock *mem)
 
void(*const _freeData )(const DataTypeImpl *type, DataMemBlock *mem)
 
Result< void >(*const _copyData )(const DataTypeImpl *type, DataMemBlock *d, const DataMemBlock *s)
 
Result< void >(*const _initCopyData )(const DataTypeImpl *type, DataMemBlock *d, const DataMemBlock *s)
 
void(*const _moveData )(const DataTypeImpl *type, DataMemBlock *d, DataMemBlock *s)
 
void(*const _initMoveData )(const DataTypeImpl *type, DataMemBlock *d, DataMemBlock *s)
 
const void *(*const _getPtr )(const DataTypeImpl *type, const DataMemBlock *s)
 
Bool(*const _isEqualData )(const DataTypeImpl *type, const DataMemBlock *s1, const DataMemBlock *s2, EQUALITY equality)
 

Private Member Functions

Result< void > InitData (DataMemBlock *mem) const
 
void FreeData (DataMemBlock *mem) const
 
Result< void > CopyData (DataMemBlock *d, const DataMemBlock *s) const
 
Result< void > InitCopyData (DataMemBlock *d, const DataMemBlock *s) const
 
void MoveData (DataMemBlock *d, DataMemBlock *s) const
 
void InitMoveData (DataMemBlock *d, DataMemBlock *s) const
 
Bool IsEqualData (const DataMemBlock *s1, const DataMemBlock *s2, EQUALITY equality) const
 
const void * GetPtr (const DataMemBlock *s) const
 
void PrivateAddReference () const
 
void PrivateRemoveReference () const
 

Friends

class Data
 
class DataType
 
class DataTypeCache
 
class DataTypeLibImpl
 
class ObjectModel
 
class StrongRefHandler
 
class NonvirtualInterfaceReference
 

Member Enumeration Documentation

◆ FLAGS

enum FLAGS
strongprotected
Enumerator
NONE 
GLOBALLY_REFERENCED 

The data type is globally referenced and AddReference() and RemoveReference() should not access its reference counter.

OWNS_NULL_VALUE 

Constructor & Destructor Documentation

◆ DataTypeImpl() [1/4]

DataTypeImpl ( const Id type,
const DataTypeImpl underlying,
const DataTypeImpl element,
const T *  nullValue,
const C *  dummy,
VALUEKIND  flags = VALUEKIND::NONE,
const NonvirtualInterfaceImplementation *  impl = nullptr,
VALUEKIND  kind = ValueKindHelper<T, GetDirectlyReferencedType<T>::value>::KIND,
const ParametricTypeInterface pt = nullptr,
const DataTypeImpl extra = nullptr 
)

Constructs a DataTypeImpl for T and sets the functions pointers to the implementations found in C.

Template Parameters
TType which this DataType shall represent.
CClass which implements the DataType functions as static functions.
Parameters
[in]typeUnique id of the data type.
[in]underlyingThe underlying, layout-compatible type, may be nullptr.
[in]elementThe element type (used e.g. for arrays or pointers), may be nullptr.
[in]nullValuePointer to a default-constructed object of type T. The lifetime needs to be longer than the lifetime of the constructed DataTypeImpl object.
[in]dummyDummy variable to determine C.
[in]flagsExtra flags for the VALUEKIND of the datatype.
[in]implPointer to the implementation if the datatype stands for a non-virtual interface, otherwise nullptr.
[in]kindThe VALUEKIND of the datatype, by default set to the value determined by ValueKindHelper.

◆ DataTypeImpl() [2/4]

DataTypeImpl ( const Id type,
const DataTypeImpl underlying,
const DataTypeImpl element,
const void *  nullValue,
Int  size,
Int  alignment,
const C *  dummy,
VALUEKIND  kind,
const ParametricTypeInterface pt = nullptr,
const DataTypeImpl extra = nullptr 
)

Constructs a DataTypeImpl and sets the functions pointers to the implementations found in C.

Template Parameters
CClass which implements the DataType functions as static functions.
Parameters
[in]typeUnique id of the data type.
[in]underlyingThe underlying, layout-compatible type, may be nullptr.
[in]elementThe element type (used e.g. for arrays or pointers), may be nullptr.
[in]nullValuePointer to a default-constructed object of the type. The lifetime needs to be longer than the lifetime of the constructed DataTypeImpl object.
[in]sizeThe size of the type.
[in]alignmentThe alignment of the type.
[in]dummyDummy variable to determine C.
[in]kindThe complete VALUEKIND of the datatype.
[in]ptThe parametric type which instantiates the DataType, may be nullptr.

◆ DataTypeImpl() [3/4]

◆ DataTypeImpl() [4/4]

DataTypeImpl ( const DataTypeImpl src,
const Id typeId,
VALUEKIND  qualification,
const ParametricTypeInterface pt,
VALUEKIND  remove = VALUEKIND::NONE,
Bool  copyTypeArgs = true,
const DataTypeImpl element = nullptr 
)

◆ ~DataTypeImpl()

~DataTypeImpl ( )
protected

Member Function Documentation

◆ GetId()

const Id& GetId ( ) const

Returns the identifier of this data type. Data type identifiers of primary types look like int32, pointer types are identified by a * suffix as in {float64*}, tuple types by a parenthesized list of its member types as in {(int32,float64*)}.

Returns
Unique identifier of this type.

◆ ToString() [1/2]

String ToString ( const FormatStatement formatStatement = nullptr) const

Returns a String representation of this @CLASS.

Parameters
[in]formatStatementNullptr or additional formatting instruction.
Returns
String representation of this @CLASS.

◆ GetSize()

Int GetSize ( ) const

Returns the size of values of this data type.

Returns
Size of values.

◆ GetAlignment()

Int GetAlignment ( ) const

Returns the alignment of values of this data type. This might by an extended alignment.

Returns
Alignment of values.

◆ GetValueKind()

VALUEKIND GetValueKind ( ) const

Returns the kind of values of this data type. This is a coarse classification to distinguish between e.g. value types, pointers, references, arrays and tuples.

Returns
Kind of values.

◆ CheckValueKind()

Bool CheckValueKind ( VALUEKIND  test) const

Tests the value kind of this data type for the given flags (by using the bitwise and).

Parameters
[in]testThe flags to test.
Returns
True if the value kind of this data type has one of the given flags, false otherwise.

◆ GetUnqualifiedType()

const DataTypeImpl* GetUnqualifiedType ( ) const

Returns the unqualified type of this data type. Currently the only possible qualification is a const qualification. So when this data type represents const T, the returned data type represents T. If the type is already an unqualified type, this functions returns the type itself.

Returns
This type with any qualifications removed (or this type itself if it is already unqualified).

◆ GetUnderlyingType()

const DataType& GetUnderlyingType ( ) const

Returns the underlying type of this data type. The underlying data type is a layout-compatible more fundamental type, such as the unqualified version T for const T, or the tuple type Tuple<T, T, T> for Vec3<T>.

Returns
The underlying type of this type, or nullptr.

◆ GetElementType()

const DataType& GetElementType ( ) const

Returns the element type of this data type. The element type is used for some parametric types such as pointers or references, so for example the element type of {T*} or {StrongRef<T>} is T.

Returns
The element type of this type, or nullptr.

◆ GetDecayedType()

const DataTypeImpl* GetDecayedType ( ) const

Returns the decayed type of this data type (in the sense of std::decay). I.e., at first this removes any l- or r-value-reference-qualification, and then it returns the unqualified type of the result.

Returns
The decayed type of this type, maybe this type itself.

◆ HasTypeArguments()

Bool HasTypeArguments ( ) const

Returns true if this data type has valid type arguments, so that it is legal to call GetTypeArguments(). Even with HasTypeArguments() returning true, GetTypeArguments().count can be 0 for types like ArrayContainer<>. Hence one often has to perform this kind of double validation.

if (type.HasTypeArguments() && type.GetTypeArguments().count > 0)
{
auto firstMemberType = type.GetTypeArguments().args[0];
// ...
}
PyObject ** type
Definition: pycore_pyerrors.h:34
Returns
True if this type has valid type arguments, false otherwise.

◆ GetTypeArguments()

const TypeArguments& GetTypeArguments ( ) const

Returns the type arguments of this data type. Type arguments are set for some instantiations of parametric types. For example, the 3-dimensional Vector is an instantiation of the parametric type Vec with the arguments (Float, 3).

Returns
The type arguments of this type.

◆ GetParametricType()

const ParametricTypeInterface* GetParametricType ( ) const

Returns the parametric type which instantiated this type. For example if this type is Vector, the function returns the parametric type Vec.

Returns
The parametric type which instantiated this type, or nullptr.

◆ GetSimdInfo()

const SimdInfo& GetSimdInfo ( ) const

Returns the SimdInfo of this type. This type has to be a SIMD type (or a qualified version thereof), otherwise the behavior is undefined.

Returns
SimdInfo of this type.

◆ GetImplementation()

const NonvirtualInterfaceImplementation* GetImplementation ( ) const

Returns the interface implementation of this type as nullptr-terminated array. This function may only be invoked if this type is an interface type.

Returns
The interface implementation of this interface type.

◆ GetInterfaces()

const InterfaceDefinition* const* GetInterfaces ( ) const

Returns the interfaces of this object type as nullptr-terminated array. This function may only be invoked if this type is an object type.

Returns
The interfaces of this object type.

◆ GetNullValue()

const Generic* GetNullValue ( ) const

Returns a pointer to a default-constructed object of this type.

Returns
Pointer to default-constructed object of this type, or nullptr in case of an error (for example if type is abstract).

◆ Create()

Result<void*> Create ( ) const

Creates a new instance of this type.

  • If this type is a non-virtual interface, the new instance will be created by NewObj.
  • If this type is an array type TODO: (Ole) implement
  • If this type is a virtual interface type, an error is returned because only classes can be instantiated, not interfaces.
  • Otherwise, the new instance will be initialized by the default constructor. For reference types, this means that the reference will point to nullptr.
    Returns
    New instance of this data type. The caller owns the new instance.

◆ Construct() [1/2]

void Construct ( void *  dest) const

Construct a value of this type starting at dest. Each value will be constructed using its default constructor.

Parameters
[in,out]destPointer to the value.

◆ Construct() [2/2]

void Construct ( void *  dest,
Int  dstride,
Int  count 
) const

Constructs count values of this type starting at dest. Each value will be constructed using its default constructor.

Parameters
[in,out]destPointer to the destination array.
[in]dstrideStride in bytes between consecutive elements.
[in]countNumber of values to construct in the destination array.

◆ Destruct() [1/2]

void Destruct ( const void *  dest) const

Destructs a value of this type starting at dest.

Parameters
[in,out]destPointer to the value.

◆ Destruct() [2/2]

void Destruct ( const void *  dest,
Int  dstride,
Int  count 
) const

Destructs count values of this type starting at dest.

Parameters
[in,out]destPointer to the destination array.
[in]dstrideStride in bytes between consecutive elements.
[in]countNumber of values to destruct in the destination array.

◆ MoveConstruct() [1/2]

void MoveConstruct ( void *  dest,
void *  src 
) const

Move-constructs a value of this type at dest using the source value at src. This will be done by the move constructor of the underlying type which might modify src.

Parameters
[in,out]destPointer to the destination value.
[in,out]srcPointer to the source value.

◆ MoveConstruct() [2/2]

void MoveConstruct ( void *  dest,
Int  dstride,
void *  src,
Int  sstride,
Int  count 
) const

Move-constructs count values of this type starting at dest using source values starting at src. This will be done by the move constructor of the underlying type which might modify src.

Parameters
[in,out]destPointer to the destination array.
[in]dstrideStride in bytes between consecutive destination elements.
[in,out]srcPointer to the source array.
[in]sstrideStride in bytes between consecutive source elements.
[in]countNumber of values to move-construct in the destination array.

◆ MoveFrom() [1/2]

void MoveFrom ( void *  dest,
void *  src 
) const

Moves a value of this type at dest from the source value at src. This will be done by the move assignment operator of the underlying type which might modify src. The objects must not overlap.

Parameters
[in,out]destPointer to the destination value.
[in,out]srcPointer to the source value.
Warning
The objects pointed to by #dest and src must not overlap.

◆ MoveFrom() [2/2]

void MoveFrom ( void *  dest,
Int  dstride,
void *  src,
Int  sstride,
Int  count 
) const

Moves count values of this type starting at dest from source values starting at src. This will be done by the move assignment operator of the underlying type which might modify src. The blocks must not overlap.

Parameters
[in,out]destPointer to the destination array.
[in]dstrideStride in bytes between consecutive destination elements.
[in,out]srcPointer to the source array.
[in]sstrideStride in bytes between consecutive source elements.
[in]countNumber of values to move to the destination array.
Warning
The blocks pointed to by #dest and src must not overlap.

◆ CopyFrom() [1/2]

Result<void> CopyFrom ( void *  dest,
const void *  src 
) const

Copies a value of this type to dest using the source value at src. This will be done by the CopyFrom function of the underlying type if available, otherwise by the assignment operator.

Parameters
[in,out]destPointer to the destination value.
[in,out]srcPointer to the source value.
Returns
OK if all values could be copied successfully.

◆ CopyFrom() [2/2]

Result<void> CopyFrom ( void *  dest,
Int  dstride,
const void *  src,
Int  sstride,
Int  count 
) const

Copies count values of this type starting at dest using source values starting at src. This will be done by the CopyFrom function of the underlying type if available, otherwise by the assignment operator.

Parameters
[in,out]destPointer to the destination array.
[in]dstrideStride in bytes between consecutive destination elements.
[in]srcPointer to the source array.
[in]sstrideStride in bytes between consecutive source elements.
[in]countNumber of values to copy to the destination array.
Returns
OK if all values could be copied successfully.

◆ AddReference() [1/2]

void AddReference ( const void *  obj) const

Adds a reference to the given object. This increments the reference counter by one.

Parameters
[in]objPointer to an object of this data type.

◆ RemoveReference() [1/2]

void RemoveReference ( const void *  obj) const

Removes a reference from the given object and frees the object if necessary. This decrements the reference counter by one. If the counter reaches zero, the object is freed.

Parameters
[in]objPointer to an object of this data type.

◆ ToString() [2/2]

String ToString ( const void *  s,
const FormatStatement formatStatement 
) const

Returns a readable string from a value of this data type.

Parameters
[in]sPointer to the native data.
[in]formatStatementThe formatting instruction.
Returns
Readable string for the data value.

◆ IsEqual()

Bool IsEqual ( const void *  s1,
const void *  s2,
EQUALITY  equality 
) const

Compares two values of this data type for equality.

Parameters
[in]s1Pointer to the native data of argument 1.
[in]s2Pointer to the native data of argument 2.
[in]equalityMode of comparison.
Returns
Returns if both values are equal.

◆ Compare()

COMPARERESULT Compare ( const void *  s1,
const void *  s2 
) const

Compares two values of this data type.

Parameters
[in]s1Pointer to the native data of argument 1.
[in]s2Pointer to the native data of argument 2.
Returns
Result of the comparison.

◆ GetHashCode()

HashInt GetHashCode ( const void *  s1) const

Get the HashCode of the value of this data type.

Parameters
[in]s1Pointer to the native data of argument.
Returns
Returns 0 if no hascode could be calculated for this datatype, otherwise the hash code.

◆ GetUniqueHashCode()

UniqueHash GetUniqueHashCode ( const void *  s1) const

◆ DescribeIO()

Result<void> DescribeIO ( const DataSerializeInterface stream) const

Describe all elements of this datatype for I/O operations.

Parameters
[in]streamThe stream that is used to register the class members.
Returns
OK on success.

◆ PrivateRegister()

Result<void> PrivateRegister ( ) const

◆ PrivateSetStructType()

void PrivateSetStructType ( const TupleDataType tupleType,
const Int offsets 
)

◆ PrivateSetTypeArgs()

void PrivateSetTypeArgs ( StrongRef< const TypeArguments > &&  args)

◆ PrivateGetExtraType()

const StrongRef<const DataTypeImpl>& PrivateGetExtraType ( ) const

◆ InitializeNullValue()

Result<void> InitializeNullValue ( )

◆ MAXON_ENUM_FLAGS_CLASS()

enum maxon::DataTypeImpl::FLAGS MAXON_ENUM_FLAGS_CLASS ( FLAGS  )
protected

◆ ResetRefs()

void ResetRefs ( )
protected

◆ ResetNullValue()

void ResetNullValue ( )
protected

◆ MAXON_DISALLOW_COPY_AND_ASSIGN()

MAXON_DISALLOW_COPY_AND_ASSIGN ( DataTypeImpl  )
protected

◆ AddReference() [2/2]

void AddReference ( ) const
protected

◆ RemoveReference() [2/2]

void RemoveReference ( ) const
protected

◆ InitData()

Result<void> InitData ( DataMemBlock mem) const
private

Constructs a memory block. If the value fits in a DataMemBlock, you can use the DataMemBlock memory directly with a placement new. Otherwise you need to allocate your own memory and store its pointer in the DataMemBlock.

Parameters
[out]memPointer to the memory block.
Returns
True if the initialization succeeded.

◆ FreeData()

void FreeData ( DataMemBlock mem) const
private

Destructs and frees a memory block. If the value fits in a DataMemBlock, you can use the DataMemBlock memory directly with a placement delete. Otherwise you need to delete your own memory which has been allocated previously by one of the Init functions.

Parameters
[in,out]memPointer to the memory block.

◆ CopyData()

Result<void> CopyData ( DataMemBlock d,
const DataMemBlock s 
) const
private

Copies a Data memory block to another (existing and initialized) memory block.

Parameters
[in]sSource pointer to the memory block.
[in,out]dDestination pointer to the memory block.
Returns
OK on success.

◆ InitCopyData()

Result<void> InitCopyData ( DataMemBlock d,
const DataMemBlock s 
) const
private

Copies a Data memory block into a new memory block.

Parameters
[in]sSource pointer to the memory block.
[in,out]dDestination pointer to the memory block.
Returns
OK on success.

◆ MoveData()

void MoveData ( DataMemBlock d,
DataMemBlock s 
) const
private

Moves a Data memory block to another (existing and initialized) memory block.

Parameters
[in]sSource pointer to the memory block. The value will be moved into the destination, the source will be reset to empty data.
[in,out]dDestination pointer to the memory block.

◆ InitMoveData()

void InitMoveData ( DataMemBlock d,
DataMemBlock s 
) const
private

Move constructs a Data memory block from another block.

Parameters
[in]sSource pointer to the memory block. The value will be moved into the destination, the source will be reset to empty data.
[in,out]dDestination pointer to the memory block.

◆ IsEqualData()

Bool IsEqualData ( const DataMemBlock s1,
const DataMemBlock s2,
EQUALITY  equality 
) const
private

Compares two values of this data type for equality.

Parameters
[in]s1Pointer to the native data of argument 1.
[in]s2Pointer to the native data of argument 2.
Returns
Returns if both values are equal.

◆ GetPtr()

const void* GetPtr ( const DataMemBlock s) const
private

Extracts the pointer to the native data from a memory block.

Parameters
[in]sPointer to the memory block.
Returns
Pointer to the native data.

◆ PrivateAddReference()

void PrivateAddReference ( ) const
private

◆ PrivateRemoveReference()

void PrivateRemoveReference ( ) const
private

Friends And Related Function Documentation

◆ Data

friend class Data
friend

◆ DataType

friend class DataType
friend

◆ DataTypeCache

friend class DataTypeCache
friend

◆ DataTypeLibImpl

friend class DataTypeLibImpl
friend

◆ ObjectModel

friend class ObjectModel
friend

◆ StrongRefHandler

friend class StrongRefHandler
friend

◆ NonvirtualInterfaceReference

friend class NonvirtualInterfaceReference
friend

Member Data Documentation

◆ _id

const Id _id
protected

Name of the data type.

◆ _size

const Int _size
protected

Size of the data type.

◆ _alignment

const Int _alignment
protected

Alignment of the data type.

◆ _valueKind

VALUEKIND _valueKind
protected

Value kind.

◆ _flags

FLAGS _flags
protected

◆ _underlying

StrongRef<const DataTypeImpl> _underlying
protected

underlying data type (a layout-compatible more fundamental type, such as the unqualified version or an underlying tuple type)

◆ _elementType

StrongRef<const DataTypeImpl> _elementType
protected

The element type, used for parametric types which have exactly one type parameter (such as Block<T>, Result<T>, BaseArray<T>).

◆ _extraType

StrongRef<const DataTypeImpl> _extraType
protected

An additional type-specific base type.

◆ _parametricType

const ParametricTypeInterface* _parametricType
protected

Used for instantiations of parametric types.

◆ _implementation

const NonvirtualInterfaceImplementation* _implementation

The interface implementation. Only valid for kind NONVIRTUAL_INTERFACE.

◆ _interfaces

const InterfaceDefinition* const* _interfaces

nullptr-terminated array of virtual interfaces (excluding ObjectInterface), owned by this DataType. Only valid for kind VIRTUAL_INTERFACE.

◆ _typeArgs

const TypeArguments* _typeArgs

Pointer to the type arguments, uses a strong reference.

◆ 

union { ... } MAXON_ENUM_FLAGS_CLASS

◆ _conversions

const void* _conversions[3]
protected

This storage is used for a BaseArray<Tuple<DataType, Conversion>> which contains the registered conversion functions.

◆ _nullValue

const Generic* _nullValue
protected

Pointer to the null value of the type.

◆ _construct

void(* const _construct) (const DataTypeImpl *type, void *dest, Int dstride, Int count)
protected

◆ _destruct

void(* const _destruct) (const DataTypeImpl *type, const void *dest, Int dstride, Int count)
protected

◆ _moveConstruct

void(* const _moveConstruct) (const DataTypeImpl *type, void *dest, Int dstride, void *src, Int sstride, Int count)
protected

◆ _moveFrom

void(* const _moveFrom) (const DataTypeImpl *type, void *dest, Int dstride, void *src, Int sstride, Int count)
protected

◆ _copyFrom

Result<void>(* const _copyFrom) (const DataTypeImpl *type, void *dest, Int dstride, const void *src, Int sstride, Int count)
protected

◆ _addReference

void(* const _addReference) (const DataTypeImpl *type, const void *obj)
protected

◆ _removeReference

void(* const _removeReference) (const DataTypeImpl *type, const void *obj)
protected

◆ _toString

String(* const _toString) (const DataTypeImpl *type, const void *s, const FormatStatement *formatStatement)
protected

◆ _isEqual

Bool(* const _isEqual) (const DataTypeImpl *type, const void *s1, const void *s2, EQUALITY equality)
protected

◆ _compare

COMPARERESULT(* const _compare) (const DataTypeImpl *type, const void *s1, const void *s2)
protected

◆ _getHashCode

HashInt(* const _getHashCode) (const DataTypeImpl *type, const void *s1)
protected

◆ _getUniqueHashCode

UniqueHash(* const _getUniqueHashCode) (const DataTypeImpl *type, const void *s1)
protected

◆ _describeIO

Result<void>(* _describeIO) (const DataTypeImpl *type, const DataSerializeInterface &stream)
protected

◆ _newInstance

Result<void*>(* const _newInstance) (const DataTypeImpl *type)
protected

◆ _initData

Result<void>(* const _initData) (const DataTypeImpl *type, DataMemBlock *mem)
protected

◆ _freeData

void(* const _freeData) (const DataTypeImpl *type, DataMemBlock *mem)
protected

◆ _copyData

Result<void>(* const _copyData) (const DataTypeImpl *type, DataMemBlock *d, const DataMemBlock *s)
protected

◆ _initCopyData

Result<void>(* const _initCopyData) (const DataTypeImpl *type, DataMemBlock *d, const DataMemBlock *s)
protected

◆ _moveData

void(* const _moveData) (const DataTypeImpl *type, DataMemBlock *d, DataMemBlock *s)
protected

◆ _initMoveData

void(* const _initMoveData) (const DataTypeImpl *type, DataMemBlock *d, DataMemBlock *s)
protected

◆ _getPtr

const void*(* const _getPtr) (const DataTypeImpl *type, const DataMemBlock *s)
protected

◆ _isEqualData

Bool(* const _isEqualData) (const DataTypeImpl *type, const DataMemBlock *s1, const DataMemBlock *s2, EQUALITY equality)
protected