15 #ifndef __FunctionPointers_h_ 16 #define __FunctionPointers_h_ 26 template <
typename TReturn>
36 virtual TReturn operator() () = 0;
39 template<
typename TObject,
typename TReturn>
43 typedef TReturn (TObject::*TFunctor)(void);
45 : Instance(instance), FunctionPtr(functionPtr)
50 TReturn operator() ()
override 51 {
return (this->Instance->*this->FunctionPtr)(); }
58 template<
typename TObject,
typename TReturn,
typename TArg1>
62 typedef TReturn (TObject::*TFunctor)(TArg1);
64 : Instance(instance), FunctionPtr(functionPtr), Arg1(arg1)
69 TReturn operator() ()
override 70 {
return (this->Instance->*this->FunctionPtr)(this->Arg1); }
78 template<
typename TObject,
typename TReturn,
typename TArg1,
typename TArg2>
82 typedef TReturn (TObject::*TFunctor)(TArg1, TArg2);
84 TArg1 arg1, TArg2 arg2)
85 : Instance(instance), FunctionPtr(functionPtr), Arg1(arg1), Arg2(arg2)
90 TReturn operator() ()
override 91 {
return (this->Instance->*this->FunctionPtr)(this->Arg1, this->Arg2); }
100 template<
typename TObject,
typename TReturn,
typename TArg1,
typename TArg2,
105 typedef TReturn (TObject::*TFunctor)(TArg1, TArg2, TArg3);
107 TArg1 arg1, TArg2 arg2, TArg3 arg3)
108 : Instance(instance), FunctionPtr(functionPtr), Arg1(arg1), Arg2(arg2),
114 TReturn operator() ()
override 116 return (this->Instance->*this->FunctionPtr)
117 (this->Arg1, this->Arg2, this->Arg3);
122 TFunctor FunctionPtr;
virtual ~MemberFunction3Args()
virtual ~MemberFunction1Arg()
virtual ~MemberFunction0Args()
virtual ~MemberFunction2Args()
MemberFunction2Args(TObject *instance, TFunctor functionPtr, TArg1 arg1, TArg2 arg2)
MemberFunction0Args(TObject *instance, TFunctor functionPtr)
virtual void ExecVoid()=0
MemberFunction3Args(TObject *instance, TFunctor functionPtr, TArg1 arg1, TArg2 arg2, TArg3 arg3)
MemberFunction1Arg(TObject *instance, TFunctor functionPtr, TArg1 arg1)