Kanzi  3.9.6
Kanzi Engine API
kanzi::ObjectPropertyListenerImpl< DataType, StorageType, ParameterType > Class Template Referenceabstract

Object property listener implementation. More...

#include <kanzi/core.ui/binding/object_property_listener_impl.hpp>

Protected Member Functions

void attachLocalPropertyListener (ParameterType object, AbstractPropertyType propertyType)
 Installs local property listener. More...
 
void clearLocalPropertyListener ()
 Clears the property listener object. More...
 
void detachLocalPropertyListener (AbstractPropertyType propertyType)
 Uninstalls local property listener. More...
 
ParameterType getLocalPropertyListenerObject () const
 Gets the property object with a local property listener installed. More...
 
bool isLocalPropertyListenerInstalled () const
 Tells whether a local property listener has been installed. More...
 
virtual void localPropertyChange ()=0
 Called when local property changes. More...
 
 ObjectPropertyListenerImpl ()=default
 Constructor. More...
 
 ~ObjectPropertyListenerImpl ()
 Destructor. More...
 

Static Protected Member Functions

static void localPropertyChangeCallback (PropertyObject &, const DataType &, PropertyNotificationReason reason, void *userData)
 Property change callback for object property. More...
 

Protected Attributes

StorageType m_localPropertyListenerObject
 The object to which the local property listener has been installed. More...
 

Detailed Description

template<typename DataType, typename StorageType, typename ParameterType>
class kanzi::ObjectPropertyListenerImpl< DataType, StorageType, ParameterType >

Object property listener implementation.

Implements object property listener that reacts to changes in given property on an object. Three parameters are given. First one describes the type of the type of the property, the second and third define the passed object for attachment and the storage within the listener.

In practice, StorageType and DataType should be either:

  • PropertyObjectWeakPtr and PropertyObjectSharedPtr
  • PropertyObject* and PropertyObject&

Classes inheriting the listener implemntation must provide localPropertyChange() that is called when the property changes and getPropertyType() that returns the exact dynamic property type.

Since
Kanzi 3.7.0

Constructor & Destructor Documentation

◆ ObjectPropertyListenerImpl()

template<typename DataType, typename StorageType, typename ParameterType>
kanzi::ObjectPropertyListenerImpl< DataType, StorageType, ParameterType >::ObjectPropertyListenerImpl ( )
explicitprotecteddefault

Constructor.

◆ ~ObjectPropertyListenerImpl()

template<typename DataType, typename StorageType, typename ParameterType>
kanzi::ObjectPropertyListenerImpl< DataType, StorageType, ParameterType >::~ObjectPropertyListenerImpl ( )
inlineprotected

Destructor.

Member Function Documentation

◆ attachLocalPropertyListener()

template<typename DataType, typename StorageType, typename ParameterType>
void kanzi::ObjectPropertyListenerImpl< DataType, StorageType, ParameterType >::attachLocalPropertyListener ( ParameterType  object,
AbstractPropertyType  propertyType 
)
inlineprotected

Installs local property listener.

May not be called if the local property listener has already been installed.

Parameters
objectObject to listen.
propertyTypeProperty type to listen.

◆ detachLocalPropertyListener()

template<typename DataType, typename StorageType, typename ParameterType>
void kanzi::ObjectPropertyListenerImpl< DataType, StorageType, ParameterType >::detachLocalPropertyListener ( AbstractPropertyType  propertyType)
inlineprotected

Uninstalls local property listener.

May be called even if the local property listener has not been installed.

Parameters
propertyTypeProperty type for which to remove the listener.

◆ clearLocalPropertyListener()

template<typename DataType, typename StorageType, typename ParameterType>
void kanzi::ObjectPropertyListenerImpl< DataType, StorageType, ParameterType >::clearLocalPropertyListener ( )
inlineprotected

Clears the property listener object.

Should only be called if the local property listener object is definitely lost.

◆ localPropertyChangeCallback()

template<typename DataType, typename StorageType, typename ParameterType>
static void kanzi::ObjectPropertyListenerImpl< DataType, StorageType, ParameterType >::localPropertyChangeCallback ( PropertyObject ,
const DataType &  ,
PropertyNotificationReason  reason,
void *  userData 
)
inlinestaticprotected

Property change callback for object property.

Parameters
reasonThe property change notification reason.
userDataPointer to object property binding target runtime.

◆ isLocalPropertyListenerInstalled()

template<typename DataType, typename StorageType, typename ParameterType>
bool kanzi::ObjectPropertyListenerImpl< DataType, StorageType, ParameterType >::isLocalPropertyListenerInstalled ( ) const
inlineprotected

Tells whether a local property listener has been installed.

Returns
True if property listener is installed, false otherwise.

◆ getLocalPropertyListenerObject()

template<typename DataType, typename StorageType, typename ParameterType>
ParameterType kanzi::ObjectPropertyListenerImpl< DataType, StorageType, ParameterType >::getLocalPropertyListenerObject ( ) const
inlineprotected

Gets the property object with a local property listener installed.

Returns
Property object, may be empty.

◆ localPropertyChange()

Member Data Documentation

◆ m_localPropertyListenerObject

template<typename DataType, typename StorageType, typename ParameterType>
StorageType kanzi::ObjectPropertyListenerImpl< DataType, StorageType, ParameterType >::m_localPropertyListenerObject
protected

The object to which the local property listener has been installed.


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