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

#include <callback_caller.h>

Inheritance diagram for CallbackAttributeNotifier< T >:
CallbackMethodCallerBase

Public Types

typedef void(T::* MethodType) (void)
 Typedef for function pointer.
 

Public Member Functions

 CallbackAttributeNotifier (T *container, const AttributeName &attributeName, MethodType method=NULL)
 
virtual CallbackMethodCallerBaseDuplicate () const override
 
virtual void SetContainer (DisplayObject *container) override
 
int Call (DisplayObject *, DisplayEvent *) override
 
void CallType2 (DisplayEvent *, void *=NULL) override
 
void CallType3 () override
 Allows for a very simple callback, with no additional data passed. More...
 
virtual int Call (DisplayObject *, DisplayEvent *)
 
virtual void CallType2 (DisplayEvent *, void *=NULL)
 
virtual void CallType3 ()
 Allows for a very simple callback, with no additional data passed. More...
 
virtual CallbackMethodCallerBaseDuplicate () const
 
virtual void SetContainer (DisplayObject *container)=0
 

Protected Attributes

T * _container
 The object which contains the method to call.
 
AttributeName _attributeName
 The associated property name for the callback.
 
MethodType _method
 The function pointer to call back.
 

Detailed Description

template<class T>
class disti::CallbackAttributeNotifier< T >

A CallbackMethodCallerBase that notifies when properties are changed, and also optionally calls a void callback Version only supports method type 3

Constructor & Destructor Documentation

◆ CallbackAttributeNotifier()

CallbackAttributeNotifier ( T *  container,
const AttributeName attributeName,
MethodType  method = NULL 
)
inline

Construct a CallbackAttributeNotifier.

Parameters
containerThe object containing the callback method.
attributeNameThe attribute name to attach the callback to.
methodThe function to call back.

Member Function Documentation

◆ Call()

int Call ( DisplayObject ,
DisplayEvent  
)
inlineoverridevirtual

This is for mouse and keyboard events.

Returns
1 if event is handled, 0 otherwise.

Reimplemented from CallbackMethodCallerBase.

◆ CallType2()

void CallType2 ( DisplayEvent ,
void *  = NULL 
)
inlineoverridevirtual

This is used mostly for user events. The callbackData is generally passed in when this object is created.

Reimplemented from CallbackMethodCallerBase.

◆ CallType3()

void CallType3 ( )
inlineoverridevirtual

Allows for a very simple callback, with no additional data passed.

Reimplemented from CallbackMethodCallerBase.

◆ Duplicate()

virtual CallbackMethodCallerBase * Duplicate ( ) const
inlineoverridevirtual
Returns
A pointer to an exact copy of this callback object.

Reimplemented from CallbackMethodCallerBase.

◆ SetContainer()

virtual void SetContainer ( DisplayObject container)
inlineoverridevirtual

Assign a new object to be the target of this callback.

Parameters
containerThe new target object.

Implements CallbackMethodCallerBase.


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