D++ (DPP)
C++ Discord API Bot Library
|
Base type for a coroutine, starts on co_await. More...
#include <coro/coroutine.h>
Public Types | |
using | result_type = R |
The type of the result produced by this coroutine. More... | |
Public Member Functions | |
coroutine ()=default | |
Default constructor, creates an empty coroutine. More... | |
coroutine (const coroutine &)=delete | |
Copy constructor is disabled. More... | |
coroutine (coroutine &&other) noexcept | |
Move constructor, grabs another coroutine's handle. More... | |
~coroutine () | |
Destructor, destroys the handle. More... | |
coroutine & | operator= (const coroutine &)=delete |
Copy assignment is disabled. More... | |
coroutine & | operator= (coroutine &&other) noexcept |
Move assignment, grabs another coroutine's handle. More... | |
auto | operator co_await () |
auto | sync_wait () |
Blocks this thread and waits for the awaitable to finish. More... | |
auto | sync_wait_for (const std::chrono::duration< Rep, Period > &duration) |
Blocks this thread and waits for the awaitable to finish. More... | |
auto | sync_wait_until (const std::chrono::time_point< Clock, Duration > &time) |
Blocks this thread and waits for the awaitable to finish. More... | |
Protected Member Functions | |
auto | sync_wait_impl (auto &&do_wait) |
Implementation for sync_wait. This is code used by sync_wait, sync_wait_for, sync_wait_until. More... | |
Friends | |
struct | detail::coroutine::promise_t< R > |
Promise has friend access for the constructor. More... | |
Base type for a coroutine, starts on co_await.
R | Return type of the coroutine. Can be void, or a complete object that supports move construction and move assignment. |
using dpp::coroutine< R >::result_type = R |
The type of the result produced by this coroutine.
|
default |
Default constructor, creates an empty coroutine.
|
delete |
Copy constructor is disabled.
|
inlinenoexcept |
Move constructor, grabs another coroutine's handle.
other | Coroutine to move the handle from |
|
inline |
Destructor, destroys the handle.
|
inline |
|
delete |
Copy assignment is disabled.
|
inlinenoexcept |
Move assignment, grabs another coroutine's handle.
other | Coroutine to move the handle from |
|
inlineinherited |
Blocks this thread and waits for the awaitable to finish.
|
inlineinherited |
Blocks this thread and waits for the awaitable to finish.
duration | Maximum duration to wait for |
|
inlineprotectedinherited |
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 |
|
inlineinherited |
Blocks this thread and waits for the awaitable to finish.
time | Maximum time point to wait for |
|
friend |
Promise has friend access for the constructor.