FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
taskflow/examples/multi_condition.cpp at master · slacy/taskflow · GitHub
slacy
taskflow
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
taskflow
/
examples
/
multi_condition.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (27 loc) · 776 Bytes
Breadcrumbs
taskflow
/
examples
/
multi_condition.cpp
Copy path
File metadata and controls
35 lines (27 loc) · 776 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
//
This program demonstrates how to use multi-condition task
//
to jump to multiple successor tasks
//
//
A ----> B
//
|
//
|---> C
//
|
//
|---> D
//
#
include
<
taskflow/taskflow.hpp
>
int
main
() {
tf::Executor executor;
tf::Taskflow
taskflow
(
"
Multi-Conditional Tasking Demo
"
);
auto
A = taskflow.
emplace
([&]() -> tf::SmallVector<
int
> {
std::cout <<
"
A
\n
"
;
return
{
0
,
2
};
}).
name
(
"
A
"
);
auto
B = taskflow.
emplace
([&](){ std::cout <<
"
B
\n
"
; }).
name
(
"
B
"
);
auto
C = taskflow.
emplace
([&](){ std::cout <<
"
C
\n
"
; }).
name
(
"
C
"
);
auto
D = taskflow.
emplace
([&](){ std::cout <<
"
D
\n
"
; }).
name
(
"
D
"
);
A.
precede
(B, C, D);
//
visualizes the taskflow
taskflow.
dump
(std::cout);
//
executes the taskflow
executor.
run
(taskflow).
wait
();
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL