13 #ifndef ML_TYPED_BACKGROUND_TASK_HANDLE_H
14 #define ML_TYPED_BACKGROUND_TASK_HANDLE_H
40 template <
typename Task>
82 template <
typename Method>
88 template <
typename Method,
typename Arg1>
94 template <
typename Method,
typename Arg1,
typename Arg2>
100 template <
typename Method,
typename Arg1,
typename Arg2,
typename Arg3>
106 template <
typename Method,
typename Arg1,
typename Arg2,
typename Arg3,
typename Arg4>
107 void callMethodOnTask(Method method,
const Arg1& arg1,
const Arg2& arg2,
const Arg3& arg3,
const Arg4& arg4)
109 BackgroundTaskManager::self().sendMessageToTask(typedTask(),
NewBackgroundTaskMethodCall(typedTask(), method, arg1, arg2, arg3, arg4));
112 template <
typename Method,
typename Arg1,
typename Arg2,
typename Arg3,
typename Arg4,
typename Arg5>
113 void callMethodOnTask(Method method,
const Arg1& arg1,
const Arg2& arg2,
const Arg3& arg3,
const Arg4& arg4,
const Arg5& arg5)
115 BackgroundTaskManager::self().sendMessageToTask(typedTask(),
NewBackgroundTaskMethodCall(typedTask(), method, arg1, arg2, arg3, arg4, arg5));
122 inline Task*
typedTask()
const {
return static_cast<Task*
>(_task); }
A handle to a task that has been created by the background task manager.
The TypedBackgroundTaskHandle class provides a secure interface to communicate with a running Backgro...
TypedBackgroundTaskHandle & operator=(Task *task)
TypedBackgroundTaskHandle(Task *task)
void callMethodOnTask(Method method, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
Task TaskType
Typedef to access the type of the stored task.
void callMethodOnTask(Method method, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
void callMethodOnTask(Method method, const Arg1 &arg1, const Arg2 &arg2)
void callMethodOnTask(Method method, const Arg1 &arg1)
void callMethodOnTask(Method method)
Task * typedTask() const
Returns access to the typed task value.
TypedBackgroundTaskHandle()
void callMethodOnTask(Method method, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5)
BackgroundTaskMessage * NewBackgroundTaskMethodCall(Object *object, Method method)
Creates a new method call with zero arguments.