43template<
typename Func>
44requires std::invocable<Func, Core::NodePtr>
58 , _func {
std::move(func) }
71 auto node = _node.lock();
76 std::lock_guard lock(*node);
96template<
typename Func,
typename ... Args>
99 return std::make_unique<NodeTask<std::decay_t<Func>>>(std::forward<Func>(func), std::forward<Args>(args)...);
Base class for all runtime-executed nodes in a dfx dataflow graph.
void run() override
Execute the callable if the node is still alive, under the node lock.
Definition NodeTask.hpp:69
NodeTask(Func func, Core::NodeWPtr node, int priority=0)
Construct a node-bound task.
Definition NodeTask.hpp:55
int priority() const noexcept
Task scheduling priority.
Definition Task.hpp:67
Task(int priority=0)
Construct a task with a given scheduling priority.
Definition Task.hpp:55
std::weak_ptr< Node > NodeWPtr
Weak pointer type for Nodes.
Definition Node.hpp:63
auto makeNodeTask(Func &&func, Args &&... args)
Helper to create a NodeTask with type decay.
Definition NodeTask.hpp:97