<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.9.6" xml:lang="en-US">
  <compounddef id="classtf_1_1ScalablePipeline" kind="class" language="C++" prot="public">
    <compoundname>tf::ScalablePipeline</compoundname>
    <includes refid="pipeline_8hpp" local="no">pipeline.hpp</includes>
    <innerclass refid="structtf_1_1ScalablePipeline_1_1Line" prot="private">tf::ScalablePipeline::Line</innerclass>
    <templateparamlist>
      <param>
        <type>typename P</type>
      </param>
    </templateparamlist>
      <sectiondef kind="public-type">
      <memberdef kind="typedef" id="classtf_1_1ScalablePipeline_1af06cc645f8a7c4797ca53e274b0c7547" prot="public" static="no">
        <type>typename <ref refid="cpp/iterator/iterator_traits" kindref="compound" external="/Users/twhuang/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml">std::iterator_traits</ref>&lt; P &gt;::value_type</type>
        <definition>using tf::ScalablePipeline&lt; P &gt;::pipe_t =  typename std::iterator_traits&lt;P&gt;::value_type</definition>
        <argsstring></argsstring>
        <name>pipe_t</name>
        <qualifiedname>tf::ScalablePipeline::pipe_t</qualifiedname>
        <briefdescription>
<para>pipe type </para>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1086" column="3" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1086" bodyend="-1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="private-attrib">
      <memberdef kind="variable" id="classtf_1_1ScalablePipeline_1a22fa085403161f1054f7c06004a6ae0c" prot="private" static="no" mutable="no">
        <type><ref refid="classtf_1_1Graph" kindref="compound">Graph</ref></type>
        <definition>Graph tf::ScalablePipeline&lt; P &gt;::_graph</definition>
        <argsstring></argsstring>
        <name>_graph</name>
        <qualifiedname>tf::ScalablePipeline::_graph</qualifiedname>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1232" column="9" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1232" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="classtf_1_1ScalablePipeline_1a29cfaffe5b328370e0fc5cabe242c9c9" prot="private" static="no" mutable="no">
        <type>size_t</type>
        <definition>size_t tf::ScalablePipeline&lt; P &gt;::_num_tokens</definition>
        <argsstring></argsstring>
        <name>_num_tokens</name>
        <qualifiedname>tf::ScalablePipeline::_num_tokens</qualifiedname>
        <initializer>{0}</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1234" column="10" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1234" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="classtf_1_1ScalablePipeline_1a207985f26c6ddf57e7c286af5576b124" prot="private" static="no" mutable="no">
        <type><ref refid="cpp/container/vector" kindref="compound" external="/Users/twhuang/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml">std::vector</ref>&lt; P &gt;</type>
        <definition>std::vector&lt;P&gt; tf::ScalablePipeline&lt; P &gt;::_pipes</definition>
        <argsstring></argsstring>
        <name>_pipes</name>
        <qualifiedname>tf::ScalablePipeline::_pipes</qualifiedname>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1236" column="15" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1236" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="classtf_1_1ScalablePipeline_1a66182f2b381be1f628da346b2e47c2ab" prot="private" static="no" mutable="no">
        <type><ref refid="cpp/container/vector" kindref="compound" external="/Users/twhuang/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml">std::vector</ref>&lt; <ref refid="classtf_1_1Task" kindref="compound">Task</ref> &gt;</type>
        <definition>std::vector&lt;Task&gt; tf::ScalablePipeline&lt; P &gt;::_tasks</definition>
        <argsstring></argsstring>
        <name>_tasks</name>
        <qualifiedname>tf::ScalablePipeline::_tasks</qualifiedname>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1237" column="15" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1237" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="classtf_1_1ScalablePipeline_1a879b367ce62ff667d00c16c18313021c" prot="private" static="no" mutable="no">
        <type><ref refid="cpp/container/vector" kindref="compound" external="/Users/twhuang/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml">std::vector</ref>&lt; <ref refid="classtf_1_1Pipeflow" kindref="compound">Pipeflow</ref> &gt;</type>
        <definition>std::vector&lt;Pipeflow&gt; tf::ScalablePipeline&lt; P &gt;::_pipeflows</definition>
        <argsstring></argsstring>
        <name>_pipeflows</name>
        <qualifiedname>tf::ScalablePipeline::_pipeflows</qualifiedname>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1238" column="15" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1238" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="classtf_1_1ScalablePipeline_1a2d6a310af9e3a69efaea0e8002960062" prot="private" static="no" mutable="no">
        <type><ref refid="cpp/memory/unique_ptr" kindref="compound" external="/Users/twhuang/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml">std::unique_ptr</ref>&lt; Line[]&gt;</type>
        <definition>std::unique_ptr&lt;Line[]&gt; tf::ScalablePipeline&lt; P &gt;::_lines</definition>
        <argsstring></argsstring>
        <name>_lines</name>
        <qualifiedname>tf::ScalablePipeline::_lines</qualifiedname>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1239" column="19" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1239" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="classtf_1_1ScalablePipeline_1a18a2b6051521959ee807c4f1899ec2f3" prot="private" static="no" mutable="no">
        <type><ref refid="cpp/container/queue" kindref="compound" external="/Users/twhuang/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml">std::queue</ref>&lt; <ref refid="cpp/utility/pair" kindref="compound" external="/Users/twhuang/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml">std::pair</ref>&lt; size_t, size_t &gt; &gt;</type>
        <definition>std::queue&lt;std::pair&lt;size_t, size_t&gt; &gt; tf::ScalablePipeline&lt; P &gt;::_ready_tokens</definition>
        <argsstring></argsstring>
        <name>_ready_tokens</name>
        <qualifiedname>tf::ScalablePipeline::_ready_tokens</qualifiedname>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1242" column="14" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1242" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="classtf_1_1ScalablePipeline_1a93c0b0ee2cff99ff3cdaabbb81592744" prot="private" static="no" mutable="no">
        <type><ref refid="cpp/container/unordered_map" kindref="compound" external="/Users/twhuang/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml">std::unordered_map</ref>&lt; size_t, <ref refid="cpp/container/vector" kindref="compound" external="/Users/twhuang/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml">std::vector</ref>&lt; size_t &gt; &gt;</type>
        <definition>std::unordered_map&lt;size_t, std::vector&lt;size_t&gt; &gt; tf::ScalablePipeline&lt; P &gt;::_token_dependencies</definition>
        <argsstring></argsstring>
        <name>_token_dependencies</name>
        <qualifiedname>tf::ScalablePipeline::_token_dependencies</qualifiedname>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1243" column="22" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1243" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="classtf_1_1ScalablePipeline_1aadda92015e28c2545014f7576078bddb" prot="private" static="no" mutable="no">
        <type><ref refid="cpp/container/unordered_map" kindref="compound" external="/Users/twhuang/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml">std::unordered_map</ref>&lt; size_t, DeferredPipeflow &gt;</type>
        <definition>std::unordered_map&lt;size_t, DeferredPipeflow&gt; tf::ScalablePipeline&lt; P &gt;::_deferred_tokens</definition>
        <argsstring></argsstring>
        <name>_deferred_tokens</name>
        <qualifiedname>tf::ScalablePipeline::_deferred_tokens</qualifiedname>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1244" column="22" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1244" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="classtf_1_1ScalablePipeline_1aaf2267b9dbb1173f533aee5a0a250cf3" prot="private" static="no" mutable="no">
        <type>size_t</type>
        <definition>size_t tf::ScalablePipeline&lt; P &gt;::_longest_deferral</definition>
        <argsstring></argsstring>
        <name>_longest_deferral</name>
        <qualifiedname>tf::ScalablePipeline::_longest_deferral</qualifiedname>
        <initializer>= 0</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1245" column="10" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1245" bodyend="-1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="public-func">
      <memberdef kind="function" id="classtf_1_1ScalablePipeline_1a26f5e7e768b77f9e95100c5d6467db71" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type></type>
        <definition>tf::ScalablePipeline&lt; P &gt;::ScalablePipeline</definition>
        <argsstring>()=default</argsstring>
        <name>ScalablePipeline</name>
        <qualifiedname>tf::ScalablePipeline::ScalablePipeline</qualifiedname>
        <briefdescription>
<para>default constructor </para>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1091" column="3"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1ScalablePipeline_1a0f99aa297a26b97d549b62722d91e8ca" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type></type>
        <definition>tf::ScalablePipeline&lt; P &gt;::ScalablePipeline</definition>
        <argsstring>(size_t num_lines)</argsstring>
        <name>ScalablePipeline</name>
        <qualifiedname>tf::ScalablePipeline::ScalablePipeline</qualifiedname>
        <param>
          <type>size_t</type>
          <declname>num_lines</declname>
        </param>
        <briefdescription>
<para>constructs an empty scalable pipeline object </para>
        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>num_lines</parametername>
</parameternamelist>
<parameterdescription>
<para>the number of parallel lines</para>
</parameterdescription>
</parameteritem>
</parameterlist>
An empty scalable pipeline does not have any pipes. The pipeline needs to be reset to a valid range of pipes before running. </para>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1102" column="3" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1260" bodyend="1269"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1ScalablePipeline_1a884818f628bbd4ab876d566b1d2d62dc" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type></type>
        <definition>tf::ScalablePipeline&lt; P &gt;::ScalablePipeline</definition>
        <argsstring>(size_t num_lines, P first, P last)</argsstring>
        <name>ScalablePipeline</name>
        <qualifiedname>tf::ScalablePipeline::ScalablePipeline</qualifiedname>
        <param>
          <type>size_t</type>
          <declname>num_lines</declname>
        </param>
        <param>
          <type>P</type>
          <declname>first</declname>
        </param>
        <param>
          <type>P</type>
          <declname>last</declname>
        </param>
        <briefdescription>
<para>constructs a scalable pipeline object </para>
        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>num_lines</parametername>
</parameternamelist>
<parameterdescription>
<para>the number of parallel lines </para>
</parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>first</parametername>
</parameternamelist>
<parameterdescription>
<para>iterator to the beginning of the range </para>
</parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>last</parametername>
</parameternamelist>
<parameterdescription>
<para>iterator to the end of the range</para>
</parameterdescription>
</parameteritem>
</parameterlist>
Constructs a pipeline from the given range of pipes specified in <computeroutput>[first, last)</computeroutput> using <computeroutput>num_lines</computeroutput> parallel lines. The first pipe must define a serial direction (<ref refid="namespacetf_1abb7a11e41fd457f69e7ff45d4c769564a7b804a28d6154ab8007287532037f1d0" kindref="member">tf::PipeType::SERIAL</ref>) or an exception will be thrown.</para>
<para>Internally, the scalable pipeline copies the iterators from the specified range. Those pipe callables pointed to by these iterators must remain valid during the execution of the pipeline. </para>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1120" column="3" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1273" bodyend="1283"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1ScalablePipeline_1a1a8898df4d2224d5f8bd2f3ad14c0ab9" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type></type>
        <definition>tf::ScalablePipeline&lt; P &gt;::ScalablePipeline</definition>
        <argsstring>(const ScalablePipeline &amp;)=delete</argsstring>
        <name>ScalablePipeline</name>
        <qualifiedname>tf::ScalablePipeline::ScalablePipeline</qualifiedname>
        <param>
          <type>const <ref refid="classtf_1_1ScalablePipeline" kindref="compound">ScalablePipeline</ref> &amp;</type>
        </param>
        <briefdescription>
<para>disabled copy constructor </para>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1125" column="3"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1ScalablePipeline_1a1ab74fa599b0f1489df398cf039b73e5" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type></type>
        <definition>tf::ScalablePipeline&lt; P &gt;::ScalablePipeline</definition>
        <argsstring>(ScalablePipeline &amp;&amp;rhs)</argsstring>
        <name>ScalablePipeline</name>
        <qualifiedname>tf::ScalablePipeline::ScalablePipeline</qualifiedname>
        <param>
          <type><ref refid="classtf_1_1ScalablePipeline" kindref="compound">ScalablePipeline</ref> &amp;&amp;</type>
          <declname>rhs</declname>
        </param>
        <briefdescription>
<para>move constructor </para>
        </briefdescription>
        <detaileddescription>
<para>Constructs a pipeline from the given <computeroutput>rhs</computeroutput> using move semantics (i.e. the data in <computeroutput>rhs</computeroutput> is moved into this pipeline). After the move, <computeroutput>rhs</computeroutput> is in a state as if it is just constructed. The behavior is undefined if <computeroutput>rhs</computeroutput> is running during the move. </para>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1135" column="3" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1287" bodyend="1301"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1ScalablePipeline_1a3019d8763337d434b4ef405f6d801a7b" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="classtf_1_1ScalablePipeline" kindref="compound">ScalablePipeline</ref> &amp;</type>
        <definition>ScalablePipeline &amp; tf::ScalablePipeline&lt; P &gt;::operator=</definition>
        <argsstring>(const ScalablePipeline &amp;)=delete</argsstring>
        <name>operator=</name>
        <qualifiedname>tf::ScalablePipeline::operator=</qualifiedname>
        <param>
          <type>const <ref refid="classtf_1_1ScalablePipeline" kindref="compound">ScalablePipeline</ref> &amp;</type>
        </param>
        <briefdescription>
<para>disabled copy assignment operator </para>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1140" column="20"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1ScalablePipeline_1a72a123bf432763ce095c201c2655051c" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="classtf_1_1ScalablePipeline" kindref="compound">ScalablePipeline</ref> &amp;</type>
        <definition>ScalablePipeline&lt; P &gt; &amp; tf::ScalablePipeline&lt; P &gt;::operator=</definition>
        <argsstring>(ScalablePipeline &amp;&amp;rhs)</argsstring>
        <name>operator=</name>
        <qualifiedname>tf::ScalablePipeline::operator=</qualifiedname>
        <param>
          <type><ref refid="classtf_1_1ScalablePipeline" kindref="compound">ScalablePipeline</ref> &amp;&amp;</type>
          <declname>rhs</declname>
        </param>
        <briefdescription>
<para>move constructor </para>
        </briefdescription>
        <detaileddescription>
<para>Replaces the contents with those of <computeroutput>rhs</computeroutput> using move semantics (i.e. the data in <computeroutput>rhs</computeroutput> is moved into this pipeline). After the move, <computeroutput>rhs</computeroutput> is in a state as if it is just constructed. The behavior is undefined if <computeroutput>rhs</computeroutput> is running during the move. </para>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1150" column="20" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1305" bodyend="1319"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1ScalablePipeline_1a5a4dd65638e8e06e35cb4c5792d044cc" prot="public" static="no" const="yes" explicit="no" inline="no" noexcept="yes" virt="non-virtual">
        <type>size_t</type>
        <definition>size_t tf::ScalablePipeline&lt; P &gt;::num_lines</definition>
        <argsstring>() const noexcept</argsstring>
        <name>num_lines</name>
        <qualifiedname>tf::ScalablePipeline::num_lines</qualifiedname>
        <briefdescription>
<para>queries the number of parallel lines </para>
        </briefdescription>
        <detaileddescription>
<para>The function returns the number of parallel lines given by the user upon the construction of the pipeline. The number of lines represents the maximum parallelism this pipeline can achieve. </para>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1160" column="10" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1323" bodyend="1325"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1ScalablePipeline_1a70c49f5219847681133d2a226c804da1" prot="public" static="no" const="yes" explicit="no" inline="no" noexcept="yes" virt="non-virtual">
        <type>size_t</type>
        <definition>size_t tf::ScalablePipeline&lt; P &gt;::num_pipes</definition>
        <argsstring>() const noexcept</argsstring>
        <name>num_pipes</name>
        <qualifiedname>tf::ScalablePipeline::num_pipes</qualifiedname>
        <briefdescription>
<para>queries the number of pipes </para>
        </briefdescription>
        <detaileddescription>
<para>The Function returns the number of pipes given by the user upon the construction of the pipeline. </para>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1168" column="10" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1329" bodyend="1331"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1ScalablePipeline_1a940a8de7b53ac5cbd59c55091d88c88f" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void tf::ScalablePipeline&lt; P &gt;::reset</definition>
        <argsstring>()</argsstring>
        <name>reset</name>
        <qualifiedname>tf::ScalablePipeline::reset</qualifiedname>
        <briefdescription>
<para>resets the pipeline </para>
        </briefdescription>
        <detaileddescription>
<para>Resets the pipeline to the initial state. After resetting a pipeline, its token identifier will start from zero. </para>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1176" column="8" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1395" bodyend="1429"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1ScalablePipeline_1ad8886d402568a9980952fa4ab59adcab" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void tf::ScalablePipeline&lt; P &gt;::reset</definition>
        <argsstring>(P first, P last)</argsstring>
        <name>reset</name>
        <qualifiedname>tf::ScalablePipeline::reset</qualifiedname>
        <param>
          <type>P</type>
          <declname>first</declname>
        </param>
        <param>
          <type>P</type>
          <declname>last</declname>
        </param>
        <briefdescription>
<para>resets the pipeline with a new range of pipes </para>
        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>first</parametername>
</parameternamelist>
<parameterdescription>
<para>iterator to the beginning of the range </para>
</parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>last</parametername>
</parameternamelist>
<parameterdescription>
<para>iterator to the end of the range</para>
</parameterdescription>
</parameteritem>
</parameterlist>
The member function assigns the pipeline to a new range of pipes specified in <computeroutput>[first, last)</computeroutput> and resets the pipeline to the initial state. After resetting a pipeline, its token identifier will start from zero.</para>
<para>Internally, the scalable pipeline copies the iterators from the specified range. Those pipe callables pointed to by these iterators must remain valid during the execution of the pipeline. </para>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1193" column="8" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1369" bodyend="1391"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1ScalablePipeline_1a8165894518d642ceaa0141e2a66d365a" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void tf::ScalablePipeline&lt; P &gt;::reset</definition>
        <argsstring>(size_t num_lines, P first, P last)</argsstring>
        <name>reset</name>
        <qualifiedname>tf::ScalablePipeline::reset</qualifiedname>
        <param>
          <type>size_t</type>
          <declname>num_lines</declname>
        </param>
        <param>
          <type>P</type>
          <declname>first</declname>
        </param>
        <param>
          <type>P</type>
          <declname>last</declname>
        </param>
        <briefdescription>
<para>resets the pipeline to a new line number and a new range of pipes </para>
        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>num_lines</parametername>
</parameternamelist>
<parameterdescription>
<para>number of parallel lines </para>
</parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>first</parametername>
</parameternamelist>
<parameterdescription>
<para>iterator to the beginning of the range </para>
</parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>last</parametername>
</parameternamelist>
<parameterdescription>
<para>iterator to the end of the range</para>
</parameterdescription>
</parameteritem>
</parameterlist>
The member function resets the pipeline to a new number of parallel lines and a new range of pipes specified in <computeroutput>[first, last)</computeroutput>, as if the pipeline is just constructed. After resetting a pipeline, its token identifier will start from zero.</para>
<para>Internally, the scalable pipeline copies the iterators from the specified range. Those pipe callables pointed to by these iterators must remain valid during the execution of the pipeline. </para>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1212" column="8" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1352" bodyend="1365"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1ScalablePipeline_1a693a2ea53cfac9c0b220d5b3a28e6313" prot="public" static="no" const="yes" explicit="no" inline="no" noexcept="yes" virt="non-virtual">
        <type>size_t</type>
        <definition>size_t tf::ScalablePipeline&lt; P &gt;::num_tokens</definition>
        <argsstring>() const noexcept</argsstring>
        <name>num_tokens</name>
        <qualifiedname>tf::ScalablePipeline::num_tokens</qualifiedname>
        <briefdescription>
<para>queries the number of generated tokens in the pipeline </para>
        </briefdescription>
        <detaileddescription>
<para>The number represents the total scheduling tokens that has been generated by the pipeline so far. </para>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1220" column="10" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1335" bodyend="1337"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1ScalablePipeline_1a2f45a4cb7116fbe9bbc54305f13c52a8" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="classtf_1_1Graph" kindref="compound">Graph</ref> &amp;</type>
        <definition>Graph &amp; tf::ScalablePipeline&lt; P &gt;::graph</definition>
        <argsstring>()</argsstring>
        <name>graph</name>
        <qualifiedname>tf::ScalablePipeline::graph</qualifiedname>
        <briefdescription>
<para>obtains the graph object associated with the pipeline construct </para>
        </briefdescription>
        <detaileddescription>
<para>This method is primarily used as an opaque data structure for creating a module task of the this pipeline. </para>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1228" column="9" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1341" bodyend="1343"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="private-func">
      <memberdef kind="function" id="classtf_1_1ScalablePipeline_1a3cea771eaee545d4445114c824a3f6df" prot="private" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void tf::ScalablePipeline&lt; P &gt;::_check_dependents</definition>
        <argsstring>(Pipeflow &amp;)</argsstring>
        <name>_check_dependents</name>
        <qualifiedname>tf::ScalablePipeline::_check_dependents</qualifiedname>
        <param>
          <type><ref refid="classtf_1_1Pipeflow" kindref="compound">Pipeflow</ref> &amp;</type>
          <defname>pf</defname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1247" column="8" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1449" bodyend="1475"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1ScalablePipeline_1a4583da84f07196c55c636e3556a1e5e3" prot="private" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void tf::ScalablePipeline&lt; P &gt;::_construct_deferred_tokens</definition>
        <argsstring>(Pipeflow &amp;)</argsstring>
        <name>_construct_deferred_tokens</name>
        <qualifiedname>tf::ScalablePipeline::_construct_deferred_tokens</qualifiedname>
        <param>
          <type><ref refid="classtf_1_1Pipeflow" kindref="compound">Pipeflow</ref> &amp;</type>
          <defname>pf</defname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1248" column="8" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1480" bodyend="1490"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1ScalablePipeline_1ad210e4d59d58c79100a830df51d55b1f" prot="private" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void tf::ScalablePipeline&lt; P &gt;::_resolve_token_dependencies</definition>
        <argsstring>(Pipeflow &amp;)</argsstring>
        <name>_resolve_token_dependencies</name>
        <qualifiedname>tf::ScalablePipeline::_resolve_token_dependencies</qualifiedname>
        <param>
          <type><ref refid="classtf_1_1Pipeflow" kindref="compound">Pipeflow</ref> &amp;</type>
          <defname>pf</defname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1249" column="8" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1495" bodyend="1519"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1ScalablePipeline_1aea457827353fe9d73ae069daec7fa512" prot="private" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void tf::ScalablePipeline&lt; P &gt;::_on_pipe</definition>
        <argsstring>(Pipeflow &amp;, Runtime &amp;)</argsstring>
        <name>_on_pipe</name>
        <qualifiedname>tf::ScalablePipeline::_on_pipe</qualifiedname>
        <param>
          <type><ref refid="classtf_1_1Pipeflow" kindref="compound">Pipeflow</ref> &amp;</type>
          <defname>pf</defname>
        </param>
        <param>
          <type><ref refid="classtf_1_1Runtime" kindref="compound">Runtime</ref> &amp;</type>
          <defname>rt</defname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1252" column="8" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1433" bodyend="1446"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1ScalablePipeline_1ae695c9b1bbe3a5f65a5bb4217087c356" prot="private" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void tf::ScalablePipeline&lt; P &gt;::_build</definition>
        <argsstring>()</argsstring>
        <name>_build</name>
        <qualifiedname>tf::ScalablePipeline::_build</qualifiedname>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1253" column="8" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1523" bodyend="1656"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1ScalablePipeline_1a81b18c25db2cba4c530d85c5ab413a6c" prot="private" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>Line &amp;</type>
        <definition>ScalablePipeline&lt; P &gt;::Line &amp; tf::ScalablePipeline&lt; P &gt;::_line</definition>
        <argsstring>(size_t, size_t)</argsstring>
        <name>_line</name>
        <qualifiedname>tf::ScalablePipeline::_line</qualifiedname>
        <param>
          <type>size_t</type>
          <defname>l</defname>
        </param>
        <param>
          <type>size_t</type>
          <defname>p</defname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1255" column="8" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1347" bodyend="1349"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
<para>class to create a scalable pipeline object </para>
    </briefdescription>
    <detaileddescription>
<para><parameterlist kind="templateparam"><parameteritem>
<parameternamelist>
<parametername>P</parametername>
</parameternamelist>
<parameterdescription>
<para>type of the iterator to a range of pipes</para>
</parameterdescription>
</parameteritem>
</parameterlist>
A scalable pipeline is a composable graph object for users to create a <emphasis>pipeline scheduling framework</emphasis> using a module task in a taskflow. Unlike <ref refid="classtf_1_1Pipeline" kindref="compound">tf::Pipeline</ref> that instantiates all pipes upon the construction time, <ref refid="classtf_1_1ScalablePipeline" kindref="compound">tf::ScalablePipeline</ref> allows variable assignments of pipes using range iterators. Users can also reset a scalable pipeline to a different range of pipes between runs. The following code creates a scalable pipeline of four parallel lines to schedule tokens through three serial pipes in a custom storage, then resetting the pipeline to a new range of five serial pipes:</para>
<para><programlisting filename=".cpp"><codeline><highlight class="normal"><ref refid="classtf_1_1Taskflow" kindref="compound">tf::Taskflow</ref><sp/>taskflow(</highlight><highlight class="stringliteral">&quot;pipeline&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline><highlight class="normal"><ref refid="classtf_1_1Executor" kindref="compound">tf::Executor</ref><sp/>executor;</highlight></codeline>
<codeline><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/><ref refid="classtf_1_1ScalablePipeline_1a5a4dd65638e8e06e35cb4c5792d044cc" kindref="member">num_lines</ref><sp/>=<sp/>4;</highlight></codeline>
<codeline><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"></highlight><highlight class="comment">//<sp/>create<sp/>data<sp/>storage</highlight><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"><ref refid="cpp/container/array" kindref="compound" external="/Users/twhuang/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml">std::array&lt;int, num_lines&gt;</ref><sp/>buffer;</highlight></codeline>
<codeline><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"></highlight><highlight class="comment">//<sp/>define<sp/>the<sp/>pipe<sp/>callable</highlight><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"></highlight><highlight class="keyword">auto</highlight><highlight class="normal"><sp/>pipe_callable<sp/>=<sp/>[&amp;buffer]<sp/>(<ref refid="classtf_1_1Pipeflow" kindref="compound">tf::Pipeflow</ref>&amp;<sp/>pf)<sp/></highlight><highlight class="keyword">mutable</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal">(pf.pipe())<sp/>{</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>first<sp/>stage<sp/>generates<sp/>only<sp/>5<sp/>scheduling<sp/>tokens<sp/>and<sp/>saves<sp/>the</highlight><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>token<sp/>number<sp/>into<sp/>the<sp/>buffer.</highlight><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/>0:<sp/>{</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(pf.token()<sp/>==<sp/>5)<sp/>{</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>pf.stop();</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="cpp/io/c/fprintf" kindref="compound" external="/Users/twhuang/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml">printf</ref>(</highlight><highlight class="stringliteral">&quot;stage<sp/>1:<sp/>input<sp/>token<sp/>=<sp/>%zu\n&quot;</highlight><highlight class="normal">,<sp/>pf.token());</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>buffer[pf.line()]<sp/>=<sp/>pf.token();</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>other<sp/>stages<sp/>propagate<sp/>the<sp/>previous<sp/>result<sp/>to<sp/>this<sp/>pipe<sp/>and</highlight><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>increment<sp/>it<sp/>by<sp/>one</highlight><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">default</highlight><highlight class="normal">:<sp/>{</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="cpp/io/c/fprintf" kindref="compound" external="/Users/twhuang/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml">printf</ref>(</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;stage<sp/>%zu:<sp/>input<sp/>buffer[%zu]<sp/>=<sp/>%d\n&quot;</highlight><highlight class="normal">,<sp/>pf.pipe(),<sp/>pf.line(),<sp/>buffer[pf.line()]</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>);</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>buffer[pf.line()]<sp/>=<sp/>buffer[pf.line()]<sp/>+<sp/>1;</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline><highlight class="normal">};</highlight></codeline>
<codeline><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"></highlight><highlight class="comment">//<sp/>create<sp/>a<sp/>vector<sp/>of<sp/>three<sp/>pipes</highlight><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"><ref refid="cpp/container/vector" kindref="compound" external="/Users/twhuang/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml">std::vector</ref>&lt;<sp/><ref refid="classtf_1_1Pipe" kindref="compound">tf::Pipe</ref>&lt;<ref refid="cpp/utility/functional/function" kindref="compound" external="/Users/twhuang/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml">std::function</ref>&lt;void(<ref refid="classtf_1_1Pipeflow" kindref="compound">tf::Pipeflow</ref>&amp;)&gt;&gt;<sp/>&gt;<sp/>pipes;</highlight></codeline>
<codeline><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>i=0;<sp/>i&lt;3;<sp/>i++)<sp/>{</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/>pipes.emplace_back(<ref refid="namespacetf_1abb7a11e41fd457f69e7ff45d4c769564a7b804a28d6154ab8007287532037f1d0" kindref="member">tf::PipeType::SERIAL</ref>,<sp/>pipe_callable);</highlight></codeline>
<codeline><highlight class="normal">}</highlight></codeline>
<codeline><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"></highlight><highlight class="comment">//<sp/>create<sp/>a<sp/>pipeline<sp/>of<sp/>four<sp/>parallel<sp/>lines<sp/>based<sp/>on<sp/>the<sp/>given<sp/>vector<sp/>of<sp/>pipes</highlight><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"><ref refid="classtf_1_1ScalablePipeline" kindref="compound">tf::ScalablePipeline</ref><sp/>pl(<ref refid="classtf_1_1ScalablePipeline_1a5a4dd65638e8e06e35cb4c5792d044cc" kindref="member">num_lines</ref>,<sp/>pipes.begin(),<sp/>pipes.end());</highlight></codeline>
<codeline><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"></highlight><highlight class="comment">//<sp/>build<sp/>the<sp/>pipeline<sp/>graph<sp/>using<sp/>composition</highlight><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"><ref refid="classtf_1_1Task" kindref="compound">tf::Task</ref><sp/>init<sp/>=<sp/>taskflow.emplace([](){<sp/><ref refid="cpp/io/basic_ostream" kindref="compound" external="/Users/twhuang/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml">std::cout</ref><sp/>&lt;&lt;<sp/></highlight><highlight class="stringliteral">&quot;ready\n&quot;</highlight><highlight class="normal">;<sp/>})</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>.name(</highlight><highlight class="stringliteral">&quot;starting<sp/>pipeline&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline><highlight class="normal"><ref refid="classtf_1_1Task" kindref="compound">tf::Task</ref><sp/>task<sp/>=<sp/>taskflow.<ref refid="classtf_1_1Task_1ab38be520fe700cb4ca1f312308a95585" kindref="member">composed_of</ref>(pl)</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>.<ref refid="classtf_1_1Task_1a08ada0425b490997b6ff7f310107e5e3" kindref="member">name</ref>(</highlight><highlight class="stringliteral">&quot;pipeline&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline><highlight class="normal"><ref refid="classtf_1_1Task" kindref="compound">tf::Task</ref><sp/>stop<sp/>=<sp/>taskflow.emplace([](){<sp/><ref refid="cpp/io/basic_ostream" kindref="compound" external="/Users/twhuang/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml">std::cout</ref><sp/>&lt;&lt;<sp/></highlight><highlight class="stringliteral">&quot;stopped\n&quot;</highlight><highlight class="normal">;<sp/>})</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>.name(</highlight><highlight class="stringliteral">&quot;pipeline<sp/>stopped&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"></highlight><highlight class="comment">//<sp/>create<sp/>task<sp/>dependency</highlight><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal">init.<ref refid="classtf_1_1Task_1a8c78c453295a553c1c016e4062da8588" kindref="member">precede</ref>(task);</highlight></codeline>
<codeline><highlight class="normal">task.<ref refid="classtf_1_1Task_1a8c78c453295a553c1c016e4062da8588" kindref="member">precede</ref>(stop);</highlight></codeline>
<codeline><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"></highlight><highlight class="comment">//<sp/>dump<sp/>the<sp/>pipeline<sp/>graph<sp/>structure<sp/>(with<sp/>composition)</highlight><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal">taskflow.<ref refid="classtf_1_1Task_1a3318a49ff9d0a01cd1e8ee675251e3b7" kindref="member">dump</ref>(<ref refid="cpp/io/basic_ostream" kindref="compound" external="/Users/twhuang/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml">std::cout</ref>);</highlight></codeline>
<codeline><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"></highlight><highlight class="comment">//<sp/>run<sp/>the<sp/>pipeline</highlight><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal">executor.<ref refid="classtf_1_1Executor_1a519777f5783981d534e9e53b99712069" kindref="member">run</ref>(taskflow).wait();</highlight></codeline>
<codeline><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"></highlight><highlight class="comment">//<sp/>reset<sp/>the<sp/>pipeline<sp/>to<sp/>a<sp/>new<sp/>range<sp/>of<sp/>five<sp/>pipes<sp/>and<sp/>starts<sp/>from</highlight><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"></highlight><highlight class="comment">//<sp/>the<sp/>initial<sp/>state<sp/>(i.e.,<sp/>token<sp/>counts<sp/>from<sp/>zero)</highlight><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>i=0;<sp/>i&lt;2;<sp/>i++)<sp/>{</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/>pipes.emplace_back(<ref refid="namespacetf_1abb7a11e41fd457f69e7ff45d4c769564a7b804a28d6154ab8007287532037f1d0" kindref="member">tf::PipeType::SERIAL</ref>,<sp/>pipe_callable);</highlight></codeline>
<codeline><highlight class="normal">}</highlight></codeline>
<codeline><highlight class="normal">pl.reset(pipes.begin(),<sp/>pipes.end());</highlight></codeline>
<codeline><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal">executor.<ref refid="classtf_1_1Executor_1a519777f5783981d534e9e53b99712069" kindref="member">run</ref>(taskflow).wait();</highlight></codeline>
</programlisting></para>
<para>The above example creates a pipeline graph that schedules five tokens over four parallel lines in a circular fashion, first going through three serial pipes and then five serial pipes:</para>
<para><programlisting filename=".shell-session"><codeline><highlight class="normal">#<sp/>initial<sp/>construction<sp/>of<sp/>three<sp/>serial<sp/>pipes</highlight></codeline>
<codeline><highlight class="normal">o<sp/>-&gt;<sp/>o<sp/>-&gt;<sp/>o</highlight></codeline>
<codeline><highlight class="normal">|<sp/><sp/><sp/><sp/>|<sp/><sp/><sp/><sp/>|</highlight></codeline>
<codeline><highlight class="normal">v<sp/><sp/><sp/><sp/>v<sp/><sp/><sp/><sp/>v</highlight></codeline>
<codeline><highlight class="normal">o<sp/>-&gt;<sp/>o<sp/>-&gt;<sp/>o</highlight></codeline>
<codeline><highlight class="normal">|<sp/><sp/><sp/><sp/>|<sp/><sp/><sp/><sp/>|</highlight></codeline>
<codeline><highlight class="normal">v<sp/><sp/><sp/><sp/>v<sp/><sp/><sp/><sp/>v</highlight></codeline>
<codeline><highlight class="normal">o<sp/>-&gt;<sp/>o<sp/>-&gt;<sp/>o</highlight></codeline>
<codeline><highlight class="normal">|<sp/><sp/><sp/><sp/>|<sp/><sp/><sp/><sp/>|</highlight></codeline>
<codeline><highlight class="normal">v<sp/><sp/><sp/><sp/>v<sp/><sp/><sp/><sp/>v</highlight></codeline>
<codeline><highlight class="normal">o<sp/>-&gt;<sp/>o<sp/>-&gt;<sp/>o</highlight></codeline>
<codeline></codeline>
<codeline><highlight class="normal">#<sp/>resetting<sp/>to<sp/>a<sp/>new<sp/>range<sp/>of<sp/>five<sp/>serial<sp/>pipes</highlight></codeline>
<codeline><highlight class="normal">o<sp/>-&gt;<sp/>o<sp/>-&gt;<sp/>o<sp/>-&gt;<sp/>o<sp/>-&gt;<sp/>o</highlight></codeline>
<codeline><highlight class="normal">|<sp/><sp/><sp/><sp/>|<sp/><sp/><sp/><sp/>|<sp/><sp/><sp/><sp/>|<sp/><sp/><sp/><sp/>|</highlight></codeline>
<codeline><highlight class="normal">v<sp/><sp/><sp/><sp/>v<sp/><sp/><sp/><sp/>v<sp/><sp/><sp/><sp/>v<sp/><sp/><sp/><sp/>v</highlight></codeline>
<codeline><highlight class="normal">o<sp/>-&gt;<sp/>o<sp/>-&gt;<sp/>o<sp/>-&gt;<sp/>o<sp/>-&gt;<sp/>o</highlight></codeline>
<codeline><highlight class="normal">|<sp/><sp/><sp/><sp/>|<sp/><sp/><sp/><sp/>|<sp/><sp/><sp/><sp/>|<sp/><sp/><sp/><sp/>|</highlight></codeline>
<codeline><highlight class="normal">v<sp/><sp/><sp/><sp/>v<sp/><sp/><sp/><sp/>v<sp/><sp/><sp/><sp/>v<sp/><sp/><sp/><sp/>v</highlight></codeline>
<codeline><highlight class="normal">o<sp/>-&gt;<sp/>o<sp/>-&gt;<sp/>o<sp/>-&gt;<sp/>o<sp/>-&gt;<sp/>o</highlight></codeline>
<codeline><highlight class="normal">|<sp/><sp/><sp/><sp/>|<sp/><sp/><sp/><sp/>|<sp/><sp/><sp/><sp/>|<sp/><sp/><sp/><sp/>|</highlight></codeline>
<codeline><highlight class="normal">v<sp/><sp/><sp/><sp/>v<sp/><sp/><sp/><sp/>v<sp/><sp/><sp/><sp/>v<sp/><sp/><sp/><sp/>v</highlight></codeline>
<codeline><highlight class="normal">o<sp/>-&gt;<sp/>o<sp/>-&gt;<sp/>o<sp/>-&gt;<sp/>o<sp/>-&gt;<sp/>o</highlight></codeline>
</programlisting></para>
<para>Each pipe has the same type of <computeroutput>tf::Pipe&lt;std::function&lt;void(tf::Pipeflow&amp;)&gt;&gt;</computeroutput> and is kept in a vector that is amenable to change. We construct the scalable pipeline using two range iterators pointing to the beginning and the end of the vector. At each pipe stage, the program propagates the result to the next pipe by adding one to the result stored in a custom data storage, <computeroutput>buffer</computeroutput>. The pipeline scheduler will generate five scheduling tokens and then stop.</para>
<para>A scalable pipeline is move-only. </para>
    </detaileddescription>
    <location file="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" line="1072" column="1" bodyfile="/Users/twhuang/Code/taskflow/taskflow/algorithm/pipeline.hpp" bodystart="1072" bodyend="1256"/>
    <listofallmembers>
      <member refid="classtf_1_1ScalablePipeline_1ae695c9b1bbe3a5f65a5bb4217087c356" prot="private" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>_build</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a3cea771eaee545d4445114c824a3f6df" prot="private" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>_check_dependents</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a4583da84f07196c55c636e3556a1e5e3" prot="private" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>_construct_deferred_tokens</name></member>
      <member refid="classtf_1_1ScalablePipeline_1aadda92015e28c2545014f7576078bddb" prot="private" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>_deferred_tokens</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a22fa085403161f1054f7c06004a6ae0c" prot="private" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>_graph</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a81b18c25db2cba4c530d85c5ab413a6c" prot="private" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>_line</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a2d6a310af9e3a69efaea0e8002960062" prot="private" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>_lines</name></member>
      <member refid="classtf_1_1ScalablePipeline_1aaf2267b9dbb1173f533aee5a0a250cf3" prot="private" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>_longest_deferral</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a29cfaffe5b328370e0fc5cabe242c9c9" prot="private" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>_num_tokens</name></member>
      <member refid="classtf_1_1ScalablePipeline_1aea457827353fe9d73ae069daec7fa512" prot="private" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>_on_pipe</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a879b367ce62ff667d00c16c18313021c" prot="private" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>_pipeflows</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a207985f26c6ddf57e7c286af5576b124" prot="private" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>_pipes</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a18a2b6051521959ee807c4f1899ec2f3" prot="private" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>_ready_tokens</name></member>
      <member refid="classtf_1_1ScalablePipeline_1ad210e4d59d58c79100a830df51d55b1f" prot="private" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>_resolve_token_dependencies</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a66182f2b381be1f628da346b2e47c2ab" prot="private" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>_tasks</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a93c0b0ee2cff99ff3cdaabbb81592744" prot="private" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>_token_dependencies</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a2f45a4cb7116fbe9bbc54305f13c52a8" prot="public" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>graph</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a5a4dd65638e8e06e35cb4c5792d044cc" prot="public" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>num_lines</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a70c49f5219847681133d2a226c804da1" prot="public" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>num_pipes</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a693a2ea53cfac9c0b220d5b3a28e6313" prot="public" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>num_tokens</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a3019d8763337d434b4ef405f6d801a7b" prot="public" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>operator=</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a72a123bf432763ce095c201c2655051c" prot="public" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>operator=</name></member>
      <member refid="classtf_1_1ScalablePipeline_1af06cc645f8a7c4797ca53e274b0c7547" prot="public" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>pipe_t</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a940a8de7b53ac5cbd59c55091d88c88f" prot="public" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>reset</name></member>
      <member refid="classtf_1_1ScalablePipeline_1ad8886d402568a9980952fa4ab59adcab" prot="public" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>reset</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a8165894518d642ceaa0141e2a66d365a" prot="public" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>reset</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a26f5e7e768b77f9e95100c5d6467db71" prot="public" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>ScalablePipeline</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a0f99aa297a26b97d549b62722d91e8ca" prot="public" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>ScalablePipeline</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a884818f628bbd4ab876d566b1d2d62dc" prot="public" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>ScalablePipeline</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a1a8898df4d2224d5f8bd2f3ad14c0ab9" prot="public" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>ScalablePipeline</name></member>
      <member refid="classtf_1_1ScalablePipeline_1a1ab74fa599b0f1489df398cf039b73e5" prot="public" virt="non-virtual"><scope>tf::ScalablePipeline</scope><name>ScalablePipeline</name></member>
    </listofallmembers>
  </compounddef>
</doxygen>
