maxon.DataType¶
Description¶
maxon.DataType
provides a set of functions which allow to operate on values of arbitrary
types in a generic way.maxon.DataType
with specific implementations of the access functions.maxon.Data
class uses maxon.DataType
to be able to store values of arbitrary type.Inheritance diagram¶
Inheritance
Methods Signature¶
|
Tests the value kind of this data type for the given flags (by using the bitwise and). |
|
Creates a new instance of this type.
|
|
Retrieves a |
Returns the alignment of values of this data type. |
|
Retrieves the kind of BaseArray used. |
|
Retrieves the constant type of the current type. |
|
Returns the element type of this data type. |
|
|
Returns the identifier of this data type.
|
Returns the initial DataType. |
|
Retrieves the pointer type of the current type. |
|
|
Returns the size of values of this data type. |
|
Returns the DataType of the current object. |
Returns the type arguments of this data type.
|
|
Returns the most atomic way for describing a parameter.
|
|
Returns the description of a parameter.
|
|
Returns the kind of values of this data type. |
|
|
Returns true if this type is the same as dt. |
Checks if the DataType is a Generic one. |
|
|
Returns the String representation of the datatype. |
|
Checks if two datatypes are equal. |
|
Initializes a datatype with the data type retrieved from |
|
TODO. |
|
TODO. |
Methods Definition¶
-
DataType.
CheckValueKind
(test)¶ Tests the value kind of this data type for the given flags (by using the bitwise and).
- Parameters
test (
maxon.VALUEKIND
) – The flags to test.- Returns
True if the value kind of this data type has one of the given flags, False otherwise.
- Return type
bool
-
DataType.
Create
()¶ - 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 TO BE DONE.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.
- Return type
Any
-
static
DataType.
Get
()¶ Retrieves a
maxon.DataType
from itsmaxon.Id
- Parameters
id (str) – The id of the datatype to search for.
lookupPythonTypes (bool) – True to look also in the python built-in datatype.
- Returns
The matched datatype.
- Type
- Raise
TypeError: If the id is not a str.
-
DataType.
GetAlignment
()¶ Returns the alignment of values of this data type. This might by an extended alignment.
- Returns
Alignment of values.
- Return type
int
-
DataType.
GetBaseArrayType
()¶ Retrieves the kind of BaseArray used.
- Returns
The DataType of the BaseArray.
- Return type
-
DataType.
GetConstType
()¶ Retrieves the constant type of the current type.
- Returns
The constant DataType.
- Return type
-
DataType.
GetElementType
()¶ Returns the element type of this data type. The element type is used for some parametric types such as pointers or references,
- Returns
The DataType of the stored elements. Can be None.
- Return type
-
DataType.
GetId
()¶ - 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.
- Return type
-
DataType.
GetNativeType
()¶ Returns the initial DataType.
- Returns
The datatype.
- Return type
-
DataType.
GetPointerType
()¶ Retrieves the pointer type of the current type.
- Returns
The pointer DataType.
- Return type
-
DataType.
GetSize
()¶ Returns the size of values of this data type.
- Returns
Size of values.
- Return type
int
-
classmethod
DataType.
GetType
()¶ Returns the DataType of the current object.
- Returns
The datatype.
- Return type
-
DataType.
GetTypeArguments
()¶ - 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.
- Return type
list(tuple(type, name))
-
DataType.
GetUnderlyingType
()¶ - Returns the most atomic way for describing a parameter.e.g: for a ColorA it’s “(float64 r,float64 g,float64 b,float64 a)”
- Returns
The underlying DataType.
- Return type
-
DataType.
GetUnqualifiedType
()¶ - Returns the description of a parameter.e.g: for a ColorA it’s “net.maxon.parametrictype.col<4,float64>”
- Returns
The unqualified DataType.
- Return type
-
DataType.
GetValueKind
()¶ 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.
- Return type
-
DataType.
Is
(dt)¶ Returns true if this type is the same as dt.
- Parameters
dt (
maxon.DataType
) – Type to compare.- Returns
True if this type is the same.
- Return type
bool
-
DataType.
IsGeneric
()¶ Checks if the DataType is a Generic one.
- Returns
True if it’s a Generic.
- Return type
bool
-
DataType.
ToString
()¶ Returns the String representation of the datatype.
- Returns
The string representation of the DataType.
- Return type
str
-
DataType.
__eq__
(other)¶ Checks if two datatypes are equal.
- Parameters
other (
maxon.Datatype
) – The other datatype.- Return type
bool
- Returns
True if datatype are equal.
-
DataType.
__init__
(dt)¶ Initializes a datatype with the data type retrieved from
maxon.DataType.Get()
.- Parameters
dt (
maxon.DataType
) – The data type to store.
-
DataType.
__repr__
()¶ TODO.
-
DataType.
__str__
()¶ TODO.