uvco 0.1
|
#include <promise_core.h>
Public Member Functions | |
PromiseCore ()=default | |
PromiseCore (const PromiseCore &)=delete | |
PromiseCore (PromiseCore &&)=delete | |
PromiseCore< void > & | operator= (const PromiseCore &)=delete |
PromiseCore< void > & | operator= (PromiseCore &&)=delete |
~PromiseCore () override | |
void | cancel () |
See PromiseCore::cancel . | |
void | setHandle (std::coroutine_handle<> handle) |
See PromiseCore::set_resume . | |
void | resetHandle () |
See PromiseCore::resetHandle . | |
bool | willResume () const |
See PromiseCore::willResume . | |
bool | ready () const |
See PromiseCore::ready . | |
bool | stale () const |
See PromiseCore::stale . | |
void | resume () |
See PromiseCore::resume . | |
void | except (std::exception_ptr exc) |
See PromiseCore::except . | |
Public Member Functions inherited from uvco::RefCounted< PromiseCore< void > > | |
RefCounted (const RefCounted &other)=default | |
RefCounted (RefCounted &&other) noexcept | |
RefCounted & | operator= (const RefCounted &other)=default |
RefCounted & | operator= (RefCounted &&other) noexcept |
virtual | ~RefCounted ()=default |
virtual PromiseCore< void > * | addRef () |
virtual void | delRef () |
Public Attributes | |
bool | ready_ = false |
std::optional< std::exception_ptr > | exception_ |
Contains the exception if thrown. | |
Private Attributes | |
std::optional< std::coroutine_handle<> > | handle_ |
PromiseState | state_ = PromiseState::init |
Additional Inherited Members | |
Protected Member Functions inherited from uvco::RefCounted< PromiseCore< void > > | |
RefCounted ()=default | |
A void
PromiseCore works like a normal PromiseCore
, but with the specialization of not transferring values - only control is switched from the yielding to the awaiting coroutine.
|
default |
|
delete |
|
delete |
|
override |
void uvco::PromiseCore< void >::cancel | ( | ) |
See PromiseCore::cancel
.
void uvco::PromiseCore< void >::except | ( | std::exception_ptr | exc | ) |
See PromiseCore::except
.
|
delete |
|
delete |
bool uvco::PromiseCore< void >::ready | ( | ) | const |
See PromiseCore::ready
.
void uvco::PromiseCore< void >::resetHandle | ( | ) |
void uvco::PromiseCore< void >::resume | ( | ) |
See PromiseCore::resume
.
void uvco::PromiseCore< void >::setHandle | ( | std::coroutine_handle<> | handle | ) |
See PromiseCore::set_resume
.
bool uvco::PromiseCore< void >::stale | ( | ) | const |
See PromiseCore::stale
.
bool uvco::PromiseCore< void >::willResume | ( | ) | const |
std::optional<std::exception_ptr> uvco::PromiseCore< void >::exception_ |
Contains the exception if thrown.
|
private |
bool uvco::PromiseCore< void >::ready_ = false |
In a void promise, we only track if the coroutine has finished, because it doesn't return anything.
|
private |