Template Struct IntegrationTask
Defined in File coroutine_integration_demo.cpp
Nested Relationships
Nested Types
Struct Documentation
-
template<typename State>
struct IntegrationTask C++20 协程与 diffeq 库集成示例
这个示例展示了如何使用 C++20 协程特性与微分方程积分器结合, 实现更细粒度的 CPU 运行控制和任务调度。
主要特性:
协程化的积分步进,可以暂停和恢复
细粒度的进度报告和控制
协作式多任务处理
零拷贝的状态传递
积分任务的协程返回类型
Public Types
-
using handle_type = std::coroutine_handle<promise_type>
Public Functions
-
inline explicit IntegrationTask(handle_type h)
-
inline ~IntegrationTask()
-
inline IntegrationTask(IntegrationTask &&other) noexcept
-
inline IntegrationTask &operator=(IntegrationTask &&other) noexcept
-
IntegrationTask(const IntegrationTask&) = delete
-
IntegrationTask &operator=(const IntegrationTask&) = delete
-
inline bool resume()
-
inline bool done() const
-
inline void check_exception()
-
inline bool await_ready() const noexcept
-
inline void await_suspend(std::coroutine_handle<> h)
Public Members
-
handle_type coro
-
struct promise_type