GL Studio C++ Runtime API
AttributeMethodCallback< T > Class Template Reference

#include <disti_metadata.h>

Inheritance diagram for AttributeMethodCallback< T >:
AttributeObserver

Public Types

typedef void(T::* Callback) (DistiAttributeBase &attr)
 Typedef for the callback function pointer.
 

Public Member Functions

 AttributeMethodCallback (T *object, Callback method)
 
void Call (DistiAttributeBase &ev) override
 
virtual bool IsValid () const override
 
virtual void Call (DistiAttributeBase &attr)=0
 
virtual bool IsValid () const =0
 

Protected Attributes

Callback _method
 Method to call back when invoked.
 
WeakRef< T > _object
 The underlying object containing the callback method.
 

Detailed Description

template<class T>
class disti::AttributeMethodCallback< T >

Template for an AttributeCallbackBase that will call a class method whenever the attribute changes. The class must implement WeakReferenceable. Don't use this directly, use CreateAttributeMethodCallback instead.

Constructor & Destructor Documentation

◆ AttributeMethodCallback()

AttributeMethodCallback ( T *  object,
Callback  method 
)
inline

Construct a new AttributeMethodCallback object to link the callback and the class containing it.

Parameters
objectThe object containing the callback method.
methodThe method to call back.

Member Function Documentation

◆ Call()

void Call ( DistiAttributeBase attr)
inlineoverridevirtual

Call the callback with the provided display event.

Parameters
attrThe attribute associated with this callback.

Implements AttributeObserver.

◆ IsValid()

virtual bool IsValid ( ) const
inlineoverridevirtual

When IsValid is false, then this AttributeObserver can be deleted.

Returns
Whether or not this observer is attached to a valid attribute.

Implements AttributeObserver.


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