1 | // Copyright (C) 2022 The Qt Company Ltd. |
2 | // Copyright (C) 2019 Alexey Edelev <semlanik@gmail.com>, Viktor Kopp <vifactor@gmail.com> |
3 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
4 | |
5 | #ifndef QGRPCHTTP2CHANNEL_H |
6 | #define QGRPCHTTP2CHANNEL_H |
7 | |
8 | #include <QtGrpc/qabstractgrpcchannel.h> |
9 | #include <QtGrpc/qgrpcchanneloptions.h> |
10 | |
11 | #include <memory> |
12 | |
13 | QT_BEGIN_NAMESPACE |
14 | |
15 | struct QGrpcHttp2ChannelPrivate; |
16 | |
17 | class Q_GRPC_EXPORT QGrpcHttp2Channel final : public QAbstractGrpcChannel |
18 | { |
19 | public: |
20 | explicit QGrpcHttp2Channel(const QGrpcChannelOptions &options); |
21 | ~QGrpcHttp2Channel() override; |
22 | |
23 | QGrpcStatus call(QLatin1StringView method, QLatin1StringView service, QByteArrayView args, |
24 | QByteArray &ret, |
25 | const QGrpcCallOptions &options = QGrpcCallOptions()) override; |
26 | std::shared_ptr<QGrpcCallReply> call( |
27 | QLatin1StringView method, QLatin1StringView service, QByteArrayView args, |
28 | const QGrpcCallOptions &options = QGrpcCallOptions()) override; |
29 | std::shared_ptr<QGrpcStream> startStream( |
30 | QLatin1StringView method, QLatin1StringView service, QByteArrayView arg, |
31 | const QGrpcCallOptions &options = QGrpcCallOptions()) override; |
32 | std::shared_ptr<QAbstractProtobufSerializer> serializer() const override; |
33 | |
34 | private: |
35 | Q_DISABLE_COPY_MOVE(QGrpcHttp2Channel) |
36 | |
37 | std::unique_ptr<QGrpcHttp2ChannelPrivate> dPtr; |
38 | }; |
39 | |
40 | QT_END_NAMESPACE |
41 | |
42 | #endif // QGRPCHTTP2CHANNEL_H |
43 | |