4 #include "flow_builder.hpp" 5 #include "topology.hpp" 17 friend class Topology;
103 assert(_topologies.empty());
113 return _graph.size();
129 auto &node = _graph.emplace_back();
130 node._module = &taskflow;
147 os <<
"digraph Taskflow_";
148 if(_name.empty()) os <<
'p' <<
this;
150 os <<
" {\nrankdir=\"LR\";\n";
153 visited.insert(
this);
155 while(!stack.empty()) {
157 auto f = stack.top();
161 os <<
"subgraph cluster_";
162 if(f->_name.empty()) os <<
'p' << f;
166 os <<
"label=\"Taskflow_";
167 if(f->_name.empty()) os <<
'p' << f;
172 for(
const auto n : f->_graph.nodes()) {
175 if(
auto module = n->_module; !module) {
180 os <<
'p' << n <<
"[shape=box3d, color=blue, label=\"";
181 if(n->_name.empty()) os << n;
184 if(module->_name.empty()) os << module;
185 else os << module->_name;
188 if(visited.find(module) == visited.end()) {
189 visited.insert(module);
193 for(
const auto s : n->_successors) {
194 os <<
'p' << n <<
"->" <<
'p' << s <<
";\n";
Taskflow()
constructs a taskflow
Definition: core/taskflow.hpp:98
Definition: taskflow.hpp:5
const std::string & name() const
queries the name of the taskflow
Definition: core/taskflow.hpp:123
void clear()
clears the associated task dependency graph
Definition: core/taskflow.hpp:107
size_t num_nodes() const
queries the number of nodes in the taskflow
Definition: core/taskflow.hpp:112
the class to create a task dependency graph
Definition: core/taskflow.hpp:15
std::string dump() const
dumps the taskflow in DOT format to a std::string
Definition: core/taskflow.hpp:135
tf::Task composed_of(Taskflow &taskflow)
creates a module task from a taskflow
Definition: core/taskflow.hpp:128
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:73
virtual ~Taskflow()
destroy the taskflow (virtual call)
Definition: core/taskflow.hpp:102