dpp::detail::task::promise_base
dpp::basic_promise< R >
dpp::detail::task::promise_t< T >
dpp::detail::task::promise_t< R >
task.h
dpp::detail::task::promise_base::proxy_awaiter
typename R
std::atomic< bool > std::atomic<bool> dpp::detail::task::promise_base< R >::cancelled cancelled dpp::detail::task::promise_base::cancelled = false

Whether the task is cancelled or not.

awaitable_type T T
auto auto dpp::detail::task::promise_base< R >::await_transform (T &&expr) const await_transform dpp::detail::task::promise_base::await_transform T && expr

Function called whenever co_await is used inside of the task.

dpp::task_cancelled_exception

On resumption if the task was cancelled

proxy_awaiter Returns a proxy awaiter that will check for cancellation on resumption

void void dpp::basic_promise< R >::emplace_value (Args &&... args) emplace_value dpp::basic_promise< R >::emplace_value Args &&... args

Construct the result in place by forwarding the arguments, and by default resume any awaiter.

Notify

Whether to resume any awaiter or not.

dpp::logic_exception

if the promise is not empty.

awaitable< R > awaitable< R > dpp::detail::promise::promise_base< R >::get_awaitable () get_awaitable dpp::basic_promise< R >::get_awaitable

Get an awaitable object for this promise.

dpp::logic_exception

if get_awaitable has already been called on this object.

awaitable<T> An object that can be co_await-ed to retrieve the value of this promise.

std_coroutine::suspend_never std_coroutine::suspend_never dpp::detail::task::promise_base< R >::initial_suspend () const noexcept initial_suspend dpp::detail::task::promise_base::initial_suspend

Function called by the standard library when the coroutine is created.

std::suspend_never Don't suspend, the coroutine starts immediately.

void void dpp::detail::promise::promise_base< R >::notify_awaiter () notify_awaiter dpp::basic_promise< R >::notify_awaiter

Notify a currently awaiting coroutine that the result is ready.

This may resume the coroutine on the current thread.

?

Any exception thrown by the coroutine if resumed will propagate

void void dpp::detail::promise::promise_base< R >::set_exception (std::exception_ptr ptr) set_exception dpp::basic_promise< R >::set_exception std::exception_ptr ptr

Set this promise to an exception and resume any awaiter.

Notify

Whether to resume any awaiter or not.

dpp::logic_exception

if the promise is not empty.

?

Any exception thrown by the coroutine if resumed will propagate

void void dpp::basic_promise< R >::set_value (U &&v) set_value dpp::basic_promise< R >::set_value U && v

Construct the result by forwarding reference, and resume any awaiter.

Notify

Whether to resume any awaiter or not.

dpp::logic_exception

if the promise is not empty.

void void dpp::detail::task::promise_base< R >::unhandled_exception () unhandled_exception dpp::detail::task::promise_base::unhandled_exception

Function called by the standard library when an exception is thrown and not caught in the coroutine.

Stores the exception pointer to rethrow on co_await. If the task object is destroyed and was not cancelled, throw instead

result_t< R > using dpp::detail::promise::promise_base< R >::storage_type = storage_type dpp::basic_promise< R >::storage_type

Variant representing one of either 3 states of the result value : empty, result, exception.

std_coroutine::coroutine_handle std_coroutine::coroutine_handle dpp::detail::promise::promise_base< R >::awaiter awaiter dpp::basic_promise< R >::awaiter

Coroutine handle currently awaiting the completion of this promise.

std::atomic< uint8_t > std::atomic<uint8_t> dpp::detail::promise::promise_base< R >::state state dpp::basic_promise< R >::state

State of the awaitable tied to this promise.

storage_type storage_type dpp::detail::promise::promise_base< R >::value value dpp::basic_promise< R >::value

State of the result value.

storage_type

use .index() instead of std::holds_alternative to support promise_base<std::exception_ptr> and promise_base<std::monostate> :)

std_coroutine::coroutine_handle std_coroutine::coroutine_handle dpp::detail::promise::promise_base< R >::release_awaiter () release_awaiter dpp::basic_promise< R >::release_awaiter

Unlinks this promise from its currently linked awaiter and returns it.

At the time of writing this is only used in the case of a serious internal error in dpp::task. Avoid using this as this will crash if the promise is used after this.

void void dpp::detail::promise::promise_base< R >::throw_if_not_empty () throw_if_not_empty dpp::basic_promise< R >::throw_if_not_empty

Check if the result is empty, throws otherwise.

dpp::logic_exception

if the result isn't empty.

Base implementation of task::promise_t, without the logic that would depend on the return type. Meant to be inherited from.

dpp::basic_promise< T >
dpp::basic_promise< R >
< R >
dpp::detail::promise::promise_base< T >
dpp::detail::promise::promise_base< R >
< R >
dpp::detail::promise::promise_base< T >
dpp::detail::task::promise_base< R >
dpp::detail::task::promise_base< void >
< void >
dpp::detail::task::promise_t< R >
dpp::detail::task::promise_t< T >
< T >
dpp::detail::task::promise_t< void >
< void >
T
bool
dpp::basic_promise< T >
dpp::basic_promise< R >
< R >
dpp::detail::promise::promise_base< T >
value
state
awaiter
dpp::detail::promise::promise_base< R >
value
state
awaiter
< R >
dpp::detail::promise::promise_base< T >
value
state
awaiter
dpp::detail::task::promise_base< R >
cancelled
result_t< R >
result_t< T >
std::atomic< T >
ptr
std::atomic< bool >
ptr
< bool >
std::atomic< uint8_t >
ptr
< uint8_t >
coroutine_handle
uint8_t
- dpp::detail::task::promise_base
  await_transform
- dpp::detail::task::promise_base
  awaiter
- dpp::detail::task::promise_base
  cancelled
- dpp::detail::task::promise_base
  emplace_value
- dpp::detail::task::promise_base
  get_awaitable
- dpp::detail::task::promise_base
  initial_suspend
- dpp::detail::task::promise_base
  notify_awaiter
- dpp::detail::task::promise_base
  operator=
- dpp::detail::task::promise_base
  promise_base
- dpp::detail::task::promise_base
  release_awaiter
- dpp::detail::task::promise_base
  set_exception
- dpp::detail::task::promise_base
  set_value
- dpp::detail::task::promise_base
  state
- dpp::detail::task::promise_base
  storage_type
- dpp::detail::task::promise_base
  throw_if_not_empty
- dpp::detail::task::promise_base
  unhandled_exception
- dpp::detail::task::promise_base
  value