1 | // Copyright (C) 2022 The Qt Company Ltd. |
---|---|
2 | // Copyright (C) 2019 Alexey Edelev <semlanik@gmail.com> |
3 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
4 | |
5 | #ifndef QGRPCSTREAM_H |
6 | #define QGRPCSTREAM_H |
7 | |
8 | #include <QtCore/QByteArray> |
9 | #include <QtCore/QList> |
10 | #include <QtCore/QString> |
11 | #include <QtGrpc/qgrpcoperation.h> |
12 | #include <QtGrpc/qtgrpcglobal.h> |
13 | |
14 | #include <functional> |
15 | |
16 | QT_BEGIN_NAMESPACE |
17 | |
18 | class QAbstractGrpcClient; |
19 | |
20 | class Q_GRPC_EXPORT QGrpcStream final : public QGrpcOperation |
21 | { |
22 | Q_OBJECT |
23 | |
24 | public: |
25 | explicit QGrpcStream(QLatin1StringView method, QByteArrayView arg, |
26 | std::shared_ptr<QAbstractProtobufSerializer> serializer); |
27 | ~QGrpcStream() override; |
28 | |
29 | void abort() override; |
30 | |
31 | QLatin1StringView method() const; |
32 | QByteArrayView arg() const; |
33 | void updateData(const QByteArray &data); |
34 | |
35 | Q_SIGNALS: |
36 | void messageReceived(); |
37 | |
38 | private: |
39 | const std::string m_method; |
40 | const QByteArray m_arg; |
41 | }; |
42 | |
43 | QT_END_NAMESPACE |
44 | |
45 | #endif // QGRPCSTREAM_H |
46 |