| GL Studio C++ Runtime API

Public Types | Public Member Functions | Protected Attributes | List of all members
CallbackMethodCallerTemplate< T, O > Class Template Reference

`#include <callback_caller.h>`

Inheritance diagram for CallbackMethodCallerTemplate< T, O >:

## Public Types
typedef int(T::* | MethodType1) (O *, DisplayEvent *)
| Typedef for functions matching base class' Call signature.
typedef void(T::* | MethodType2) (DisplayEvent *ev, void *)
| Typedef for functions matching base class' CallType2 signature.
typedef void(T::* | MethodType3) (void)
| Typedef for functions matching base class' CallType3 signature.

## Public Member Functions
| CallbackMethodCallerTemplate (MethodType1 method, T *container=NULL)
| CallbackMethodCallerTemplate (MethodType2 method, T *container, void *callbackData=NULL)
| CallbackMethodCallerTemplate (MethodType3 method, T *container)
virtual CallbackMethodCallerBase * | Duplicate () const override
virtual void | SetContainer (DisplayObject *container) override
int | Call (DisplayObject *target, DisplayEvent *ev) override
void | CallType2 (DisplayEvent *ev, void *callbackData=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 CallbackMethodCallerBase * | Duplicate () const
virtual void | SetContainer (DisplayObject *container)=0

## Protected Attributes
int | _methodType
| The method type (1, 2, or 3).
void * | _callbackData
| Only used for MethodType2.
T * | _container
| The object which contains the method to call.
union {
MethodType1 _1
MethodType2 _2
MethodType3 _3
} | _method
| The function pointer to call back.

## Detailed Description

template<class T, class O = DisplayObject>
class disti::CallbackMethodCallerTemplate< T, O >

The CallbackMethodCallerTemplate class O must be related to DisplayObject

## Constructor & Destructor Documentation

## ◆ CallbackMethodCallerTemplate() [1/3]

CallbackMethodCallerTemplate | ( | MethodType1 | method,
|  | T * | container = `NULL`
| ) |  |
| inline

Constructs a CallbackMethodCallerTemplate for MethodType1 (Call).

Parameters

  method | The function pointer to call back.
  container | The object containing the function pointer.

## ◆ CallbackMethodCallerTemplate() [2/3]

CallbackMethodCallerTemplate | ( | MethodType2 | method,
|  | T * | container,
|  | void * | callbackData = `NULL`
| ) |  |
| inline

Constructs a CallbackMethodCallerTemplate for MethodType2 (CallType2).

Parameters

  method | The function pointer to call back.
  container | The object containing the function pointer.
  callbackData | User data to include with callback.

## ◆ CallbackMethodCallerTemplate() [3/3]

CallbackMethodCallerTemplate | ( | MethodType3 | method,
|  | T * | container
| ) |  |
| inline

Constructs a CallbackMethodCallerTemplate for MethodType3 (CallType3).

Parameters

  method | The function pointer to call back.
  container | The object containing the function pointer.

## Member Function Documentation

## ◆ Call()

int Call | ( | DisplayObject * | ,
|  | DisplayEvent * |
| ) |  |
| inline override virtual

This is for mouse and keyboard events.

Returns
  1 if event is handled, 0 otherwise.

Reimplemented from CallbackMethodCallerBase.

## ◆ CallType2()

void CallType2 | ( | DisplayEvent * | ,
|  | void * | = `NULL`
| ) |  |
| inline override virtual

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

Reimplemented from CallbackMethodCallerBase.

## ◆ CallType3()

void CallType3 | ( |  | ) |
| inline override virtual

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

Reimplemented from CallbackMethodCallerBase.

## ◆ Duplicate()

virtual CallbackMethodCallerBase * Duplicate | ( |  | ) | const
| inline override virtual

Returns
  A pointer to an exact copy of this callback object.

Reimplemented from CallbackMethodCallerBase.

## ◆ SetContainer()

virtual void SetContainer | ( | DisplayObject * | container | ) |
| inline override virtual

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

Parameters

  container | The new target object.

Implements CallbackMethodCallerBase.

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

- callback_caller.h