cppexpose  1.0.0.b785e04f23b8
C++ library for type introspection, reflection, and scripting interface
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
cppexpose::DynamicProperty< T, BASE > Class Template Reference

Representation of dynamic object properties. More...

#include <cppexpose/include/cppexpose/reflection/DynamicProperty.h>

Inheritance diagram for cppexpose::DynamicProperty< T, BASE >:
Inheritance graph
[legend]
Collaboration diagram for cppexpose::DynamicProperty< T, BASE >:
Collaboration graph
[legend]

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
 

Detailed Description

template<typename T, typename BASE = AbstractProperty>
class cppexpose::DynamicProperty< T, BASE >

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.

See also
Property

Constructor & Destructor Documentation

template<typename T , typename BASE >
template<typename... Args>
cppexpose::DynamicProperty< T, BASE >::DynamicProperty ( const std::string &  name,
Object parent,
Args &&...  args 
)

Constructor.

Parameters
[in]nameProperty name (must NOT be empty!)
[in]parentParent object (can be null)
[in]argsArguments for the typed value (see DirectValueSingle and DirectValueArray)
Remarks
If parent is valid, the property is automatically added to the parent object. The ownership is not transferred, so the property has to be deleted by the caller.

To transfer the ownership to the parent, call this constructor with parent(nullptr), and use addProperty() on the parent object.

template<typename T , typename BASE >
cppexpose::DynamicProperty< T, BASE >::~DynamicProperty ( )
virtual

Destructor.

Member Function Documentation

template<typename T , typename BASE >
bool cppexpose::DynamicProperty< T, BASE >::isObject ( ) const
overridevirtual
template<typename T , typename BASE >
void cppexpose::DynamicProperty< T, BASE >::onValueChanged ( const T &  value)
overrideprotectedvirtual

Member Data Documentation

template<typename T, typename BASE = AbstractProperty>
Signal<const T &> cppexpose::DynamicProperty< T, BASE >::valueChanged

Called when the value has been changed.

Referenced by cppexpose::DynamicProperty< T, BASE >::onValueChanged().


The documentation for this class was generated from the following files: