39 std::coroutine_handle<promise_type> handle;
40 std::vector<QMetaObject::Connection> connections;
44 for (
auto &conn : connections) {
50 void return_void()
noexcept {}
54 handle = std::coroutine_handle<promise_type>::from_promise(*
this);
58 std::suspend_never initial_suspend()
const noexcept {
return {}; }
59 std::suspend_never final_suspend()
noexcept {
return {}; }
60 void unhandled_exception() {}
62 bool await_ready()
const noexcept {
return false; }
63 void await_suspend(std::coroutine_handle<> h)
noexcept {}
64 void await_resume()
const noexcept
66 Q_ASSERT_X(!connections.empty(),
"Cutelyst::CoroContext",
"Did not yield any QObject*");
69 std::suspend_never yield_value(
QObject *obj)
78 connections.emplace_back(std::move(conn));
84 trackContext(context);
90 template <
typename... ArgTypes>
94 trackContext(context);
97 void trackContext(
Context *context)
114 connections.emplace_back(std::move(conn));