FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cpp-taskflow/example/observer.cpp at master · femperor/cpp-taskflow · GitHub
femperor
/
cpp-taskflow
Public
forked from
taskflow/taskflow
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cpp-taskflow
/
example
/
observer.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
43 lines (32 loc) · 935 Bytes
Breadcrumbs
cpp-taskflow
/
example
/
observer.cpp
Copy path
File metadata and controls
43 lines (32 loc) · 935 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
35
36
37
38
39
40
41
42
//
Demonstrates the use of observer to monitor worker activities
#
include
<
taskflow/taskflow.hpp
>
int
main
(){
tf::Executor executor;
//
Create a taskflow of eight tasks
tf::Taskflow taskflow;
auto
[A, B, C, D, E, F, G, H] = taskflow.
emplace
(
[] () { std::cout <<
"
1
\n
"
; },
[] () { std::cout <<
"
2
\n
"
; },
[] () { std::cout <<
"
3
\n
"
; },
[] () { std::cout <<
"
4
\n
"
; },
[] () { std::cout <<
"
5
\n
"
; },
[] () { std::cout <<
"
6
\n
"
; },
[] () { std::cout <<
"
7
\n
"
; },
[] () { std::cout <<
"
8
\n
"
; }
);
A.
name
(
"
A
"
);
B.
name
(
"
B
"
);
C.
name
(
"
C
"
);
D.
name
(
"
D
"
);
E.
name
(
"
E
"
);
F.
name
(
"
F
"
);
G.
name
(
"
G
"
);
H.
name
(
"
H
"
);
//
create a default observer
auto
observer = executor.
make_observer
<tf::ExecutorObserver>();
//
run the taskflow
executor.
run
(taskflow).
get
();
//
dump the execution timeline to json (view at chrome://tracing)
observer->
dump
(std::cout);
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL