Zth (libzth)
Loading...
Searching...
No Matches
zth::coro::promise< Promise > Class Template Reference

#include <coro.h>

Inheritance diagram for zth::coro::promise< Promise >:
zth::coro::promise_base zth::RefCounted zth::UniqueID< promise_base > zth::NamedUniqueID< Named > zth::UniqueIDBase zth::coro::task_promise_base< void > zth::coro::task_promise< void >

Public Types

using promise_type = Promise
 
- Public Types inherited from zth::UniqueID< promise_base >
typedef NamedUniqueID base
 

Public Member Functions

virtual ~promise () noexcept override
 
auto typedHandle () noexcept
 
virtual std::coroutine_handle handle () noexcept final
 
decltype(auto) initial_suspend () noexcept
 
decltype(auto) final_suspend () noexcept
 
template<typename A >
decltype(auto) await_transform (A &&a) noexcept
 
virtual bool running () const noexcept final
 
void run ()
 
- Public Member Functions inherited from zth::coro::promise_base
 ZTH_MALLOC_ATTR ((malloc, alloc_size(1))) static void *operator new(std
 
virtual ~promise_base () noexcept override=default
 
std::coroutine_handle continuation () noexcept
 
bool has_continuation () const noexcept
 
void set_continuation (std::coroutine_handle<> cont={}) noexcept
 
- Public Member Functions inherited from zth::RefCounted
 RefCounted () noexcept
 
virtual ~RefCounted () noexcept
 
void used () noexcept
 
bool unused () noexcept
 
size_t refs () const noexcept
 
- Public Member Functions inherited from zth::UniqueID< promise_base >
 UniqueID (UniqueID const &)=delete
 
 UniqueID (UniqueID &&u) noexcept
 
 UniqueID (string const &name)
 
 UniqueID (string &&name)
 
 UniqueID (char const *name=nullptr)
 
UniqueIDoperator= (UniqueID const &)=delete
 
UniqueIDoperator= (UniqueID &&u) noexcept
 
virtual ~UniqueID () noexcept override=default
 
void const * normptr () const noexcept
 
uint64_t id () const noexcept
 
- Public Member Functions inherited from zth::NamedUniqueID< Named >
virtual ~NamedUniqueID () noexcept override=default
 
string const & name () const noexcept
 
void setName (string const &name)
 
void setName (char const *name)
 
void setName (string &&name)
 
virtual char const * id_str () const noexcept override
 

Protected Member Functions

 promise (cow_string const &name)
 
void running (bool set) noexcept
 
promise_type const & self () const noexcept
 
promise_typeself () noexcept
 
- Protected Member Functions inherited from zth::coro::promise_base
 promise_base (cow_string const &name)
 
- Protected Member Functions inherited from zth::UniqueID< promise_base >
virtual uint64_t id_ () const noexcept final
 
- Protected Member Functions inherited from zth::NamedUniqueID< Named >
 NamedUniqueID (char const *name=nullptr)
 
 NamedUniqueID (string const &name)
 
 NamedUniqueID (string &&name)
 
- Protected Member Functions inherited from zth::UniqueIDBase
virtual ~UniqueIDBase () noexcept=default
 

Friends

template<typename P , typename A >
class promise_awaitable
 

Additional Inherited Members

- Static Public Member Functions inherited from zth::coro::promise_base
static ZTH_MALLOC_INLINE void operator delete (void *ptr, std::size_t n) noexcept
 
- Static Public Member Functions inherited from zth::UniqueID< promise_base >
static uint64_t getID () noexcept
 

Detailed Description

template<typename Promise>
class zth::coro::promise< Promise >

Definition at line 313 of file coro.h.

Member Typedef Documentation

◆ promise_type

template<typename Promise >
using zth::coro::promise< Promise >::promise_type = Promise

Definition at line 315 of file coro.h.

Constructor & Destructor Documentation

◆ promise()

template<typename Promise >
zth::coro::promise< Promise >::promise ( cow_string const &  name)
inlineexplicitprotected

Definition at line 318 of file coro.h.

◆ ~promise()

template<typename Promise >
virtual zth::coro::promise< Promise >::~promise ( )
inlineoverridevirtualnoexcept

Definition at line 323 of file coro.h.

Member Function Documentation

◆ await_transform()

template<typename Promise >
template<typename A >
decltype(auto) zth::coro::promise< Promise >::await_transform ( A &&  a)
inlinenoexcept

Definition at line 383 of file coro.h.

◆ final_suspend()

template<typename Promise >
decltype(auto) zth::coro::promise< Promise >::final_suspend ( )
inlinenoexcept

Definition at line 360 of file coro.h.

◆ handle()

template<typename Promise >
virtual std::coroutine_handle zth::coro::promise< Promise >::handle ( )
inlinefinalvirtualnoexcept

Implements zth::coro::promise_base.

Definition at line 333 of file coro.h.

◆ initial_suspend()

template<typename Promise >
decltype(auto) zth::coro::promise< Promise >::initial_suspend ( )
inlinenoexcept

Definition at line 338 of file coro.h.

◆ run()

template<typename Promise >
void zth::coro::promise< Promise >::run ( )
inline

Definition at line 396 of file coro.h.

◆ running() [1/2]

template<typename Promise >
virtual bool zth::coro::promise< Promise >::running ( ) const
inlinefinalvirtualnoexcept

Implements zth::coro::promise_base.

Definition at line 391 of file coro.h.

◆ running() [2/2]

template<typename Promise >
void zth::coro::promise< Promise >::running ( bool  set)
inlineprotectednoexcept

Definition at line 412 of file coro.h.

◆ self() [1/2]

template<typename Promise >
promise_type const & zth::coro::promise< Promise >::self ( ) const
inlineprotectednoexcept

Definition at line 418 of file coro.h.

◆ self() [2/2]

template<typename Promise >
promise_type & zth::coro::promise< Promise >::self ( )
inlineprotectednoexcept

Definition at line 423 of file coro.h.

◆ typedHandle()

template<typename Promise >
auto zth::coro::promise< Promise >::typedHandle ( )
inlinenoexcept

Definition at line 328 of file coro.h.

Friends And Related Symbol Documentation

◆ promise_awaitable

template<typename Promise >
template<typename P , typename A >
friend class promise_awaitable
friend

Definition at line 389 of file coro.h.


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