tf::Subflow
tf::FlowBuilder
taskflow/core/flow_builder.hpp
class friend class Executor Executor tf::Subflow::Executor Executor
class friend class FlowBuilder FlowBuilder tf::Subflow::FlowBuilder FlowBuilder
size_t size_t tf::Subflow::JOINED_BIT JOINED_BIT tf::Subflow::JOINED_BIT = (~size_t(0)) ^ ((~size_t(0)) >> 1)
Executor & Executor& tf::Subflow::_executor _executor tf::Subflow::_executor
Worker & Worker& tf::Subflow::_worker _worker tf::Subflow::_worker
Node * Node* tf::Subflow::_parent _parent tf::Subflow::_parent
size_t size_t tf::Subflow::_tag _tag tf::Subflow::_tag
void void tf::Subflow::join () join tf::Subflow::join

enables the subflow to join its parent task

Performs an immediate action to join the subflow. Once the subflow is joined, it is considered finished and you may not modify the subflow anymore.

    taskflow.emplace([](tf::Subflow&sf){
    sf.emplace([](){});
    sf.join();//jointhesubflowofonetask
    });

Only the worker that spawns this subflow can join it.

void void tf::Subflow::detach () detach tf::Subflow::detach

enables the subflow to detach from its parent task

Performs an immediate action to detach the subflow. Once the subflow is detached, it is considered finished and you may not modify the subflow anymore.

    taskflow.emplace([](tf::Subflow&sf){
    sf.emplace([](){});
    sf.detach();
    });

Only the worker that spawns this subflow can detach it.

bool bool tf::Subflow::joinable () const noexcept joinable tf::Subflow::joinable

queries if the subflow is joinable

This member function queries if the subflow is joinable. When a subflow is joined or detached, it becomes not joinable.

    taskflow.emplace([](tf::Subflow&sf){
    sf.emplace([](){});
    std::cout<<sf.joinable()<<'\n';//true
    sf.join();
    std::cout<<sf.joinable()<<'\n';//false
    });

Executor & Executor & tf::Subflow::executor () noexcept executor tf::Subflow::executor

acquires the associated executor

Graph & Graph & tf::Subflow::graph () graph tf::Subflow::graph

acquires the associated graph

tf::Subflow::Subflow
(Executor &, Worker &, Node *, Graph &)
Subflow
tf::Subflow::Subflow
Executor & executor
Worker & worker
Node * parent
Graph & graph
tf::Subflow::Subflow
()=delete
Subflow
tf::Subflow::Subflow
tf::Subflow::Subflow
(const Subflow &)=delete
Subflow
tf::Subflow::Subflow
const Subflow &
tf::Subflow::Subflow
(Subflow &&)=delete
Subflow
tf::Subflow::Subflow
Subflow &&

class to construct a subflow graph from the execution of a dynamic task

tf::Subflow is spawned from the execution of a task to dynamically manage a child graph that may depend on runtime variables. You can explicitly join or detach a subflow by calling tf::Subflow::join or tf::Subflow::detach, respectively. By default, the Taskflow runtime will implicitly join a subflow it is is joinable.

The following example creates a taskflow graph that spawns a subflow from the execution of task `B`, and the subflow contains three tasks, `B1`, `B2`, and `B3`, where `B3` runs after `B1` and `B2`.

    //createthreestatictasks
    tf::TaskA=taskflow.emplace([](){}).name("A");
    tf::TaskC=taskflow.emplace([](){}).name("C");
    tf::TaskD=taskflow.emplace([](){}).name("D");

    //createasubflowgraph(dynamictasking)
    tf::TaskB=taskflow.emplace([](tf::Subflow&subflow){
    tf::TaskB1=subflow.emplace([](){}).name("B1");
    tf::TaskB2=subflow.emplace([](){}).name("B2");
    tf::TaskB3=subflow.emplace([](){}).name("B3");
    B1.precede(B3);
    B2.precede(B3);
    }).name("B");

    A.precede(B);//BrunsafterA
    A.precede(C);//CrunsafterA
    B.precede(D);//DrunsafterB
    C.precede(D);//DrunsafterC

tf::FlowBuilder
tf::Subflow
std::vector< std::unique_ptr< Node > >
tf::FlowBuilder
_graph
tf::Graph
tf::Subflow
- tf::Subflow
  _executor
- tf::Subflow
  _graph
- tf::Subflow
  _parent
- tf::Subflow
  _tag
- tf::Subflow
  _worker
- tf::Subflow
  composed_of
- tf::Subflow
  detach
- tf::Subflow
  emplace
- tf::Subflow
  emplace
- tf::Subflow
  emplace
- tf::Subflow
  emplace
- tf::Subflow
  emplace
- tf::Subflow
  emplace
- tf::Subflow
  erase
- tf::Subflow
  exclusive_scan
- tf::Subflow
  Executor
- tf::Subflow
  executor
- tf::Subflow
  find_if
- tf::Subflow
  find_if_not
- tf::Subflow
  FlowBuilder
- tf::Subflow
  FlowBuilder
- tf::Subflow
  for_each
- tf::Subflow
  for_each_index
- tf::Subflow
  graph
- tf::Subflow
  inclusive_scan
- tf::Subflow
  inclusive_scan
- tf::Subflow
  join
- tf::Subflow
  joinable
- tf::Subflow
  JOINED_BIT
- tf::Subflow
  linearize
- tf::Subflow
  linearize
- tf::Subflow
  max_element
- tf::Subflow
  min_element
- tf::Subflow
  placeholder
- tf::Subflow
  reduce
- tf::Subflow
  sort
- tf::Subflow
  sort
- tf::Subflow
  Subflow
- tf::Subflow
  Subflow
- tf::Subflow
  Subflow
- tf::Subflow
  Subflow
- tf::Subflow
  transform
- tf::Subflow
  transform
- tf::Subflow
  transform_exclusive_scan
- tf::Subflow
  transform_inclusive_scan
- tf::Subflow
  transform_inclusive_scan
- tf::Subflow
  transform_reduce
- tf::Subflow
  transform_reduce