![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Base/DataComponent.h>
Main specialization of DataComponentBase for regular types. More...
Inheritance diagram for DataComponent< T >:Main specialization of DataComponentBase for regular types.
If you need serialization, make your class T inherit from DataComponent<T> and implement the copy- constructor (T(const T&)), the copy assignment operator (T& operator=(const T&)), and the equality comparison operator (bool operator==(const T&) const / friend bool operator==(const T&, const T&)). The clone(), assign(), and equals() methods will forward to your class methods.
You also still need to implement id(), configure(), and configuration() to make your class serializable.
Example:
Public Member Functions | |
| std::unique_ptr< DataComponentBase > | clone () const override |
| Creates a clone of this data component. | |
| std::unique_ptr< Subclass > | cloneDerived () const |
| bool | assign (const DataComponentBase &other) override |
| Assigns the content of other to this data component. | |
| bool | equals (const DataComponentBase &other) const override |
| Compares this data component to other for equality. | |
Public Member Functions inherited from DataComponentBase | |
| virtual std::string | id () const =0 |
| Returns a unique string identifier for this type of data component. | |
Public Member Functions inherited from Configurable | |
| virtual void | configure (const Properties *p) |
| Configure this object instance by de-serializing the given Properties. | |
| virtual void | configuration (Properties *p) const |
| Serialize the current object configuration into the given Properties object. | |
| virtual void | configureDefaults () |
| Retrieve the properties of this object, replaces values with their defaults and sets it again. | |
| void | registerParameter (ParameterBase *param) |
| Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration(). | |
| void | unregisterParameter (const ParameterBase *param) |
| Remove the given Parameter or SubProperty from the list of registered parameters. | |
| Configurable (const Configurable &rhs) | |
| Configurable (Configurable &&rhs) noexcept | |
| Configurable & | operator= (const Configurable &) |
| Configurable & | operator= (Configurable &&) noexcept |
Additional Inherited Members | |
Public Attributes inherited from Configurable | |
| Signal | signalParametersChanged |
Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted. | |
Protected Member Functions inherited from DataComponentBase | |
| DataComponentBase (const DataComponentBase &)=default | |
| DataComponentBase & | operator= (const DataComponentBase &other)=default |
Protected Attributes inherited from Configurable | |
| std::vector< Param > | m_params |
| List of all registered Parameter and SubProperty instances. | |
|
inlineoverridevirtual |
Creates a clone of this data component.
Implements DataComponentBase.
|
inlineoverridevirtual |
Assigns the content of other to this data component.
| other | Source data component for assignment. |
Implements DataComponentBase.
|
inlineoverridevirtual |
Compares this data component to other for equality.
| other | Other data component to compare this one to. |
Implements DataComponentBase.