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

#include <callback.h>

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

Public Member Functions

 Callback (T *object, TMethod method)
 
void operator() (S data) override
 
- Public Member Functions inherited from Common::BaseCallback< void * >
virtual void operator() (void * data)=0
 

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:

pointerToMyClassObject,
&MyClass::myMethod
)
Definition: callback.h:91

Member Function Documentation

◆ operator()()

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

Type of the object passed to the operator.


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