maxon.Data

Description

General maxon.Data class.
An object of this class can store every type of data as long as that type has been registered (see maxon.DataType).

Methods Signature

Create(cls, *args) Creates a Data and initializes it with the given type.
GetHashCode() Returns the HashCode of the current maxon.DataType.
GetType()
Returns the maxon.DataType which is passed to register the class via the @dec.MAXON_XXX functionss
MaxonConvert([expected]) Converts the data to the expected type (built-in).
ToString() Returns a string representation of the content.
__init__([C]) x.__init__(…) initializes x; see help(type(x)) for signature

Methods Definition

classmethod Data.Create(cls, *args)

Creates a Data and initializes it with the given type.

Parameters:
  • cls (maxon.DataType) – The datatype to create.
  • args (Any) – Optional argument to be passed to the creation.
Returns:

maxon.Data initialized to the given type on success.

Return type:

Any.

Data.GetHashCode()

Returns the HashCode of the current maxon.DataType.

Returns:The maxon.DataType hash code.
Return type:long
Data.GetType()
Returns the maxon.DataType which is passed to register the class via the @dec.MAXON_XXX functionss E.g: net.maxon.datatype.int32

If you want to know the real datatype, use maxon.Data.GetRealType.
This can indeed differ e.g. for types when a tuple or basearray is used.
In this case the array GetRealType() returns the underlying type including the template parameter
Returns:Return the DataType of the current maxon.Data.
Return type:maxon.DataType
Data.MaxonConvert(expected=None)

Converts the data to the expected type (built-in).

Parameters:expected (Any) – The expected type after the conversion.
Returns:The data converted.
Return type:Same as expected
Data.ToString()

Returns a string representation of the content.

Returns:The string representation of the content of the maxon.Data.
Return type:maxon.String
Data.__init__(C=None)

x.__init__(…) initializes x; see help(type(x)) for signature