dpp::coroutine
dpp::basic_awaitable< coroutine< R > >
coro/coroutine.h
dpp::coroutine::awaiter
typename R
R using dpp::coroutine< R >::result_type = R result_type dpp::coroutine::result_type

The type of the result produced by this coroutine.

struct friend struct detail::coroutine::promise_t< R > detail::coroutine::promise_t< R > dpp::coroutine::promise_t< R > detail::coroutine::promise_t< R >

Promise has friend access for the constructor.

detail::coroutine::handle_t< R > detail::coroutine::handle_t<R> dpp::coroutine< R >::handle handle dpp::coroutine::handle {nullptr}

Coroutine handle.

dpp::coroutine< R >::coroutine
(detail::coroutine::handle_t< R > h)
coroutine
dpp::coroutine::coroutine
detail::coroutine::handle_t< R > h

Construct from a handle. Internal use only.

dpp::coroutine< R >::coroutine
()=default
coroutine
dpp::coroutine::coroutine

Default constructor, creates an empty coroutine.

dpp::coroutine< R >::coroutine
(const coroutine &)=delete
coroutine
dpp::coroutine::coroutine
const coroutine &

Copy constructor is disabled.

dpp::coroutine< R >::coroutine
(coroutine &&other) noexcept
coroutine
dpp::coroutine::coroutine
coroutine && other

Move constructor, grabs another coroutine's handle.

other

Coroutine to move the handle from

dpp::coroutine< R >::~coroutine
()
~coroutine
dpp::coroutine::~coroutine

Destructor, destroys the handle.

auto auto dpp::coroutine< R >::operator co_await () operator co_await dpp::coroutine::operator co_await
coroutine & coroutine & dpp::coroutine< R >::operator= (const coroutine &)=delete operator= dpp::coroutine::operator= const coroutine &

Copy assignment is disabled.

coroutine & coroutine & dpp::coroutine< R >::operator= (coroutine &&other) noexcept operator= dpp::coroutine::operator= coroutine && other

Move assignment, grabs another coroutine's handle.

other

Coroutine to move the handle from

auto auto dpp::basic_awaitable< coroutine< R > >::sync_wait () sync_wait dpp::basic_awaitable< coroutine< R > >::sync_wait

Blocks this thread and waits for the awaitable to finish.

This will BLOCK THE THREAD. It is likely you want to use co_await instead.

If T is void, returns a boolean for which true means the awaitable completed, false means it timed out.

If T is non-void, returns a std::optional<T> for which an absence of value means timed out.

auto auto dpp::basic_awaitable< coroutine< R > >::sync_wait_for (const std::chrono::duration< Rep, Period > &duration) sync_wait_for dpp::basic_awaitable< coroutine< R > >::sync_wait_for const std::chrono::duration< Rep, Period > & duration

Blocks this thread and waits for the awaitable to finish.

This will BLOCK THE THREAD. It is likely you want to use co_await instead.

duration

Maximum duration to wait for

If T is void, returns a boolean for which true means the awaitable completed, false means it timed out.

If T is non-void, returns a std::optional<T> for which an absence of value means timed out.

auto auto dpp::basic_awaitable< coroutine< R > >::sync_wait_until (const std::chrono::time_point< Clock, Duration > &time) sync_wait_until dpp::basic_awaitable< coroutine< R > >::sync_wait_until const std::chrono::time_point< Clock, Duration > & time

Blocks this thread and waits for the awaitable to finish.

This will BLOCK THE THREAD. It is likely you want to use co_await instead.

time

Maximum time point to wait for

If T is void, returns a boolean for which true means the awaitable completed, false means it timed out.

If T is non-void, returns a std::optional<T> for which an absence of value means timed out.

auto auto dpp::basic_awaitable< coroutine< R > >::sync_wait_impl (auto &&do_wait) sync_wait_impl dpp::basic_awaitable< coroutine< R > >::sync_wait_impl auto && do_wait

Implementation for sync_wait. This is code used by sync_wait, sync_wait_for, sync_wait_until.

Timed

Whether the wait function times out or not

do_wait

Function to do the actual wait on the cv

If T is void, returns a boolean for which true means the awaitable completed, false means it timed out.

If T is non-void, returns a std::optional<T> for which an absence of value means timed out.

Base type for a coroutine, starts on co_await.

- This feature is EXPERIMENTAL. The API may change at any time and there may be bugs. Please report any to GitHub Issues or to our Discord Server.

- Using co_await on this object more than once is undefined behavior.

R

Return type of the coroutine. Can be void, or a complete object that supports move construction and move assignment.

dpp::basic_awaitable< Derived >
dpp::basic_awaitable< coroutine< R > >
< coroutine< R > >
dpp::coroutine< R >
dpp::basic_awaitable< Derived >
dpp::basic_awaitable< coroutine< R > >
< coroutine< R > >
dpp::coroutine< R >
- dpp::coroutine
  coroutine
- dpp::coroutine
  coroutine
- dpp::coroutine
  coroutine
- dpp::coroutine
  coroutine
- dpp::coroutine
  detail::coroutine::promise_t< R >
- dpp::coroutine
  handle
- dpp::coroutine
  operator co_await
- dpp::coroutine
  operator=
- dpp::coroutine
  operator=
- dpp::coroutine
  result_type
- dpp::coroutine
  sync_wait
- dpp::coroutine
  sync_wait_for
- dpp::coroutine
  sync_wait_impl
- dpp::coroutine
  sync_wait_until
- dpp::coroutine
  ~coroutine