A 2D Game Prototyping Engine
(Internal) A callback template to simplify storage/retrieval of method pointers More...
|typedef void(ClassInstance::*||FunctionPointer )(ParamType param)|
|virtual void||Execute (ParamType param) const|
|void||SetCallback (ClassInstance *instance, FunctionPointer function)|
|const ClassInstance *||GetInstance ()|
|const FunctionPointer||GetFunction ()|
Storing pointers to member functions (as opposed to just loose functions) can be complicated and error-prone. This template class is designed to make such things simpler. An example usage is in the SoundDevice class.
Note that this template only lets you store callbacks that take a single parameter.