MCPcopy Create free account
hub / github.com/PacktPublishing/3D-Graphics-Rendering-Cookbook / main

Function main

Chapter2/09_Taskflow/src/main.cpp:11–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include <taskflow/taskflow.hpp>
10
11int main()
12{
13 tf::Taskflow taskflow;
14
15 std::vector<int> items{ 1, 2, 3, 4, 5, 6, 7, 8 };
16
17 auto task = taskflow.for_each(
18 items.begin(), items.end(), [](int item)
19 {
20 std::cout << item;
21 }
22 );
23
24 taskflow.emplace([]() { std::cout << "\nS - Start\n"; }).name("S").precede(task);
25 taskflow.emplace([]() { std::cout << "\nT - End\n"; }).name("T").succeed(task);
26
27 {
28 std::ofstream os("taskflow.dot");
29 taskflow.dump(os);
30 }
31
32 tf::Executor executor;
33 executor.run(taskflow).wait();
34
35 return 0;
36}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected