91 template <
typename... Ts>
121 template <
typename... Ts>
159 Node* _node {
nullptr};
161 template <
typename S>
164 template <
typename S>
169 inline Task::Task(Node& node) : _node {&node} {
173 inline Task::Task(Node* node) : _node {node} {
181 template <
typename... Ts>
183 (_node->precede(*(tgts._node)), ...);
200 template <
typename... Bs>
202 (tgts._node->precede(*_node), ...);
207 template <
typename S>
208 void Task::_gather(S& tgts) {
209 for(
auto& from : tgts) {
210 from._node->precede(*_node);
215 template <
typename S>
216 void Task::_precede(S& tgts) {
217 for(
auto& to : tgts) {
218 _node->precede(*(to._node));
247 template <
typename C>
251 TF_THROW(Error::TASKFLOW,
"can't assign work to a module task");
254 _node->_work = std::forward<C>(c);
278 return _node->num_dependents();
283 return _node->num_successors();
288 return _node ==
nullptr;
366 Node* _node {
nullptr};
410 return _node->num_dependents();
415 return _node->num_successors();
425 return _node ==
nullptr;
size_t num_dependents() const
queries the number of predecessors of the task
Definition: task.hpp:277
Task & reset()
resets the task handle to point to nothing
Definition: task.hpp:266
TaskView()=default
constructs an empty task view
Task & gather(Ts &&... tasks)
adds precedence links from other tasks to this
Definition: task.hpp:201
size_t num_successors() const
queries the number of successors of the task
Definition: task.hpp:414
Definition: taskflow.hpp:5
bool empty() const
queries if the task view is empty
Definition: task.hpp:424
Task & operator=(const Task &)
replaces the contents with a copy of the other task
Definition: task.hpp:235
the class to create a task dependency graph
Definition: core/taskflow.hpp:15
const std::string & name() const
queries the name of the task
Definition: task.hpp:272
A constant wrapper class to a task node, mainly used in the tf::ExecutorObserver interface.
Definition: task.hpp:300
bool empty() const
queries if the task handle points to a task node
Definition: task.hpp:287
void reset()
resets to an empty view
Definition: task.hpp:419
Building blocks of a task dependency graph.
Definition: flow_builder.hpp:13
size_t num_successors() const
queries the number of successors of the task
Definition: task.hpp:282
Handle to modify and access a task.
Definition: task.hpp:18
Task & precede(Ts &&... tasks)
adds precedence links from this to other tasks
Definition: task.hpp:182
Task()=default
constructs an empty task
The executor class to run a taskflow graph.
Definition: executor.hpp:73
TaskView & operator=(const TaskView &other)
replaces the contents with a copy of the other task
Definition: task.hpp:386
size_t num_dependents() const
queries the number of predecessors of the task
Definition: task.hpp:409
Task & work(C &&callable)
assigns a new callable object to the task
Definition: task.hpp:248
const std::string & name() const
queries the name of the task
Definition: task.hpp:404