LeechCraft 0.6.70-19214-g121e5318a7
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
networkreply.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#pragma once
10
11#include <coroutine>
13#include "../threadsconfig.h"
14#include "taskfwd.h"
15
16class QNetworkReply;
17
18namespace LC::Util
19{
20 class NetworkResult;
21
22 namespace detail
23 {
25 {
26 QNetworkReply& Reply_;
27
30
31 ~NRAwaiter () noexcept;
32
33 bool await_ready () const noexcept;
34 void await_suspend (std::coroutine_handle<> handle) noexcept;
35 NetworkResult await_resume () const noexcept;
36 };
37 }
38
39 inline detail::NRAwaiter GetAwaiter (QNetworkReply& reply, AwaiterCPO)
40 {
41 return { reply };
42 }
43}
44
45namespace LC
46{
47 inline auto operator co_await (QNetworkReply& reply)
48 {
49 return Util::GetAwaiter (reply, {});
50 }
51}
detail::EitherAwaiter< L, R, std::identity > GetAwaiter(const Either< L, R > &either, AwaiterCPO)
Definition either.h:119
Definition constants.h:15
RaiiSignalConnection FinishedConn_
RaiiSignalConnection ErrorConn_
#define UTIL_THREADS_API