ttg::resumable_task_state Struct Reference

Documentation

encapsulates the state of the coroutine object visible to the outside world

Note
this is the promise_type for resumable_task coroutine

Definition at line 79 of file coroutine.h.

Public Types

using handle_type = coroutine_handle< resumable_task_state >
 

Public Member Functions

 resumable_task_state () noexcept=default
 
 resumable_task_state (const resumable_task_state &)=delete
 
resumable_task_stateoperator= (const resumable_task_state &)=delete
 
 resumable_task_state (resumable_task_state &&)=delete
 
resumable_task_stateoperator= (resumable_task_state &&)=delete
 
constexpr bool ready () const
 
constexpr bool completed () const
 
ttg::span< event * > events ()
 
members mandated by the promise_type concept
resumable_task get_return_object ()
 
suspend_never initial_suspend () noexcept
 
suspend_always final_suspend () noexcept
 
void return_void ()
 
void unhandled_exception ()
 

Static Public Attributes

constexpr static std::size_t MaxNumEvents = 20
 

Friends

template<std::size_t N>
struct resumable_task_events
 

Member Typedef Documentation

◆ handle_type

Constructor & Destructor Documentation

◆ resumable_task_state() [1/3]

ttg::resumable_task_state::resumable_task_state ( )
defaultnoexcept

◆ resumable_task_state() [2/3]

ttg::resumable_task_state::resumable_task_state ( const resumable_task_state )
delete

◆ resumable_task_state() [3/3]

ttg::resumable_task_state::resumable_task_state ( resumable_task_state &&  )
delete

Member Function Documentation

◆ completed()

constexpr bool ttg::resumable_task_state::completed ( ) const
inlineconstexpr
Returns
true if the task is completed

Definition at line 134 of file coroutine.h.

◆ events()

ttg::span<event*> ttg::resumable_task_state::events ( )
inline

Definition at line 136 of file coroutine.h.

◆ final_suspend()

suspend_always ttg::resumable_task_state::final_suspend ( )
inlinenoexcept
Note
suspend task before destroying it so the runtime can know that the task is completed

Definition at line 99 of file coroutine.h.

◆ get_return_object()

resumable_task ttg::resumable_task_state::get_return_object ( )
inline
Note
start task eagerly

Definition at line 93 of file coroutine.h.

◆ initial_suspend()

suspend_never ttg::resumable_task_state::initial_suspend ( )
inlinenoexcept
Note
start task eagerly

Definition at line 96 of file coroutine.h.

◆ operator=() [1/2]

resumable_task_state& ttg::resumable_task_state::operator= ( const resumable_task_state )
delete

◆ operator=() [2/2]

resumable_task_state& ttg::resumable_task_state::operator= ( resumable_task_state &&  )
delete

◆ ready()

constexpr bool ttg::resumable_task_state::ready ( ) const
inlineconstexpr
Returns
true if ready to resume

Definition at line 127 of file coroutine.h.

◆ return_void()

void ttg::resumable_task_state::return_void ( )
inline
Note
start task eagerly

Definition at line 103 of file coroutine.h.

◆ unhandled_exception()

void ttg::resumable_task_state::unhandled_exception ( )
inline
Note
start task eagerly

Definition at line 104 of file coroutine.h.

Friends And Related Function Documentation

◆ resumable_task_events

template<std::size_t N>
friend struct resumable_task_events
friend

Definition at line 144 of file coroutine.h.

Member Data Documentation

◆ MaxNumEvents

constexpr static std::size_t ttg::resumable_task_state::MaxNumEvents = 20
inlinestaticconstexpr

Definition at line 87 of file coroutine.h.


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