| 838 | template <class RET> |
| 839 | template <class OTHER_RET, class FUNC, class ... ARGS> |
| 840 | ContextPtr<OTHER_RET> |
| 841 | Context<RET>::thenImpl(ITask::Type type, FUNC&& func, ARGS&&... args) |
| 842 | { |
| 843 | using FirstArg = decltype(firstArgOf(func)); |
| 844 | auto ctx = ContextPtr<OTHER_RET>(new Context<OTHER_RET>(*this), |
| 845 | Context<OTHER_RET>::deleter); |
| 846 | auto task = Task::Ptr(new Task(Traits::IsVoidContext<FirstArg>{}, |
| 847 | ctx, |
| 848 | _task->getQueueId(), //keep current queueId |
| 849 | _task->isHighPriority(), //keep current priority |
| 850 | type, |
| 851 | std::forward<FUNC>(func), |
| 852 | std::forward<ARGS>(args)...), |
| 853 | Task::deleter); |
| 854 | ctx->setTask(task); |
| 855 | |
| 856 | //Chain tasks |
| 857 | std::static_pointer_cast<ITaskContinuation>(_task)->setNextTask(task); |
| 858 | task->setPrevTask(std::static_pointer_cast<ITaskContinuation>(_task)); |
| 859 | return ctx; |
| 860 | } |
| 861 | |
| 862 | template <class RET> |
| 863 | template <class OTHER_RET, class FUNC, class ... ARGS> |
nothing calls this directly
no test coverage detected