forked from taskflow/taskflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebug.cpp
34 lines (26 loc) · 795 Bytes
/
debug.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// This example demonstrates how to use 'dump' method to inspect
// a taskflow graph.
#include <taskflow/taskflow.hpp>
int main(){
tf::Taskflow tf;
auto [A, B, C, D, E] = tf.silent_emplace(
[] () { std::cout << "Task A" << std::endl; },
[] () { std::cout << "Task B" << std::endl; },
[] () { std::cout << "Task C" << std::endl; },
[] () { std::cout << "Task D" << std::endl; },
[] () { std::cout << "Task E" << std::endl; }
);
A.broadcast(B, C, E);
C.precede(D);
B.broadcast(D, E);
std::cout << "[dump without name assignment]\n";
std::cout << tf.dump() << std::endl;
std::cout << "[dump with name assignment]\n";
A.name("A");
B.name("B");
C.name("C");
D.name("D");
E.name("E");
std::cout << tf.dump() << std::endl;
return 0;
}