diff --git a/uppsrc/Core/Callback.h b/uppsrc/Core/Callback.h index 785245b90..a7c1c1ce9 100644 --- a/uppsrc/Core/Callback.h +++ b/uppsrc/Core/Callback.h @@ -100,6 +100,23 @@ Callback1 callback1(const Object *object, void (M::*method)(P1, P) const, T (object, method, arg)); } +template +struct GateMethodActionArg1 : public Gate1Action { + OBJECT_ *object; + METHOD_ method; + T arg; + bool Execute(P1 p1) { return (object->*method)(p1, arg); } + + GateMethodActionArg1(OBJECT_ *object, METHOD_ method, T arg) + : object(object), method(method), arg(arg) {} +}; + +template +Gate1 callback1(Object *object, bool (M::*method)(P1, P), T arg) { + return Gate1(new GateMethodActionArg1 + (object, method, arg)); +} + template struct CallbackActionCallArg1 : Callback1Action { F fn;