13#ifndef ML_BACKGROUND_TASK_METHOD_CALL_MESSAGE_H
14#define ML_BACKGROUND_TASK_METHOD_CALL_MESSAGE_H
26template<
class Object,
class Method,
class ArgumentList>
31 _object(object), _method(method), _args(
args) {
32 setReceiverHelper(
object);
36 if (!sender() || sender()->hasOwner()) {
47 void setReceiverHelper(
void*) {};
55template<
class Object,
class Method>
61template<
class Object,
class Method,
class Arg1>
67template<
class Object,
class Method,
class Arg1,
class Arg2>
73template<
class Object,
class Method,
class Arg1,
class Arg2,
class Arg3>
79template<
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));
85template<
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 which 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
execute message when it is delivered (reimplement in subclasses)
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
ArgumentList0 MLGenerateArgumentList()
Creates argument list with 0 arguments.
void MLCallMethodWithArguments(Object *object, Method method, const ArgumentList0 &)
Calls a method on given object with 0 arguments.
BackgroundTaskMessage * NewBackgroundTaskMethodCall(Object *object, Method method)
create new method call with 0 arguments