13 #ifndef ML_BACKGROUND_TASK_METHOD_CALL_MESSAGE_H
14 #define ML_BACKGROUND_TASK_METHOD_CALL_MESSAGE_H
26 template<
class Object,
class Method,
class ArgumentList>
31 _object(object), _method(method), _args(args) {
32 setReceiverHelper(
object);
36 if (!sender() || sender()->hasOwner()) {
44 setReceiver(receiverArg);
47 void setReceiverHelper(
void*) {};
55 template<
class Object,
class Method>
61 template<
class Object,
class Method,
class Arg1>
67 template<
class Object,
class Method,
class Arg1,
class Arg2>
73 template<
class Object,
class Method,
class Arg1,
class Arg2,
class Arg3>
79 template<
class Object,
class Method,
class Arg1,
class Arg2,
class Arg3,
class Arg4>
81 return new BackgroundTaskMethodCallMessage<Object, Method, ArgumentList4<Arg1, Arg2, Arg3, Arg4> >(object, method,
MLGenerateArgumentList(arg1, arg2, arg3, arg4));
85 template<
class Object,
class Method,
class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5>
87 return new BackgroundTaskMethodCallMessage<Object, Method, ArgumentList5<Arg1, Arg2, Arg3, Arg4, Arg5> >(object, method,
MLGenerateArgumentList(arg1, arg2, arg3, arg4, arg5));
The background task receiver is a light-weight base class that can be inherited (e....
The base class of all background messages.
A generic message that allows to call the member function method on a given object,...
BackgroundTaskMethodCallMessage(Object *object, Method method, const ArgumentList &args)
void execute() override
Executes message when it is delivered.
ArgumentList0 MLGenerateArgumentList()
Creates argument list with zero arguments.
BackgroundTaskMessage * NewBackgroundTaskMethodCall(Object *object, Method method, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5)
Creates a new method call with five arguments.
void MLCallMethodWithArguments(Object *object, Method method, const ArgumentList0 &)
Calls a method on given object with zero arguments.