cppexpose
1.0.0.b785e04f23b8
C++ library for type introspection, reflection, and scripting interface
|
Representation of dynamic object properties. More...
#include <cppexpose/include/cppexpose/reflection/DynamicProperty.h>
Public Member Functions | |
template<typename... Args> | |
DynamicProperty (const std::string &name, Object *parent, Args &&...args) | |
Constructor. More... | |
virtual | ~DynamicProperty () |
Destructor. More... | |
virtual bool | isObject () const override |
Public Attributes | |
Signal< const T & > | valueChanged |
Called when the value has been changed. More... | |
Protected Member Functions | |
virtual void | onValueChanged (const T &value) override |
Representation of dynamic object properties.
Dynamic properties are defined and added to an object at runtime rather than at compile time. In contrast to normal properties, they store the property value themselves instead of using getter or setter functions. Other than that, they behave exactly like normal properties.
cppexpose::DynamicProperty< T, BASE >::DynamicProperty | ( | const std::string & | name, |
Object * | parent, | ||
Args &&... | args | ||
) |
Constructor.
[in] | name | Property name (must NOT be empty!) |
[in] | parent | Parent object (can be null) |
[in] | args | Arguments for the typed value (see DirectValueSingle and DirectValueArray) |
To transfer the ownership to the parent, call this constructor with parent(nullptr), and use addProperty() on the parent object.
|
virtual |
Destructor.
|
overridevirtual |
|
overrideprotectedvirtual |
Signal<const T &> cppexpose::DynamicProperty< T, BASE >::valueChanged |
Called when the value has been changed.
Referenced by cppexpose::DynamicProperty< T, BASE >::onValueChanged().