MCPcopy Create free account
hub / github.com/bloomberg/quantum / thenImpl

Method thenImpl

quantum/impl/quantum_context_impl.h:840–860  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

838template <class RET>
839template <class OTHER_RET, class FUNC, class ... ARGS>
840ContextPtr<OTHER_RET>
841Context<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
862template <class RET>
863template <class OTHER_RET, class FUNC, class ... ARGS>

Callers

nothing calls this directly

Calls 5

setTaskMethod · 0.80
setNextTaskMethod · 0.80
setPrevTaskMethod · 0.80
getQueueIdMethod · 0.45
isHighPriorityMethod · 0.45

Tested by

no test coverage detected