<p>A data pipe represents a stage of a data-parallel pipeline. A data pipe can be either <em>parallel</em> direction or <em>serial</em> direction (specified by <ahref="namespacetf.html#abb7a11e41fd457f69e7ff45d4c769564" class="m-doc">tf::<wbr/>PipeType</a>) and is associated with a callable to invoke by the pipeline scheduler.</p><p>You need to use the template function, <ahref="namespacetf.html#a8975fa5762088789adb0b60f38208309" class="m-doc">tf::<wbr/>make_data_pipe</a>, to create a data pipe. The input and output types of a <ahref="classtf_1_1DataPipe.html" class="m-doc">tf::<wbr/>DataPipe</a> should be decayed types (though the library will always decay them for you using <code><ahref="http://en.cppreference.com/w/cpp/types/decay.html" class="m-doc-external">std::<wbr/>decay</a></code>) to allow internal storage to work. The data will be passed by reference to your callable, at which you can take it by copy or reference.</p><preclass="m-code"><spanclass="n">tf</span><spanclass="o">::</span><spanclass="n">make_data_pipe</span><spanclass="o"><</span><spanclass="kt">int</span><spanclass="p">,</span><spanclass="w"></span><spanclass="n">std</span><spanclass="o">::</span><spanclass="n">string</span><spanclass="o">></span><spanclass="p">(</span><spanclass="w"></span>
<spanclass="p">);</span><spanclass="w"></span></pre><p>In addition to the data, you callable can take an additional reference of <ahref="classtf_1_1Pipeflow.html" class="m-doc">tf::<wbr/>Pipeflow</a> in the second argument to probe the runtime information for a stage task, such as its line number and token number:</p><preclass="m-code"><spanclass="n">tf</span><spanclass="o">::</span><spanclass="n">make_data_pipe</span><spanclass="o"><</span><spanclass="kt">int</span><spanclass="p">,</span><spanclass="w"></span><spanclass="n">std</span><spanclass="o">::</span><spanclass="n">string</span><spanclass="o">></span><spanclass="p">(</span><spanclass="w"></span>
<p>You should use the helper function, <ahref="namespacetf.html#a8975fa5762088789adb0b60f38208309" class="m-doc">tf::<wbr/>make_data_pipe</a>, to create a <ahref="classtf_1_1DataPipe.html" class="m-doc">DataPipe</a> object, especially when you need <ahref="classtf_1_1DataPipe.html" class="m-doc">tf::<wbr/>DataPipe</a> to automatically deduct the lambda type.</p>
<p>A data pipe can be either parallel (<ahref="namespacetf.html#abb7a11e41fd457f69e7ff45d4c769564adf13a99b035d6f0bce4f44ab18eec8eb" class="m-doc">tf::<wbr/>PipeType::<wbr/>PARALLEL</a>) or serial (<ahref="namespacetf.html#abb7a11e41fd457f69e7ff45d4c769564a7b804a28d6154ab8007287532037f1d0" class="m-doc">tf::<wbr/>PipeType::<wbr/>SERIAL</a>).</p>