|
NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
异步任务 更多...
#include <generator.hpp>
类 | |
| struct | promise_type |
| 任务的promise类型 更多... | |
| struct | awaiter |
| 任务等待器 更多... | |
Public 成员函数 | |
| task (coroutine_handle< promise_type > h) | |
| 从协程句柄构造 | |
| task (task &&other) noexcept | |
| 移动构造函数 | |
| task & | operator= (task &&other) noexcept |
| 移动赋值运算符 | |
| ~task () | |
| 析构函数,销毁协程 | |
| awaiter | operator co_await () |
| 获取等待器 | |
| bool | done () const noexcept |
| 检查任务是否已完成 | |
| void | resume () |
| 恢复任务执行 | |
| T | get () |
| 同步获取任务结果 | |
| void | set_cancellation_token (cancellation_token &token) |
| 设置取消令牌 | |
| bool | is_cancelled () const noexcept |
| 检查任务是否被取消 | |
异步任务
| T | 任务结果类型 |
表示一个可能产生结果的异步操作。 支持co_await等待、取消、组合等操作。
在文件 generator.hpp 第 466 行定义.
|
inlineexplicit |
从协程句柄构造
| h | 协程句柄 |
在文件 generator.hpp 第 593 行定义.
被这些函数引用 task< T >::promise_type::get_return_object(), operator=() , 以及 task().
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inline |