4 #include "flow_builder.hpp" 5 #include "topology.hpp" 17 friend class Topology;
108 assert(_topologies.empty());
118 return _graph.size();
123 return _graph.empty();
139 auto &node = _graph.emplace_back();
140 node._module = &taskflow;
157 os <<
"digraph Taskflow_";
158 if(_name.empty()) os <<
'p' <<
this;
160 os <<
" {\nrankdir=\"LR\";\n";
163 visited.insert(
this);
165 while(!stack.empty()) {
167 auto f = stack.top();
171 os <<
"subgraph cluster_";
172 if(f->_name.empty()) os <<
'p' << f;
176 os <<
"label=\"Taskflow_";
177 if(f->_name.empty()) os <<
'p' << f;
182 for(
const auto& n : f->_graph.nodes()) {
185 if(
auto module = n->_module; !module) {
190 os <<
'p' << n.get() <<
"[shape=box3d, color=blue, label=\"";
191 if(n->_name.empty()) os << n.get();
194 if(module->_name.empty()) os << module;
195 else os << module->_name;
198 if(visited.find(module) == visited.end()) {
199 visited.insert(module);
203 for(
const auto s : n->_successors) {
204 os <<
'p' << n.get() <<
"->" <<
'p' << s <<
";\n";
Taskflow()
constructs a taskflow
Definition: core/taskflow.hpp:103
Definition: taskflow.hpp:5
const std::string & name() const
queries the name of the taskflow
Definition: core/taskflow.hpp:133
void clear()
clears the associated task dependency graph
Definition: core/taskflow.hpp:112
size_t num_nodes() const
queries the number of nodes in the taskflow
Definition: core/taskflow.hpp:117
the class to create a task dependency graph
Definition: core/taskflow.hpp:15
bool empty() const
queries the emptiness of the taskflow
Definition: core/taskflow.hpp:122
std::string dump() const
dumps the taskflow in DOT format to a std::string
Definition: core/taskflow.hpp:145
tf::Task composed_of(Taskflow &taskflow)
creates a module task from a taskflow
Definition: core/taskflow.hpp:138
Building blocks of a task dependency graph.
Definition: flow_builder.hpp:13
Handle to modify and access a task.
Definition: task.hpp:18
The executor class to run a taskflow graph.
Definition: executor.hpp:88
virtual ~Taskflow()
destroy the taskflow (virtual call)
Definition: core/taskflow.hpp:107