ScummVM API documentation
Common::Callback< T, S > Class Template Reference

#include <callback.h>

Inheritance diagram for Common::Callback< T, S >:
Common::BaseCallback< S >

Public Member Functions

 Callback (T *object, TMethod method)
 
void operator() (S data)
 

Protected Types

typedef void(T::* TMethod) (S)
 

Protected Attributes

T * _object
 
TMethod _method
 

Detailed Description

template<class T, typename S = void *>
class Common::Callback< T, S >

Callback<T, S> implements an object-oriented callback.

<T> stands for a class whose method you want to call. <S> is the type of the object passed to operator().

So, if you have void MyClass::myMethod(AnotherClass) method, the corresponding callback is Callback<MyClass, AnotherClass>. You can create it in the following way:

new Callback<MyClass, AnotherClass>(
pointerToMyClassObject,
&MyClass::myMethod
)

Member Function Documentation

◆ operator()()

template<class T , typename S = void *>
void Common::Callback< T, S >::operator() ( data)
inlinevirtual

Type of the object passed to the operator.

Implements Common::BaseCallback< S >.


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