.. index:: pair: class; EE::TaskResolver .. _doxid-class_e_e_1_1_task_resolver: template class EE::TaskResolver =============================== .. toctree:: :hidden: Overview ~~~~~~~~ Completes a :ref:`Task ` : call it with the value. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include template class TaskResolver { public: // construction :target:`TaskResolver`(); :target:`TaskResolver`(const TaskResolver& other); :target:`TaskResolver`(TaskResolver&&); :target:`~TaskResolver`(); // methods TaskResolver& :target:`operator=`(const TaskResolver& other); TaskResolver& :target:`operator=`(TaskResolver&& other); template bool :ref:`operator()`(Args&&... args) const; }; .. _details-class_e_e_1_1_task_resolver: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Completes a :ref:`Task ` : call it with the value. Filled in by :ref:`Task\::create() `, which returns its task. Copyable: every copy completes the same task, so it can be captured by several callbacks, and the first call wins (a later call reports :ref:`TaskDiagnostic::ResolvedTwice `). Calling it runs the continuations attached without an executor (then( fn ), onComplete( fn )) on the calling thread before it returns. When the last copy is destroyed without having been called, the task is abandoned and :ref:`TaskDiagnostic::Abandoned ` is reported: its consumer is still told (then() skips its function, onComplete() receives std::nullopt), so it never waits forever. A default-constructed resolver belongs to no task until create() fills it; calling it before that only reports ResolvedTwice. Methods ------- .. index:: pair: function; operator() .. _doxid-class_e_e_1_1_task_resolver_1ae936ec3ef05e7c2b73409e4cb9510dfb: .. ref-code-block:: cpp :class: doxyrest-title-code-block template bool operator()(Args&&... args) const Completes the task with the value built from args. .. rubric:: Returns: False (and reports :ref:`TaskDiagnostic::ResolvedTwice `) if it was already completed.