D++ (DPP)
C++ Discord API Bot Library
|
Base class of dpp::task. More...
#include <task.h>
Public Member Functions | |
task_base ()=default | |
Default constructor, creates a task not bound to a coroutine. More... | |
task_base (const task_base &)=delete | |
Copy constructor is disabled. More... | |
task_base (task_base &&other) noexcept | |
Move constructor, grabs another task's coroutine handle. More... | |
~task_base () | |
Destructor. More... | |
task_base & | operator= (const task_base &)=delete |
Copy assignment is disabled. More... | |
task_base & | operator= (task_base &&other) noexcept |
Move assignment, grabs another task's coroutine handle. More... | |
bool | await_ready () const |
Check whether or not a call to co_await will suspend the caller. More... | |
bool | await_suspend (std_coroutine::coroutine_handle<> caller) noexcept |
Second function called by the standard library when the task is co_await-ed, if await_ready returned false. More... | |
bool | done () const noexcept |
Function to check if the task has finished its execution entirely. More... | |
dpp::task< R > & | cancel () &noexcept |
Cancel the task, it will stop the next time it uses co_await. On co_await-ing this task, throws dpp::task_cancelled_exception. More... | |
dpp::task< R > && | cancel () &&noexcept |
Cancel the task, it will stop the next time it uses co_await. On co_await-ing this task, throws dpp::task_cancelled_exception. More... | |
decltype(auto) | await_resume () & |
Function called by the standard library when resuming. More... | |
decltype(auto) | await_resume () const & |
Function called by the standard library when resuming. More... | |
decltype(auto) | await_resume () && |
Function called by the standard library when resuming. More... | |
Protected Attributes | |
handle_t< R > | handle |
The coroutine handle of this task. More... | |
Friends | |
struct | promise_t< R > |
Promise type of this coroutine. For internal use only, do not use. More... | |
Base class of dpp::task.
|
default |
Default constructor, creates a task not bound to a coroutine.
|
delete |
Copy constructor is disabled.
|
inlinenoexcept |
Move constructor, grabs another task's coroutine handle.
other | Task to move the handle from |
|
inline |
Destructor.
Destroys the handle.
|
inline |
Check whether or not a call to co_await will suspend the caller.
This function is called by the standard library as a first step when using co_await. If it returns true then the caller is not suspended.
logic_exception | if the task is empty. |
|
inline |
Function called by the standard library when resuming.
|
inline |
Function called by the standard library when resuming.
|
inline |
Function called by the standard library when resuming.
|
inlinenoexcept |
Second function called by the standard library when the task is co_await-ed, if await_ready returned false.
Stores the calling coroutine in the promise to resume when this task suspends.
caller | The calling coroutine, now suspended |
|
inlinenoexcept |
Cancel the task, it will stop the next time it uses co_await. On co_await-ing this task, throws dpp::task_cancelled_exception.
|
inlinenoexcept |
Cancel the task, it will stop the next time it uses co_await. On co_await-ing this task, throws dpp::task_cancelled_exception.
|
inlinenoexcept |
Function to check if the task has finished its execution entirely.
|
delete |
Copy assignment is disabled.
|
inlinenoexcept |
Move assignment, grabs another task's coroutine handle.
other | Task to move the handle from |
|
friend |
Promise type of this coroutine. For internal use only, do not use.
|
protected |
The coroutine handle of this task.