summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2024-04-19 14:18:32 +0200
committerAlexey Edelev <alexey.edelev@qt.io>2024-04-24 17:25:10 +0200
commit9145ffc50d1d154564f1aef46b8444972e50bfe5 (patch)
tree822356c5ecbceddb94e53871058a051942069a28
parent728c86db6cb2443948cec43ed80fd033dce0f2f9 (diff)
Rename QAbstractGrpcClient to QGrpcClientBase
QAbstractGrpcClient is not abstract and doesn't offer any interfaces for reimplementation. Assuming it's the base class for all gRPC clients, containing the generic gRPC client functionality. Rename the class accordingly. Taks-number: QTBUG-123625 Change-Id: I38e18a3b67e5f0f9c754e65337b2780780eea467 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
-rw-r--r--src/grpc/CMakeLists.txt2
-rw-r--r--src/grpc/doc/src/qtgrpc-client-service-methods.qdoc4
-rw-r--r--src/grpc/qabstractgrpcchannel.cpp16
-rw-r--r--src/grpc/qabstractgrpcchannel.h4
-rw-r--r--src/grpc/qgrpcclientbase.cpp (renamed from src/grpc/qabstractgrpcclient.cpp)94
-rw-r--r--src/grpc/qgrpcclientbase.h (renamed from src/grpc/qabstractgrpcclient.h)18
-rw-r--r--src/grpc/qgrpchttp2channel.cpp2
-rw-r--r--src/grpc/qgrpcoperation.cpp2
-rw-r--r--src/grpc/qgrpcstream.h2
-rw-r--r--src/grpcquick/qqmlgrpchttp2channel.cpp1
-rw-r--r--src/tools/qtgrpcgen/qgrpcgenerator.cpp2
-rw-r--r--src/tools/qtprotoccommon/generatorcommon.cpp2
-rw-r--r--tests/auto/grpc/client/serverstream/tst_grpc_client_serverstream.cpp2
-rw-r--r--tests/auto/grpc/client/unarycall/tst_grpc_client_unarycall.cpp4
-rw-r--r--tests/auto/grpc/qgrpchttp2channel/tst_qgrpchttp2channel.cpp2
-rw-r--r--tests/auto/grpcgen/data/expected_result/folder/qtgrpc/tests/testservice_client.grpc.qpb.cpp2
-rw-r--r--tests/auto/grpcgen/data/expected_result/folder/qtgrpc/tests/testservice_client.grpc.qpb.h4
-rw-r--r--tests/auto/grpcgen/data/expected_result/no-options/testserivcenomessages_client.grpc.qpb.cpp2
-rw-r--r--tests/auto/grpcgen/data/expected_result/no-options/testserivcenomessages_client.grpc.qpb.h4
-rw-r--r--tests/auto/grpcgen/data/expected_result/no-options/testservice_client.grpc.qpb.cpp2
-rw-r--r--tests/auto/grpcgen/data/expected_result/no-options/testservice_client.grpc.qpb.h4
-rw-r--r--tests/auto/grpcgen/data/expected_result/separate/grpc/qtgrpc/tests/testservice_client.grpc.qpb.cpp2
-rw-r--r--tests/auto/grpcgen/data/expected_result/separate/grpc/qtgrpc/tests/testservice_client.grpc.qpb.h4
23 files changed, 90 insertions, 91 deletions
diff --git a/src/grpc/CMakeLists.txt b/src/grpc/CMakeLists.txt
index ef8f57b..eb24f0a 100644
--- a/src/grpc/CMakeLists.txt
+++ b/src/grpc/CMakeLists.txt
@@ -10,7 +10,7 @@ qt_internal_add_module(Grpc
qgrpcstatus.h qgrpcstatus.cpp
qabstractgrpcchannel.h qabstractgrpcchannel_p.h qabstractgrpcchannel.cpp
qgrpchttp2channel.h qgrpchttp2channel.cpp
- qabstractgrpcclient.h qabstractgrpcclient.cpp
+ qgrpcclientbase.h qgrpcclientbase.cpp
qgrpccalloptions.h qgrpccalloptions.cpp
qgrpcchanneloptions.h qgrpcchanneloptions.cpp
qgrpcclientinterceptor.h qgrpcclientinterceptor.cpp
diff --git a/src/grpc/doc/src/qtgrpc-client-service-methods.qdoc b/src/grpc/doc/src/qtgrpc-client-service-methods.qdoc
index 11138d1..0c26cb2 100644
--- a/src/grpc/doc/src/qtgrpc-client-service-methods.qdoc
+++ b/src/grpc/doc/src/qtgrpc-client-service-methods.qdoc
@@ -96,7 +96,7 @@ two alternative asynchronous methods:
namespace ping::pong {
namespace PingPongService {
- class Client : public QAbstractGrpcClient {
+ class Client : public QGrpcClientBase {
Q_OBJECT
public:
std::shared_ptr<QGrpcCallReply> PingPong(const ping::pong::Ping &arg,
@@ -161,7 +161,7 @@ an argument to the callback function that is used in the call:
This variant makes a connection to the \l{QGrpcCallReply::finished} signal
implicitly, but you cannot cancel the call using the \l{QGrpcOperation::cancel}
function, and to get information about error occurred you need to subscribe to
-the common \l{QAbstractGrpcClient::errorOccurred} signal.
+the common \l{QGrpcClientBase::errorOccurred} signal.
\section1 Using the server streams in Qt GRPC
diff --git a/src/grpc/qabstractgrpcchannel.cpp b/src/grpc/qabstractgrpcchannel.cpp
index 6f096a5..347c217 100644
--- a/src/grpc/qabstractgrpcchannel.cpp
+++ b/src/grpc/qabstractgrpcchannel.cpp
@@ -43,7 +43,7 @@ QT_BEGIN_NAMESPACE
method when making unary gRPC call. The \a channelOperation is the
pointer to a channel side \l QGrpcChannelOperation primitive that is
connected with \l QGrpcCallReply primitive, that is used in
- \l QAbstractGrpcClient implementations.
+ \l QGrpcClientBase implementations.
The function should implement the channel-side logic of unary call. The
implementation must be asynchronous and must not block the thread where
@@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE
This pure virtual function that the starts of the server-side stream. The
\a channelOperation is the pointer to a channel side
\l QGrpcChannelOperation primitive that is connected with \l QGrpcServerStream
- primitive, that is used in \l QAbstractGrpcClient implementations.
+ primitive, that is used in \l QGrpcClientBase implementations.
The function should implement the channel-side logic of server-side stream.
The implementation must be asynchronous and must not block the thread where
@@ -71,7 +71,7 @@ QT_BEGIN_NAMESPACE
This pure virtual function that the starts of the client-side stream. The
\a channelOperation is the pointer to a channel side
\l QGrpcChannelOperation primitive that is connected with
- \l QGrpcClientStream primitive, that is used in \l QAbstractGrpcClient.
+ \l QGrpcClientStream primitive, that is used in \l QGrpcClientBase.
The function should implement the channel-side logic of client-side stream.
The implementation must be asynchronous and must not block the thread where
@@ -85,7 +85,7 @@ QT_BEGIN_NAMESPACE
This pure virtual function that the starts of the bidirectional stream. The
\a channelOperation is the pointer to a channel side
\l QGrpcChannelOperation primitive that is connected with
- \l QGrpcBidirStream primitive, that is used in \l QAbstractGrpcClient.
+ \l QGrpcBidirStream primitive, that is used in \l QGrpcClientBase.
The function should implement the channel-side logic of bidirectional
stream. The implementation must be asynchronous and must not block the
@@ -132,7 +132,7 @@ const QGrpcChannelOptions &QAbstractGrpcChannel::channelOptions() const noexcept
between them.
The function should not be called directly, but only by
- \l QAbstractGrpcClient implementations.
+ \l QGrpcClientBase implementations.
*/
std::shared_ptr<QGrpcCallReply> QAbstractGrpcChannel::call(QLatin1StringView method,
QLatin1StringView service,
@@ -172,7 +172,7 @@ std::shared_ptr<QGrpcCallReply> QAbstractGrpcChannel::call(QLatin1StringView met
between them.
The function should not be called directly, but only by
- \l QAbstractGrpcClient implementations.
+ \l QGrpcClientBase implementations.
*/
std::shared_ptr<QGrpcServerStream>
QAbstractGrpcChannel::startServerStream(QLatin1StringView method, QLatin1StringView service,
@@ -211,7 +211,7 @@ QAbstractGrpcChannel::startServerStream(QLatin1StringView method, QLatin1StringV
between them.
The function should not be called directly, but only by
- \l QAbstractGrpcClient.
+ \l QGrpcClientBase.
*/
std::shared_ptr<QGrpcClientStream>
QAbstractGrpcChannel::startClientStream(QLatin1StringView method, QLatin1StringView service,
@@ -241,7 +241,7 @@ QAbstractGrpcChannel::startClientStream(QLatin1StringView method, QLatin1StringV
between them.
The function should not be called directly, but only by
- \l QAbstractGrpcClient.
+ \l QGrpcClientBase.
*/
std::shared_ptr<QGrpcBidirStream>
QAbstractGrpcChannel::startBidirStream(QLatin1StringView method, QLatin1StringView service,
diff --git a/src/grpc/qabstractgrpcchannel.h b/src/grpc/qabstractgrpcchannel.h
index 690723e..6170385 100644
--- a/src/grpc/qabstractgrpcchannel.h
+++ b/src/grpc/qabstractgrpcchannel.h
@@ -16,7 +16,7 @@
QT_BEGIN_NAMESPACE
-class QAbstractGrpcClient;
+class QGrpcClientBase;
class QAbstractProtobufSerializer;
struct QAbstractGrpcChannelPrivate;
class QGrpcServerStream;
@@ -57,7 +57,7 @@ protected:
[[nodiscard]] const QGrpcChannelOptions &channelOptions() const noexcept;
- friend class QAbstractGrpcClient;
+ friend class QGrpcClientBase;
explicit QAbstractGrpcChannel(const QGrpcChannelOptions &options);
private:
diff --git a/src/grpc/qabstractgrpcclient.cpp b/src/grpc/qgrpcclientbase.cpp
index 3b88cbe..34cf470 100644
--- a/src/grpc/qabstractgrpcclient.cpp
+++ b/src/grpc/qgrpcclientbase.cpp
@@ -13,7 +13,7 @@
#include <private/qobject_p.h>
-#include "qabstractgrpcclient.h"
+#include "qgrpcclientbase.h"
QT_BEGIN_NAMESPACE
@@ -22,30 +22,30 @@ using namespace Qt::StringLiterals;
namespace {
static QString threadSafetyWarning(QLatin1StringView methodName)
{
- return QAbstractGrpcClient::tr("%1 is called from a different thread.\n"
+ return QGrpcClientBase::tr("%1 is called from a different thread.\n"
"Qt GRPC doesn't guarantee thread safety on the channel level.\n"
"You have to be confident that channel routines are working in "
- "the same thread as QAbstractGrpcClient.")
+ "the same thread as QGrpcClientBase.")
.arg(methodName);
}
} // namespace
/*!
- \class QAbstractGrpcClient
+ \class QGrpcClientBase
\inmodule QtGrpc
- \brief The QAbstractGrpcClient class is bridge between gRPC clients
+ \brief The QGrpcClientBase class is bridge between gRPC clients
and channels.
- QAbstractGrpcClient provides a set of functions for client classes
+ QGrpcClientBase provides a set of functions for client classes
generated out of protobuf services.
- QAbstractGrpcClient enforces thread safety for startStream() and call() methods
+ QGrpcClientBase enforces thread safety for startStream() and call() methods
of generated clients.
- The methods QAbstractGrpcClient::call() and QAbstractGrpcClient::startStream()
+ The methods QGrpcClientBase::call() and QGrpcClientBase::startStream()
should only be called by the generated client classes.
*/
/*!
- \fn template <typename StreamType> std::shared_ptr<StreamType> QAbstractGrpcClient::startStream(QLatin1StringView method, const QProtobufMessage &arg, const QGrpcCallOptions &options)
+ \fn template <typename StreamType> std::shared_ptr<StreamType> QGrpcClientBase::startStream(QLatin1StringView method, const QProtobufMessage &arg, const QGrpcCallOptions &options)
Starts the stream \a method of the \e StreamType type with the message
argument \a arg to the attached channel.
@@ -58,14 +58,14 @@ static QString threadSafetyWarning(QLatin1StringView methodName)
*/
/*!
- \fn void QAbstractGrpcClient::channelChanged()
+ \fn void QGrpcClientBase::channelChanged()
\since 6.7
Indicates that a new channel is attached to the client.
*/
/*!
- \fn void QAbstractGrpcClient::errorOccurred(const QGrpcStatus &status);
+ \fn void QGrpcClientBase::errorOccurred(const QGrpcStatus &status);
Indicates that an error occurred during serialization.
@@ -76,11 +76,11 @@ static QString threadSafetyWarning(QLatin1StringView methodName)
*/
-class QAbstractGrpcClientPrivate : public QObjectPrivate
+class QGrpcClientBasePrivate : public QObjectPrivate
{
- Q_DECLARE_PUBLIC(QAbstractGrpcClient)
+ Q_DECLARE_PUBLIC(QGrpcClientBase)
public:
- QAbstractGrpcClientPrivate(QLatin1StringView service) : service(service)
+ QGrpcClientBasePrivate(QLatin1StringView service) : service(service)
{
}
@@ -99,9 +99,9 @@ public:
std::vector<std::shared_ptr<QGrpcOperation>> activeStreams;
};
-QGrpcStatus QAbstractGrpcClientPrivate::checkThread(QLatin1StringView warningPreamble)
+QGrpcStatus QGrpcClientBasePrivate::checkThread(QLatin1StringView warningPreamble)
{
- Q_Q(QAbstractGrpcClient);
+ Q_Q(QGrpcClientBase);
QGrpcStatus status;
if (q->thread() != QThread::currentThread()) {
@@ -112,9 +112,9 @@ QGrpcStatus QAbstractGrpcClientPrivate::checkThread(QLatin1StringView warningPre
return status;
}
-bool QAbstractGrpcClientPrivate::checkChannel()
+bool QGrpcClientBasePrivate::checkChannel()
{
- Q_Q(QAbstractGrpcClient);
+ Q_Q(QGrpcClientBase);
if (!channel) {
emit q->errorOccurred(QGrpcStatus{ QGrpcStatus::Unknown,
@@ -124,9 +124,9 @@ bool QAbstractGrpcClientPrivate::checkChannel()
return true;
}
-void QAbstractGrpcClientPrivate::addStream(std::shared_ptr<QGrpcOperation> grpcStream)
+void QGrpcClientBasePrivate::addStream(std::shared_ptr<QGrpcOperation> grpcStream)
{
- Q_Q(QAbstractGrpcClient);
+ Q_Q(QGrpcClientBase);
auto errorConnection = std::make_shared<QMetaObject::Connection>();
auto finishedConnection = std::make_shared<QMetaObject::Connection>();
@@ -138,7 +138,7 @@ void QAbstractGrpcClientPrivate::addStream(std::shared_ptr<QGrpcOperation> grpcS
qGrpcWarning() << grpcStream->method() << "call" << service
<< "stream error: " << status.message();
- Q_Q(QAbstractGrpcClient);
+ Q_Q(QGrpcClientBase);
emit q->errorOccurred(status);
removeStream(std::move(grpcStream));
});
@@ -156,7 +156,7 @@ void QAbstractGrpcClientPrivate::addStream(std::shared_ptr<QGrpcOperation> grpcS
activeStreams.push_back(grpcStream);
}
-void QAbstractGrpcClientPrivate::removeStream(std::shared_ptr<QGrpcOperation> grpcStream)
+void QGrpcClientBasePrivate::removeStream(std::shared_ptr<QGrpcOperation> grpcStream)
{
auto it = std::find(activeStreams.begin(), activeStreams.end(), grpcStream);
if (it != activeStreams.end())
@@ -165,12 +165,12 @@ void QAbstractGrpcClientPrivate::removeStream(std::shared_ptr<QGrpcOperation> gr
grpcStream.reset();
}
-QAbstractGrpcClient::QAbstractGrpcClient(QLatin1StringView service, QObject *parent)
- : QObject(*new QAbstractGrpcClientPrivate(service), parent)
+QGrpcClientBase::QGrpcClientBase(QLatin1StringView service, QObject *parent)
+ : QObject(*new QGrpcClientBasePrivate(service), parent)
{
}
-QAbstractGrpcClient::~QAbstractGrpcClient() = default;
+QGrpcClientBase::~QGrpcClientBase() = default;
/*!
Attaches \a channel to client as transport layer for gRPC.
@@ -180,17 +180,17 @@ QAbstractGrpcClient::~QAbstractGrpcClient() = default;
\note \b Warning: Qt GRPC doesn't guarantee thread safety on the channel level.
You have to invoke the channel-related functions on the same thread as
- QAbstractGrpcClient.
+ QGrpcClientBase.
*/
-void QAbstractGrpcClient::attachChannel(const std::shared_ptr<QAbstractGrpcChannel> &channel)
+void QGrpcClientBase::attachChannel(const std::shared_ptr<QAbstractGrpcChannel> &channel)
{
if (channel->dPtr->threadId != QThread::currentThreadId()) {
- const QString status = threadSafetyWarning("QAbstractGrpcClient::attachChannel"_L1);
+ const QString status = threadSafetyWarning("QGrpcClientBase::attachChannel"_L1);
qGrpcCritical() << status;
emit errorOccurred(QGrpcStatus{ QGrpcStatus::Unknown, status });
return;
}
- Q_D(QAbstractGrpcClient);
+ Q_D(QGrpcClientBase);
for (auto &stream : d->activeStreams) {
assert(stream != nullptr);
stream->cancel();
@@ -200,7 +200,7 @@ void QAbstractGrpcClient::attachChannel(const std::shared_ptr<QAbstractGrpcChann
emit channelChanged();
}
-std::shared_ptr<QGrpcCallReply> QAbstractGrpcClient::call(QLatin1StringView method,
+std::shared_ptr<QGrpcCallReply> QGrpcClientBase::call(QLatin1StringView method,
const QProtobufMessage &arg,
const QGrpcCallOptions &options)
{
@@ -214,19 +214,19 @@ std::shared_ptr<QGrpcCallReply> QAbstractGrpcClient::call(QLatin1StringView meth
\since 6.7
Returns the channel attached to this client.
*/
-std::shared_ptr<QAbstractGrpcChannel> QAbstractGrpcClient::channel() const noexcept
+std::shared_ptr<QAbstractGrpcChannel> QGrpcClientBase::channel() const noexcept
{
- Q_D(const QAbstractGrpcClient);
+ Q_D(const QGrpcClientBase);
return d->channel;
}
-std::shared_ptr<QGrpcCallReply> QAbstractGrpcClient::call(QLatin1StringView method,
+std::shared_ptr<QGrpcCallReply> QGrpcClientBase::call(QLatin1StringView method,
QByteArrayView arg,
const QGrpcCallOptions &options)
{
std::shared_ptr<QGrpcCallReply> reply;
- Q_D(QAbstractGrpcClient);
- if (d->checkThread("QAbstractGrpcClient::call"_L1) != QGrpcStatus::Ok)
+ Q_D(QGrpcClientBase);
+ if (d->checkThread("QGrpcClientBase::call"_L1) != QGrpcStatus::Ok)
return reply;
if (!d->checkChannel())
@@ -252,12 +252,12 @@ QT_WARNING_POP
}
std::shared_ptr<QGrpcServerStream>
-QAbstractGrpcClient::startServerStream(QLatin1StringView method, QByteArrayView arg,
+QGrpcClientBase::startServerStream(QLatin1StringView method, QByteArrayView arg,
const QGrpcCallOptions &options)
{
- Q_D(QAbstractGrpcClient);
+ Q_D(QGrpcClientBase);
- if (d->checkThread("QAbstractGrpcClient::startStream<QGrpcServerStream>"_L1) != QGrpcStatus::Ok)
+ if (d->checkThread("QGrpcClientBase::startStream<QGrpcServerStream>"_L1) != QGrpcStatus::Ok)
return {};
if (!d->checkChannel())
@@ -270,12 +270,12 @@ QAbstractGrpcClient::startServerStream(QLatin1StringView method, QByteArrayView
}
std::shared_ptr<QGrpcClientStream>
-QAbstractGrpcClient::startClientStream(QLatin1StringView method, QByteArrayView arg,
+QGrpcClientBase::startClientStream(QLatin1StringView method, QByteArrayView arg,
const QGrpcCallOptions &options)
{
- Q_D(QAbstractGrpcClient);
+ Q_D(QGrpcClientBase);
- if (d->checkThread("QAbstractGrpcClient::startStream<QGrpcClientStream>"_L1) != QGrpcStatus::Ok)
+ if (d->checkThread("QGrpcClientBase::startStream<QGrpcClientStream>"_L1) != QGrpcStatus::Ok)
return {};
if (!d->checkChannel())
@@ -288,12 +288,12 @@ QAbstractGrpcClient::startClientStream(QLatin1StringView method, QByteArrayView
}
std::shared_ptr<QGrpcBidirStream>
-QAbstractGrpcClient::startBidirStream(QLatin1StringView method, QByteArrayView arg,
+QGrpcClientBase::startBidirStream(QLatin1StringView method, QByteArrayView arg,
const QGrpcCallOptions &options)
{
- Q_D(QAbstractGrpcClient);
+ Q_D(QGrpcClientBase);
- if (d->checkThread("QAbstractGrpcClient::startStream<QGrpcBidirStream>"_L1) != QGrpcStatus::Ok)
+ if (d->checkThread("QGrpcClientBase::startStream<QGrpcBidirStream>"_L1) != QGrpcStatus::Ok)
return {};
if (!d->checkChannel())
@@ -305,9 +305,9 @@ QAbstractGrpcClient::startBidirStream(QLatin1StringView method, QByteArrayView a
return grpcStream;
}
-std::optional<QByteArray> QAbstractGrpcClient::trySerialize(const QProtobufMessage &arg)
+std::optional<QByteArray> QGrpcClientBase::trySerialize(const QProtobufMessage &arg)
{
- Q_D(QAbstractGrpcClient);
+ Q_D(QGrpcClientBase);
using namespace Qt::StringLiterals;
auto _serializer = d->serializer();
if (_serializer == nullptr) {
@@ -320,4 +320,4 @@ std::optional<QByteArray> QAbstractGrpcClient::trySerialize(const QProtobufMessa
QT_END_NAMESPACE
-#include "moc_qabstractgrpcclient.cpp"
+#include "moc_qgrpcclientbase.cpp"
diff --git a/src/grpc/qabstractgrpcclient.h b/src/grpc/qgrpcclientbase.h
index 226aa8e..90180a0 100644
--- a/src/grpc/qabstractgrpcclient.h
+++ b/src/grpc/qgrpcclientbase.h
@@ -2,8 +2,8 @@
// Copyright (C) 2019 Alexey Edelev <semlanik@gmail.com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
-#ifndef QABSTRACTGRPCLIENT_H
-#define QABSTRACTGRPCLIENT_H
+#ifndef QGRPCLIENTBASE_H
+#define QGRPCLIENTBASE_H
#include <QtCore/qobject.h>
#include <QtCore/qsharedpointer.h>
@@ -22,9 +22,9 @@ QT_BEGIN_NAMESPACE
class QGrpcOperation;
class QAbstractGrpcChannel;
-class QAbstractGrpcClientPrivate;
+class QGrpcClientBasePrivate;
-class Q_GRPC_EXPORT QAbstractGrpcClient : public QObject
+class Q_GRPC_EXPORT QGrpcClientBase : public QObject
{
Q_OBJECT
Q_PROPERTY(std::shared_ptr<QAbstractGrpcChannel> channel READ channel
@@ -32,14 +32,14 @@ class Q_GRPC_EXPORT QAbstractGrpcClient : public QObject
public:
void attachChannel(const std::shared_ptr<QAbstractGrpcChannel> &channel);
[[nodiscard]] std::shared_ptr<QAbstractGrpcChannel> channel() const noexcept;
- ~QAbstractGrpcClient() override;
+ ~QGrpcClientBase() override;
Q_SIGNALS:
void errorOccurred(const QGrpcStatus &status);
void channelChanged();
protected:
- explicit QAbstractGrpcClient(QLatin1StringView service, QObject *parent = nullptr);
+ explicit QGrpcClientBase(QLatin1StringView service, QObject *parent = nullptr);
std::shared_ptr<QGrpcCallReply> call(QLatin1StringView method, const QProtobufMessage &arg,
const QGrpcCallOptions &options);
@@ -85,10 +85,10 @@ private:
std::optional<QByteArray> trySerialize(const QProtobufMessage &arg);
- Q_DISABLE_COPY_MOVE(QAbstractGrpcClient)
- Q_DECLARE_PRIVATE(QAbstractGrpcClient)
+ Q_DISABLE_COPY_MOVE(QGrpcClientBase)
+ Q_DECLARE_PRIVATE(QGrpcClientBase)
};
QT_END_NAMESPACE
-#endif // QABSTRACTGRPCLIENT_H
+#endif // QGRPCLIENTBASE_H
diff --git a/src/grpc/qgrpchttp2channel.cpp b/src/grpc/qgrpchttp2channel.cpp
index aa858ed..1cdeeb1 100644
--- a/src/grpc/qgrpchttp2channel.cpp
+++ b/src/grpc/qgrpchttp2channel.cpp
@@ -4,7 +4,7 @@
#include "qgrpchttp2channel.h"
-#include "qabstractgrpcclient.h"
+#include "qgrpcclientbase.h"
#include "qgrpcchanneloperation.h"
#include "qgrpcserializationformat.h"
diff --git a/src/grpc/qgrpcoperation.cpp b/src/grpc/qgrpcoperation.cpp
index 0da120d..233fddc 100644
--- a/src/grpc/qgrpcoperation.cpp
+++ b/src/grpc/qgrpcoperation.cpp
@@ -49,7 +49,7 @@ using namespace Qt::StringLiterals;
This signal is emitted when an error with \a status occurs in the channel.
- \sa QAbstractGrpcClient::errorOccurred
+ \sa QGrpcClientBase::errorOccurred
*/
class QGrpcOperationPrivate : public QObjectPrivate
diff --git a/src/grpc/qgrpcstream.h b/src/grpc/qgrpcstream.h
index 6d699b9..cdde347 100644
--- a/src/grpc/qgrpcstream.h
+++ b/src/grpc/qgrpcstream.h
@@ -16,7 +16,7 @@
QT_BEGIN_NAMESPACE
-class QAbstractGrpcClient;
+class QGrpcClientBase;
class Q_GRPC_EXPORT QGrpcServerStream final : public QGrpcOperation
{
diff --git a/src/grpcquick/qqmlgrpchttp2channel.cpp b/src/grpcquick/qqmlgrpchttp2channel.cpp
index 84af677..3d06504 100644
--- a/src/grpcquick/qqmlgrpchttp2channel.cpp
+++ b/src/grpcquick/qqmlgrpchttp2channel.cpp
@@ -2,7 +2,6 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "qqmlgrpchttp2channel_p.h"
-#include <QtGrpc/qabstractgrpcclient.h>
#include <QtGrpc/qgrpchttp2channel.h>
QT_BEGIN_NAMESPACE
diff --git a/src/tools/qtgrpcgen/qgrpcgenerator.cpp b/src/tools/qtgrpcgen/qgrpcgenerator.cpp
index ca8c892..8580861 100644
--- a/src/tools/qtgrpcgen/qgrpcgenerator.cpp
+++ b/src/tools/qtgrpcgen/qgrpcgenerator.cpp
@@ -28,7 +28,7 @@ static const std::set<std::string> externalQmlIncludes = {"QtQml/qqmlengine.h",
"QtQml/qjsengine.h",
"QtQml/qjsvalue.h"};
-static const std::set<std::string> externalIncludes = {"QtGrpc/qabstractgrpcclient.h",
+static const std::set<std::string> externalIncludes = {"QtGrpc/qgrpcclientbase.h",
"QtGrpc/qgrpccallreply.h",
"QtGrpc/qgrpcstream.h"};
diff --git a/src/tools/qtprotoccommon/generatorcommon.cpp b/src/tools/qtprotoccommon/generatorcommon.cpp
index 0e8d356..ced163b 100644
--- a/src/tools/qtprotoccommon/generatorcommon.cpp
+++ b/src/tools/qtprotoccommon/generatorcommon.cpp
@@ -396,7 +396,7 @@ TypeMap common::produceClientTypeMap(const ServiceDescriptor *service, const Des
{ "full_type", fullName },
{ "scope_type", scopeName },
{ "scope_namespaces", scopeNamespaces },
- { "parent_class", "QAbstractGrpcClient" },
+ { "parent_class", "QGrpcClientBase" },
{ "export_macro", exportMacro } };
}
diff --git a/tests/auto/grpc/client/serverstream/tst_grpc_client_serverstream.cpp b/tests/auto/grpc/client/serverstream/tst_grpc_client_serverstream.cpp
index 645ca25..fb0b2f4 100644
--- a/tests/auto/grpc/client/serverstream/tst_grpc_client_serverstream.cpp
+++ b/tests/auto/grpc/client/serverstream/tst_grpc_client_serverstream.cpp
@@ -354,7 +354,7 @@ void QtGrpcClientServerStreamTest::InThread()
qvariant_cast<QGrpcStatus>(clientErrorSpy.at(0).first())
.message()
.startsWith(
- "QAbstractGrpcClient::startStream<QGrpcServerStream> is called from a "
+ "QGrpcClientBase::startStream<QGrpcServerStream> is called from a "
"different thread."));
}
diff --git a/tests/auto/grpc/client/unarycall/tst_grpc_client_unarycall.cpp b/tests/auto/grpc/client/unarycall/tst_grpc_client_unarycall.cpp
index 5a1f1f2..dc2ba28 100644
--- a/tests/auto/grpc/client/unarycall/tst_grpc_client_unarycall.cpp
+++ b/tests/auto/grpc/client/unarycall/tst_grpc_client_unarycall.cpp
@@ -196,7 +196,7 @@ void QtGrpcClientUnaryCallTest::InThread()
QVERIFY(reply == nullptr);
QVERIFY(qvariant_cast<QGrpcStatus>(clientErrorSpy.at(0).first())
.message()
- .startsWith("QAbstractGrpcClient::call is called from a different thread."));
+ .startsWith("QGrpcClientBase::call is called from a different thread."));
}
void QtGrpcClientUnaryCallTest::AsyncInThread()
@@ -225,7 +225,7 @@ void QtGrpcClientUnaryCallTest::AsyncInThread()
QTRY_VERIFY(
qvariant_cast<QGrpcStatus>(clientErrorSpy.at(0).first())
.message()
- .startsWith("QAbstractGrpcClient::call is called from a different thread."));
+ .startsWith("QGrpcClientBase::call is called from a different thread."));
}
void QtGrpcClientUnaryCallTest::Metadata()
diff --git a/tests/auto/grpc/qgrpchttp2channel/tst_qgrpchttp2channel.cpp b/tests/auto/grpc/qgrpchttp2channel/tst_qgrpchttp2channel.cpp
index 69d313f..a9bb597 100644
--- a/tests/auto/grpc/qgrpchttp2channel/tst_qgrpchttp2channel.cpp
+++ b/tests/auto/grpc/qgrpchttp2channel/tst_qgrpchttp2channel.cpp
@@ -117,7 +117,7 @@ void QGrpcHttp2ChannelTest::AttachChannelThreadTest()
QCOMPARE(qvariant_cast<QGrpcStatus>(clientErrorSpy.at(0).first()).code(), QGrpcStatus::Unknown);
QVERIFY(qvariant_cast<QGrpcStatus>(clientErrorSpy.at(0).first())
.message()
- .startsWith("QAbstractGrpcClient::attachChannel is called from a different "
+ .startsWith("QGrpcClientBase::attachChannel is called from a different "
"thread."));
}
diff --git a/tests/auto/grpcgen/data/expected_result/folder/qtgrpc/tests/testservice_client.grpc.qpb.cpp b/tests/auto/grpcgen/data/expected_result/folder/qtgrpc/tests/testservice_client.grpc.qpb.cpp
index 551aa6c..2292b40 100644
--- a/tests/auto/grpcgen/data/expected_result/folder/qtgrpc/tests/testservice_client.grpc.qpb.cpp
+++ b/tests/auto/grpcgen/data/expected_result/folder/qtgrpc/tests/testservice_client.grpc.qpb.cpp
@@ -7,7 +7,7 @@ namespace TestService {
using namespace Qt::StringLiterals;
Client::Client(QObject *parent)
- : QAbstractGrpcClient("qtgrpc.tests.TestService"_L1, parent)
+ : QGrpcClientBase("qtgrpc.tests.TestService"_L1, parent)
{
}
diff --git a/tests/auto/grpcgen/data/expected_result/folder/qtgrpc/tests/testservice_client.grpc.qpb.h b/tests/auto/grpcgen/data/expected_result/folder/qtgrpc/tests/testservice_client.grpc.qpb.h
index 0b21096..19182e5 100644
--- a/tests/auto/grpcgen/data/expected_result/folder/qtgrpc/tests/testservice_client.grpc.qpb.h
+++ b/tests/auto/grpcgen/data/expected_result/folder/qtgrpc/tests/testservice_client.grpc.qpb.h
@@ -8,8 +8,8 @@
#include <QtProtobuf/qprotobuflazymessagepointer.h>
#include <QtProtobuf/qtprotobuftypes.h>
-#include <QtGrpc/qabstractgrpcclient.h>
#include <QtGrpc/qgrpccallreply.h>
+#include <QtGrpc/qgrpcclientbase.h>
#include <QtGrpc/qgrpcstream.h>
#include <memory>
@@ -19,7 +19,7 @@
namespace qtgrpc::tests {
namespace TestService {
-class Client : public QAbstractGrpcClient
+class Client : public QGrpcClientBase
{
Q_OBJECT
diff --git a/tests/auto/grpcgen/data/expected_result/no-options/testserivcenomessages_client.grpc.qpb.cpp b/tests/auto/grpcgen/data/expected_result/no-options/testserivcenomessages_client.grpc.qpb.cpp
index 212e5ea..3eb972c 100644
--- a/tests/auto/grpcgen/data/expected_result/no-options/testserivcenomessages_client.grpc.qpb.cpp
+++ b/tests/auto/grpcgen/data/expected_result/no-options/testserivcenomessages_client.grpc.qpb.cpp
@@ -7,7 +7,7 @@ namespace TestService {
using namespace Qt::StringLiterals;
Client::Client(QObject *parent)
- : QAbstractGrpcClient("qtgrpc.tests.nomessages.TestService"_L1, parent)
+ : QGrpcClientBase("qtgrpc.tests.nomessages.TestService"_L1, parent)
{
}
diff --git a/tests/auto/grpcgen/data/expected_result/no-options/testserivcenomessages_client.grpc.qpb.h b/tests/auto/grpcgen/data/expected_result/no-options/testserivcenomessages_client.grpc.qpb.h
index cf9d3c7..a8f06bb 100644
--- a/tests/auto/grpcgen/data/expected_result/no-options/testserivcenomessages_client.grpc.qpb.h
+++ b/tests/auto/grpcgen/data/expected_result/no-options/testserivcenomessages_client.grpc.qpb.h
@@ -8,8 +8,8 @@
#include <QtProtobuf/qprotobuflazymessagepointer.h>
#include <QtProtobuf/qtprotobuftypes.h>
-#include <QtGrpc/qabstractgrpcclient.h>
#include <QtGrpc/qgrpccallreply.h>
+#include <QtGrpc/qgrpcclientbase.h>
#include <QtGrpc/qgrpcstream.h>
#include <memory>
@@ -19,7 +19,7 @@
namespace qtgrpc::tests::nomessages {
namespace TestService {
-class Client : public QAbstractGrpcClient
+class Client : public QGrpcClientBase
{
Q_OBJECT
diff --git a/tests/auto/grpcgen/data/expected_result/no-options/testservice_client.grpc.qpb.cpp b/tests/auto/grpcgen/data/expected_result/no-options/testservice_client.grpc.qpb.cpp
index 2212769..068900b 100644
--- a/tests/auto/grpcgen/data/expected_result/no-options/testservice_client.grpc.qpb.cpp
+++ b/tests/auto/grpcgen/data/expected_result/no-options/testservice_client.grpc.qpb.cpp
@@ -7,7 +7,7 @@ namespace TestService {
using namespace Qt::StringLiterals;
Client::Client(QObject *parent)
- : QAbstractGrpcClient("qtgrpc.tests.TestService"_L1, parent)
+ : QGrpcClientBase("qtgrpc.tests.TestService"_L1, parent)
{
}
diff --git a/tests/auto/grpcgen/data/expected_result/no-options/testservice_client.grpc.qpb.h b/tests/auto/grpcgen/data/expected_result/no-options/testservice_client.grpc.qpb.h
index 72f13f5..f4c3b02 100644
--- a/tests/auto/grpcgen/data/expected_result/no-options/testservice_client.grpc.qpb.h
+++ b/tests/auto/grpcgen/data/expected_result/no-options/testservice_client.grpc.qpb.h
@@ -8,8 +8,8 @@
#include <QtProtobuf/qprotobuflazymessagepointer.h>
#include <QtProtobuf/qtprotobuftypes.h>
-#include <QtGrpc/qabstractgrpcclient.h>
#include <QtGrpc/qgrpccallreply.h>
+#include <QtGrpc/qgrpcclientbase.h>
#include <QtGrpc/qgrpcstream.h>
#include <memory>
@@ -19,7 +19,7 @@
namespace qtgrpc::tests {
namespace TestService {
-class Client : public QAbstractGrpcClient
+class Client : public QGrpcClientBase
{
Q_OBJECT
diff --git a/tests/auto/grpcgen/data/expected_result/separate/grpc/qtgrpc/tests/testservice_client.grpc.qpb.cpp b/tests/auto/grpcgen/data/expected_result/separate/grpc/qtgrpc/tests/testservice_client.grpc.qpb.cpp
index 551aa6c..2292b40 100644
--- a/tests/auto/grpcgen/data/expected_result/separate/grpc/qtgrpc/tests/testservice_client.grpc.qpb.cpp
+++ b/tests/auto/grpcgen/data/expected_result/separate/grpc/qtgrpc/tests/testservice_client.grpc.qpb.cpp
@@ -7,7 +7,7 @@ namespace TestService {
using namespace Qt::StringLiterals;
Client::Client(QObject *parent)
- : QAbstractGrpcClient("qtgrpc.tests.TestService"_L1, parent)
+ : QGrpcClientBase("qtgrpc.tests.TestService"_L1, parent)
{
}
diff --git a/tests/auto/grpcgen/data/expected_result/separate/grpc/qtgrpc/tests/testservice_client.grpc.qpb.h b/tests/auto/grpcgen/data/expected_result/separate/grpc/qtgrpc/tests/testservice_client.grpc.qpb.h
index ee90960..19ac3c8 100644
--- a/tests/auto/grpcgen/data/expected_result/separate/grpc/qtgrpc/tests/testservice_client.grpc.qpb.h
+++ b/tests/auto/grpcgen/data/expected_result/separate/grpc/qtgrpc/tests/testservice_client.grpc.qpb.h
@@ -8,8 +8,8 @@
#include <QtProtobuf/qprotobuflazymessagepointer.h>
#include <QtProtobuf/qtprotobuftypes.h>
-#include <QtGrpc/qabstractgrpcclient.h>
#include <QtGrpc/qgrpccallreply.h>
+#include <QtGrpc/qgrpcclientbase.h>
#include <QtGrpc/qgrpcstream.h>
#include <memory>
@@ -20,7 +20,7 @@
namespace qtgrpc::tests {
namespace TestService {
-class QPB_TST_QTGRPCGEN_CLIENT_GRPC_ONLY_EXPORT Client : public QAbstractGrpcClient
+class QPB_TST_QTGRPCGEN_CLIENT_GRPC_ONLY_EXPORT Client : public QGrpcClientBase
{
Q_OBJECT