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
13QT_BEGIN_NAMESPACE
14
15struct QGrpcHttp2ChannelPrivate;
16
17class Q_GRPC_EXPORT QGrpcHttp2Channel final : public QAbstractGrpcChannel
18{
19public:
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
34private:
35 Q_DISABLE_COPY_MOVE(QGrpcHttp2Channel)
36
37 std::unique_ptr<QGrpcHttp2ChannelPrivate> dPtr;
38};
39
40QT_END_NAMESPACE
41
42#endif // QGRPCHTTP2CHANNEL_H
43

source code of qtgrpc/src/grpc/qgrpchttp2channel.h