maxon.ComponentRoot

Description

maxon.ComponentRoot is the base class of all components (see maxon.MAXON_COMPONENT).

Usually you don’t have to take care of this because the maxon.Component template automatically sets maxon.ComponentRoot as base class.

But if you use maxon.ComponentWithBase instead, you have to make sure that the base class you use for that template derives from maxon.ComponentRoot.

Warning

This function is only there to expose a C++ Object to Python.
As a Python developer you normally don’t have to deal with this function.

Inheritance diagram

Inheritance

Methods Signature

CreateInit(*args)
param args:
FreeComponent()
Gets called before an object gets destructed.
Get(ref)
param ref:
GetClass() Retrieve the stored class
InitComponent()
Gets called right after a new object has been constructed.
__init__([data]) x.__init__(…) initializes x; see help(type(x)) for signature

Methods Definition

classmethod ComponentRoot.CreateInit(*args)
Parameters:args
Returns:
ComponentRoot.FreeComponent()
Gets called before an object gets destructed.

You can override this function in a component class to free the component at a point of time where the whole object is still valid, so you can call methods or access other components which is not allowed in the destructor.

But keep in mind that later components might already have done clean-up in their ComponentRoot.FreeComponent() functions.
classmethod ComponentRoot.Get(ref)
Parameters:ref
Returns:
classmethod ComponentRoot.GetClass()

Retrieve the stored class

ComponentRoot.InitComponent()
Gets called right after a new object has been constructed.

You can override this function in a component class to initialize the component.
Unlike the constructor this function can return an error.

Also all components have been constructed when this function gets called, so you can call methods or access other components.
But keep in mind that only super components have been initialized.
ComponentRoot.__init__(data=None)

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