tin  1.5.9
tsm::task Class Reference

#include <coroutine.h>

Collaboration diagram for tsm::task:
Collaboration graph

Classes

struct  promise_type
 

Public Types

using handle_type = std::coroutine_handle< promise_type >
 

Public Member Functions

 task ()=default
 
 task (handle_type handle) noexcept
 
 task (task const &)=delete
 
taskoperator= (task const &)=delete
 
 task (task &&other) noexcept
 
taskoperator= (task &&other) noexcept
 
 ~task ()
 
 operator bool () const noexcept
 
bool done () const noexcept
 
handle_type handle () const noexcept
 
bool resume ()
 

Detailed Description

Move-only handle for a statically allocated coroutine task.

A task is the runtime-owned handle for one coroutine frame. It separates coroutine lifetime and resumption from the application code that wrote the coroutine body. Executors store task objects in fixed slots and resume them only when their task_context reports that the task is ready.

Member Typedef Documentation

◆ handle_type

using tsm::task::handle_type = std::coroutine_handle<promise_type>

Constructor & Destructor Documentation

◆ task() [1/4]

tsm::task::task ( )
default

◆ task() [2/4]

tsm::task::task ( handle_type  handle)
inlineexplicitnoexcept

◆ task() [3/4]

tsm::task::task ( task const &  )
delete

◆ task() [4/4]

tsm::task::task ( task &&  other)
inlinenoexcept

◆ ~task()

tsm::task::~task ( )
inline

Member Function Documentation

◆ done()

bool tsm::task::done ( ) const
inlinenoexcept

◆ handle()

handle_type tsm::task::handle ( ) const
inlinenoexcept

◆ operator bool()

tsm::task::operator bool ( ) const
inlineexplicitnoexcept

◆ operator=() [1/2]

task& tsm::task::operator= ( task &&  other)
inlinenoexcept

◆ operator=() [2/2]

task& tsm::task::operator= ( task const &  )
delete

◆ resume()

bool tsm::task::resume ( )
inline

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