init
This commit is contained in:
commit
444f800536
122 changed files with 17137 additions and 0 deletions
7
Chapter01/03_Taskflow/CMakeLists.txt
Normal file
7
Chapter01/03_Taskflow/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
cmake_minimum_required(VERSION 3.19)
|
||||
project(Chapter01)
|
||||
include(../../CMake/CommonMacros.txt)
|
||||
SETUP_APP(Ch01_03_Taskflow "Chapter 01")
|
||||
|
||||
target_include_directories(Ch01_03_Taskflow PUBLIC ${CMAKE_SOURCE_DIR})
|
||||
target_link_libraries(Ch01_03_Taskflow SharedUtils)
|
||||
17
Chapter01/03_Taskflow/src/main.cpp
Normal file
17
Chapter01/03_Taskflow/src/main.cpp
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#include <cstdio>
|
||||
#include <taskflow/taskflow.hpp>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
tf::Executor executor;
|
||||
tf::Taskflow taskflow;
|
||||
|
||||
auto [A, B, C, D] = taskflow.emplace(
|
||||
[]() { std::cout << "TaskA\n"; }, []() { std::cout << "TaskB\n"; },
|
||||
[]() { std::cout << "TaskC\n"; }, []() { std::cout << "TaskD\n"; });
|
||||
|
||||
A.precede(B, C);
|
||||
D.succeed(B, C);
|
||||
|
||||
executor.run(taskflow).wait();
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue