tf::Subflow
tf::FlowBuilder
tf::Runtime
taskflow/core/flow_builder.hpp
class friend class Executor Executor Executor
class friend class FlowBuilder FlowBuilder FlowBuilder
class friend class Runtime Runtime Runtime
bool bool tf::Subflow::_joinable _joinable {true}
void void tf::Subflow::join () 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

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.

void void tf::Subflow::reset (bool clear_graph=true) reset bool clear_graph true

resets the subflow to a joinable state

clear_graph

specifies whether to clear the associated graph (default `true`)

Clears the underlying task graph depending on the given variable `clear_graph` (default `true`) and then updates the subflow to a joinable state.
bool bool tf::Subflow::joinable () const noexcept 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
    });

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

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

tf::Subflow is a derived class from tf::Runtime with a specialized mechanism to manage the execution of a child graph. By default, a subflow automatically joins its parent node. You may explicitly join or detach a subflow by calling tf::Subflow::join or tf::Subflow::detach, respectively. 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::Runtime
tf::Subflow
tf::FlowBuilder
_graph
tf::Runtime
tf::Graph
tf::Subflow
- tf::Subflow
  _graph
- tf::Subflow
  _joinable
- tf::Subflow
  acquire
- tf::Subflow
  acquire
- tf::Subflow
  async
- tf::Subflow
  async
- tf::Subflow
  composed_of
- tf::Subflow
  corun
- tf::Subflow
  corun_all
- tf::Subflow
  corun_until
- tf::Subflow
  detach
- 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
  inclusive_scan
- tf::Subflow
  inclusive_scan
- tf::Subflow
  join
- tf::Subflow
  joinable
- tf::Subflow
  linearize
- tf::Subflow
  linearize
- tf::Subflow
  max_element
- tf::Subflow
  min_element
- tf::Subflow
  placeholder
- tf::Subflow
  reduce
- tf::Subflow
  release
- tf::Subflow
  release
- tf::Subflow
  reset
- tf::Subflow
  Runtime
- tf::Subflow
  schedule
- tf::Subflow
  silent_async
- tf::Subflow
  silent_async
- tf::Subflow
  silent_async_unchecked
- tf::Subflow
  silent_async_unchecked
- tf::Subflow
  sort
- tf::Subflow
  sort
- 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
- tf::Subflow
  worker
- tf::Subflow
  ~Runtime