A component implements the functions of a given interface. Different implementations of the same interface define different components. Since these different implementations implement the functionality of the same interface they may have a lot of code in common. To reduce redundant code it is possible to define a base component that can be reused in different implementations.
Such a base component is used in a component with maxon::ComponentWithBase.
This example interface allows to store multiple float values and to calculate the mean of the stored values:
Different implementations of this interface may calculate the mean value differently. But all implementations have to store an array of maxon::Float values. This functionality can be defined in a base component that is based on maxon::ComponentRoot.
A given implementation can inherit a base component by using maxon::ComponentWithBase. It can access the base functions and members.
A reference object gives access to functions implemented in both the base component and the specific component.