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).

Inheritance diagram

Inheritance

Parent Class:

Children Classes:

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

IsEmpty()

Checks if a Data is empty.

IsNullValue()

Checks if the data is a NullValue.

MaxonConvert([expected])

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

ToString()

Returns a string representation of the content.

__copy__()

Used by copy.copy.

__deepcopy__(memo)

Used by copy.deepcopy.

__eq__(b)

Performs an equality comparison.

__ge__(b)

Performs a greater or equal than comparison.

__gt__(b)

Performs a greater than comparison.

__hash__()

Returns the hash code of a data.

__init__([C])

Initializes the appropriate C++ Data object and store it within the _data member.

__le__(b)

Performs a lesser or equal than comparison.

__lt__(a)

Performs a lesser than comparison.

__maxon_convert__([expected])

__ne__(b)

Performs an inequality comparison.

__repr__()

Returns the string representation of a data.

__str__()

Returns the string representation of a data.

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

int

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.IsEmpty()

Checks if a Data is empty.

Returns

True if it doesn’t contain any data otherwise False.

Return type

bool

Data.IsNullValue()

Checks if the data is a NullValue.

Returns

True if the represented Data is a NullValue otherwise False.

Return type

bool

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.__copy__()

Used by copy.copy. May fail if the C++ Data does not implement a logic for copying itself.

Data.__deepcopy__(memo)

Used by copy.deepcopy. May fail if the C++ Data does not implement a logic for copying itself.

Data.__eq__(b)

Performs an equality comparison. It may not work since not all data implement the Compare method.

Parameters

b (maxon.Data) – The other data to compare against

Returns

True if other is equal to the current value, otherwise False.

Return type

bool

Data.__ge__(b)

Performs a greater or equal than comparison. It may not work since not all data implement the Compare method.

Parameters

b (maxon.Data) – The other data to compare against.

Returns

True if other is greater or equal than current value, otherwise False.

Return type

bool

Data.__gt__(b)

Performs a greater than comparison. It may not work since not all data implement the Compare method.

Parameters

b (maxon.Data) – The other data to compare against.

Returns

True if other is greater than current value, otherwise False.

Return type

bool

Data.__hash__()

Returns the hash code of a data.

Data.__init__(C=None)

Initializes the appropriate C++ Data object and store it within the _data member.

If C is a Data then _data store a copy the C++ Data is done and stored.
If C is a C++ Data then _data store a reference of the C++ Data.
If C is not defined the C++ data is created and stored in the _data member.
Parameters

C (Union[None, maxon.Data]) – Input data from which the Data should be created.

Data.__le__(b)

Performs a lesser or equal than comparison. It may not work since not all data implement the Compare method.

Parameters

b (maxon.Data) – The other data to compare against.

Returns

True if other is lesser or equal than current value, otherwise False.

Return type

bool

Data.__lt__(a)

Performs a lesser than comparison. It may not work since not all data implement the Compare method.

Parameters

a (maxon.Data) – The other data to compare against.

Returns

True if other is lesser than current value, otherwise False.

Return type

bool

Data.__maxon_convert__(expected=None)
Data.__ne__(b)

Performs an inequality comparison. It may not work since not all data implement the Compare method.

Parameters

b (maxon.Data) – The other data to compare against

Returns

True if other is unequal to the current value, otherwise False.

Return type

bool

Data.__repr__()

Returns the string representation of a data.

Return type

str

Data.__str__()

Returns the string representation of a data.

Return type

str