#pragma once
#include "flow_builder.hpp"
/**
@file core/taskflow.hpp
@brief taskflow include file
*/
namespace tf {
// ----------------------------------------------------------------------------
/**
@class Taskflow
@brief main entry to create a task dependency graph
A %taskflow manages a task dependency graph where each task represents a
callable object (e.g., @std_lambda, @std_function) and an edge represents a
dependency between two tasks. A task is one of the following types:
1. static task : the callable constructible from
@c std::function
2. dynamic task : the callable constructible from
@c std::function
3. condition task: the callable constructible from
@c std::function
4. module task : the task constructed from tf::Taskflow::composed_of
5. %cudaFlow task: the callable constructible from
@c std::function or
@c std::function
6. %syclFlow task: the callable constructible from
@c std::function
Each task is a basic computation unit and is run by one worker thread
from an executor.
The following example creates a simple taskflow graph of four static tasks,
@c A, @c B, @c C, and @c D, where
@c A runs before @c B and @c C and
@c D runs after @c B and @c C.
@code{.cpp}
tf::Executor executor;
tf::Taskflow taskflow("simple");
tf::Task A = taskflow.emplace([](){ std::cout