Donner SVG main
0.8.0 ยท 766e862a0.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::tasks::Task< T > Class Template Reference

A lazily started coroutine that transfers directly to its single awaiter at completion. More...

#include "donner/base/tasks/Task.h"

Classes

class  Awaiter
 Borrows the frame for its sole await. More...

Public Types

using promise_type = detail::TaskPromise<T>
 Coroutine promise.
using Handle = std::coroutine_handle<promise_type>
 Handle to the owned frame.

Public Member Functions

 Task (const Task &)=delete
Task & operator= (const Task &)=delete
 Task (Task &&other) noexcept
Task & operator= (Task &&other) noexcept
Awaiter operator co_await () const noexcept

Friends

class detail::TaskPromise< T >

Detailed Description

template<typename T>
class donner::tasks::Task< T >

A lazily started coroutine that transfers directly to its single awaiter at completion.

A coroutine returning this type takes a TaskScheduler& as its first explicit parameter. Keep the owner alive through the await and the allocating scheduler alive until the owner releases the frame, including after a completed await. Destroying an unstarted task releases it without executing its body. Moving a task transfers ownership of its frame. The caller serializes operations on the owner itself.

Template Parameters
TThe result value or void.

The documentation for this class was generated from the following file: