<?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_1AsyncTask" kind="class" language="C++" prot="public">
    <compoundname>tf::AsyncTask</compoundname>
    <includes refid="async__task_8hpp" local="no">async_task.hpp</includes>
      <sectiondef kind="friend">
      <memberdef kind="friend" id="classtf_1_1AsyncTask_1a61184f9bd9c801d0a5eccecfdbddc641" prot="private" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>class</type>
        <definition>friend class FlowBuilder</definition>
        <argsstring></argsstring>
        <name>FlowBuilder</name>
        <qualifiedname>tf::AsyncTask::FlowBuilder</qualifiedname>
        <param>
          <type><ref refid="classtf_1_1FlowBuilder" kindref="compound">FlowBuilder</ref></type>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" line="43" column="16" bodyfile="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" bodystart="43" bodyend="-1"/>
      </memberdef>
      <memberdef kind="friend" id="classtf_1_1AsyncTask_1af3d14e26ba8af9e6cc5a32aad8446de7" prot="private" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>class</type>
        <definition>friend class Runtime</definition>
        <argsstring></argsstring>
        <name>Runtime</name>
        <qualifiedname>tf::AsyncTask::Runtime</qualifiedname>
        <param>
          <type><ref refid="classtf_1_1Runtime" kindref="compound">Runtime</ref></type>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" line="44" column="16" bodyfile="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" bodystart="44" bodyend="-1"/>
      </memberdef>
      <memberdef kind="friend" id="classtf_1_1AsyncTask_1af043dd6f6a359602805d9c7dd7539cca" prot="private" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>class</type>
        <definition>friend class Taskflow</definition>
        <argsstring></argsstring>
        <name>Taskflow</name>
        <qualifiedname>tf::AsyncTask::Taskflow</qualifiedname>
        <param>
          <type><ref refid="classtf_1_1Taskflow" kindref="compound">Taskflow</ref></type>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" line="45" column="16" bodyfile="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" bodystart="45" bodyend="-1"/>
      </memberdef>
      <memberdef kind="friend" id="classtf_1_1AsyncTask_1a0aa0e12e4a0ba023033e808fb2132fdf" prot="private" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>class</type>
        <definition>friend class TaskView</definition>
        <argsstring></argsstring>
        <name>TaskView</name>
        <qualifiedname>tf::AsyncTask::TaskView</qualifiedname>
        <param>
          <type><ref refid="classtf_1_1TaskView" kindref="compound">TaskView</ref></type>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" line="46" column="16" bodyfile="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" bodystart="46" bodyend="-1"/>
      </memberdef>
      <memberdef kind="friend" id="classtf_1_1AsyncTask_1a763b2f90bc53f92d680a635fe28e858e" prot="private" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>class</type>
        <definition>friend class Executor</definition>
        <argsstring></argsstring>
        <name>Executor</name>
        <qualifiedname>tf::AsyncTask::Executor</qualifiedname>
        <param>
          <type><ref refid="classtf_1_1Executor" kindref="compound">Executor</ref></type>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" line="47" column="16" bodyfile="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" bodystart="47" bodyend="-1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="private-attrib">
      <memberdef kind="variable" id="classtf_1_1AsyncTask_1a48f6e697c2e1f30f4c58668f4d187883" prot="private" static="no" mutable="no">
        <type><ref refid="cpp/memory/shared_ptr" kindref="compound" external="/Users/twhuang/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml">std::shared_ptr</ref>&lt; Node &gt;</type>
        <definition>std::shared_ptr&lt;Node&gt; tf::AsyncTask::_node</definition>
        <argsstring></argsstring>
        <name>_node</name>
        <qualifiedname>tf::AsyncTask::_node</qualifiedname>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" line="100" column="21" bodyfile="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" bodystart="100" bodyend="-1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="public-func">
      <memberdef kind="function" id="classtf_1_1AsyncTask_1a68689c79c7d794a8be2e1c181c818001" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type></type>
        <definition>tf::AsyncTask::AsyncTask</definition>
        <argsstring>()=default</argsstring>
        <name>AsyncTask</name>
        <qualifiedname>tf::AsyncTask::AsyncTask</qualifiedname>
        <briefdescription>
<para>constructs an empty task handle </para>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" line="54" column="5"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1AsyncTask_1af7d74066d5df4107c585a0a64451a34c" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type></type>
        <definition>tf::AsyncTask::~AsyncTask</definition>
        <argsstring>()=default</argsstring>
        <name>~AsyncTask</name>
        <qualifiedname>tf::AsyncTask::~AsyncTask</qualifiedname>
        <briefdescription>
<para>destroys the managed asynchronous task if this is the last owner </para>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" line="59" column="5"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1AsyncTask_1a52e155d7ea91649028bb28dc56351ee3" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type></type>
        <definition>tf::AsyncTask::AsyncTask</definition>
        <argsstring>(const AsyncTask &amp;rhs)=default</argsstring>
        <name>AsyncTask</name>
        <qualifiedname>tf::AsyncTask::AsyncTask</qualifiedname>
        <param>
          <type>const <ref refid="classtf_1_1AsyncTask" kindref="compound">AsyncTask</ref> &amp;</type>
          <declname>rhs</declname>
        </param>
        <briefdescription>
<para>constructs an task that shares ownership of <computeroutput>rhs</computeroutput> </para>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" line="64" column="5"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1AsyncTask_1a48138b02dd808a8cfa1c9ef194a57b88" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type></type>
        <definition>tf::AsyncTask::AsyncTask</definition>
        <argsstring>(AsyncTask &amp;&amp;rhs)=default</argsstring>
        <name>AsyncTask</name>
        <qualifiedname>tf::AsyncTask::AsyncTask</qualifiedname>
        <param>
          <type><ref refid="classtf_1_1AsyncTask" kindref="compound">AsyncTask</ref> &amp;&amp;</type>
          <declname>rhs</declname>
        </param>
        <briefdescription>
<para>move-constructs an task from <computeroutput>rhs</computeroutput> </para>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" line="69" column="5"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1AsyncTask_1a48436c648bde656d4e5c6c7deac7b367" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="classtf_1_1AsyncTask" kindref="compound">AsyncTask</ref> &amp;</type>
        <definition>AsyncTask &amp; tf::AsyncTask::operator=</definition>
        <argsstring>(const AsyncTask &amp;rhs)=default</argsstring>
        <name>operator=</name>
        <qualifiedname>tf::AsyncTask::operator=</qualifiedname>
        <param>
          <type>const <ref refid="classtf_1_1AsyncTask" kindref="compound">AsyncTask</ref> &amp;</type>
          <declname>rhs</declname>
        </param>
        <briefdescription>
<para>shares ownership of the task managed by <computeroutput>rhs</computeroutput> </para>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" line="74" column="15"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1AsyncTask_1a1597b2cd541086c04da1854db9708bbc" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="classtf_1_1AsyncTask" kindref="compound">AsyncTask</ref> &amp;</type>
        <definition>AsyncTask &amp; tf::AsyncTask::operator=</definition>
        <argsstring>(AsyncTask &amp;&amp;rhs)=default</argsstring>
        <name>operator=</name>
        <qualifiedname>tf::AsyncTask::operator=</qualifiedname>
        <param>
          <type><ref refid="classtf_1_1AsyncTask" kindref="compound">AsyncTask</ref> &amp;&amp;</type>
          <declname>rhs</declname>
        </param>
        <briefdescription>
<para>move-assigns the task from <computeroutput>rhs</computeroutput> </para>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" line="79" column="15"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1AsyncTask_1ae42c70dc0c5edc6d58f47b346125fca3" prot="public" static="no" const="yes" explicit="no" inline="yes" virt="non-virtual">
        <type>bool</type>
        <definition>bool tf::AsyncTask::empty</definition>
        <argsstring>() const</argsstring>
        <name>empty</name>
        <qualifiedname>tf::AsyncTask::empty</qualifiedname>
        <briefdescription>
<para>checks if the task stores a non-null shared pointer </para>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" line="84" column="10" bodyfile="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" bodystart="108" bodyend="110"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1AsyncTask_1a7c12835577fbdc1bca3190cf92c78088" prot="public" static="no" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>void</type>
        <definition>void tf::AsyncTask::reset</definition>
        <argsstring>()</argsstring>
        <name>reset</name>
        <qualifiedname>tf::AsyncTask::reset</qualifiedname>
        <briefdescription>
<para>release the ownership </para>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" line="89" column="10" bodyfile="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" bodystart="113" bodyend="115"/>
      </memberdef>
      <memberdef kind="function" id="classtf_1_1AsyncTask_1a826a2ea909094f5a26c2df876de58056" prot="public" static="no" const="yes" explicit="no" inline="yes" virt="non-virtual">
        <type>size_t</type>
        <definition>size_t tf::AsyncTask::hash_value</definition>
        <argsstring>() const</argsstring>
        <name>hash_value</name>
        <qualifiedname>tf::AsyncTask::hash_value</qualifiedname>
        <briefdescription>
<para>obtains a hash value of the underlying node </para>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" line="94" column="12" bodyfile="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" bodystart="118" bodyend="120"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="private-func">
      <memberdef kind="function" id="classtf_1_1AsyncTask_1a9d2d950ae2796cc322252780b5b7f401" prot="private" static="no" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type></type>
        <definition>tf::AsyncTask::AsyncTask</definition>
        <argsstring>(std::shared_ptr&lt; Node &gt;)</argsstring>
        <name>AsyncTask</name>
        <qualifiedname>tf::AsyncTask::AsyncTask</qualifiedname>
        <param>
          <type><ref refid="cpp/memory/shared_ptr" kindref="compound" external="/Users/twhuang/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml">std::shared_ptr</ref>&lt; Node &gt;</type>
          <defname>ptr</defname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" line="98" column="5" bodyfile="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" bodystart="104" bodyend="105"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
<para>class to create a dependent asynchronous task </para>
    </briefdescription>
    <detaileddescription>
<para>A <ref refid="classtf_1_1AsyncTask" kindref="compound">tf::AsyncTask</ref> is a lightweight handle that retains <emphasis>shared</emphasis> ownership of a dependent async task created by an executor. This shared ownership ensures that the async task remains alive when adding it to the dependency list of another async task, thus avoiding the classical <ulink url="https://en.wikipedia.org/wiki/ABA_problem">ABA problem</ulink>.</para>
<para><programlisting filename=".cpp"><codeline><highlight class="comment">//<sp/>main<sp/>thread<sp/>retains<sp/>shared<sp/>ownership<sp/>of<sp/>async<sp/>task<sp/>A</highlight><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"><ref refid="classtf_1_1AsyncTask" kindref="compound">tf::AsyncTask</ref><sp/>A<sp/>=<sp/>executor.silent_dependent_async([](){});</highlight></codeline>
<codeline><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"></highlight><highlight class="comment">//<sp/>task<sp/>A<sp/>remains<sp/>alive<sp/>(i.e.,<sp/>at<sp/>least<sp/>one<sp/>ref<sp/>count<sp/>by<sp/>the<sp/>main<sp/>thread)<sp/></highlight><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"></highlight><highlight class="comment">//<sp/>when<sp/>being<sp/>added<sp/>to<sp/>the<sp/>dependency<sp/>list<sp/>of<sp/>async<sp/>task<sp/>B</highlight><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"><ref refid="classtf_1_1AsyncTask" kindref="compound">tf::AsyncTask</ref><sp/>B<sp/>=<sp/>executor.silent_dependent_async([](){},<sp/>A);</highlight></codeline>
</programlisting></para>
<para>Currently, <ref refid="classtf_1_1AsyncTask" kindref="compound">tf::AsyncTask</ref> is implemented based on C++ smart pointer <ref refid="cpp/memory/shared_ptr" kindref="compound" external="/Users/twhuang/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml">std::shared_ptr</ref> and is considered cheap to copy or move as long as only a handful of objects own it. When a worker completes an async task, it will remove the task from the executor, decrementing the number of shared owners by one. If that counter reaches zero, the task is destroyed. </para>
    </detaileddescription>
    <location file="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" line="41" column="1" bodyfile="/Users/twhuang/Code/taskflow/taskflow/core/async_task.hpp" bodystart="41" bodyend="101"/>
    <listofallmembers>
      <member refid="classtf_1_1AsyncTask_1a48f6e697c2e1f30f4c58668f4d187883" prot="private" virt="non-virtual"><scope>tf::AsyncTask</scope><name>_node</name></member>
      <member refid="classtf_1_1AsyncTask_1a68689c79c7d794a8be2e1c181c818001" prot="public" virt="non-virtual"><scope>tf::AsyncTask</scope><name>AsyncTask</name></member>
      <member refid="classtf_1_1AsyncTask_1a52e155d7ea91649028bb28dc56351ee3" prot="public" virt="non-virtual"><scope>tf::AsyncTask</scope><name>AsyncTask</name></member>
      <member refid="classtf_1_1AsyncTask_1a48138b02dd808a8cfa1c9ef194a57b88" prot="public" virt="non-virtual"><scope>tf::AsyncTask</scope><name>AsyncTask</name></member>
      <member refid="classtf_1_1AsyncTask_1a9d2d950ae2796cc322252780b5b7f401" prot="private" virt="non-virtual"><scope>tf::AsyncTask</scope><name>AsyncTask</name></member>
      <member refid="classtf_1_1AsyncTask_1ae42c70dc0c5edc6d58f47b346125fca3" prot="public" virt="non-virtual"><scope>tf::AsyncTask</scope><name>empty</name></member>
      <member refid="classtf_1_1AsyncTask_1a763b2f90bc53f92d680a635fe28e858e" prot="private" virt="non-virtual"><scope>tf::AsyncTask</scope><name>Executor</name></member>
      <member refid="classtf_1_1AsyncTask_1a61184f9bd9c801d0a5eccecfdbddc641" prot="private" virt="non-virtual"><scope>tf::AsyncTask</scope><name>FlowBuilder</name></member>
      <member refid="classtf_1_1AsyncTask_1a826a2ea909094f5a26c2df876de58056" prot="public" virt="non-virtual"><scope>tf::AsyncTask</scope><name>hash_value</name></member>
      <member refid="classtf_1_1AsyncTask_1a48436c648bde656d4e5c6c7deac7b367" prot="public" virt="non-virtual"><scope>tf::AsyncTask</scope><name>operator=</name></member>
      <member refid="classtf_1_1AsyncTask_1a1597b2cd541086c04da1854db9708bbc" prot="public" virt="non-virtual"><scope>tf::AsyncTask</scope><name>operator=</name></member>
      <member refid="classtf_1_1AsyncTask_1a7c12835577fbdc1bca3190cf92c78088" prot="public" virt="non-virtual"><scope>tf::AsyncTask</scope><name>reset</name></member>
      <member refid="classtf_1_1AsyncTask_1af3d14e26ba8af9e6cc5a32aad8446de7" prot="private" virt="non-virtual"><scope>tf::AsyncTask</scope><name>Runtime</name></member>
      <member refid="classtf_1_1AsyncTask_1af043dd6f6a359602805d9c7dd7539cca" prot="private" virt="non-virtual"><scope>tf::AsyncTask</scope><name>Taskflow</name></member>
      <member refid="classtf_1_1AsyncTask_1a0aa0e12e4a0ba023033e808fb2132fdf" prot="private" virt="non-virtual"><scope>tf::AsyncTask</scope><name>TaskView</name></member>
      <member refid="classtf_1_1AsyncTask_1af7d74066d5df4107c585a0a64451a34c" prot="public" virt="non-virtual"><scope>tf::AsyncTask</scope><name>~AsyncTask</name></member>
    </listofallmembers>
  </compounddef>
</doxygen>
