QAbstractGrpcChannel Class

The QAbstractGrpcChannel class is interface that represents common gRPC channel functionality. More...

Header: #include <QAbstractGrpcChannel>
CMake: find_package(Qt6 REQUIRED COMPONENTS Grpc)
target_link_libraries(mytarget PRIVATE Qt6::Grpc)
Since: Qt 6.5
Inherited By:

QGrpcChannel and QGrpcHttp2Channel

Public Functions

virtual QGrpcStatus call(QLatin1StringView method, QLatin1StringView service, QByteArrayView args, QByteArray &ret) = 0
virtual std::shared_ptr<QGrpcCallReply> call(QAbstractGrpcClient *client, QLatin1StringView method, QLatin1StringView service, QByteArrayView args) = 0
virtual std::shared_ptr<QAbstractProtobufSerializer> serializer() const = 0
virtual void startStream(QGrpcStream *stream, QLatin1StringView service) = 0

Detailed Description

You may implement this interface to create your own channels for gRPC transport. QGrpcChannel or QGrpcHttp2Channel, which are full implementations of QAbstractGrpcChannel are recommended to use.

Member Function Documentation

[pure virtual] QGrpcStatus QAbstractGrpcChannel::call(QLatin1StringView method, QLatin1StringView service, QByteArrayView args, QByteArray &ret)

This pure virtual function synchronously calls the RPC method concatenated from the method and service parameters with the given args and writes the result to the output parameter ret.

You may reimplement this function in a subclass to define your own call mechanism behavior. QGrpcChannel or QGrpcHttp2Channel, which are full implementations of QAbstractGrpcChannel are recommended to use.

[pure virtual] std::shared_ptr<QGrpcCallReply> QAbstractGrpcChannel::call(QAbstractGrpcClient *client, QLatin1StringView method, QLatin1StringView service, QByteArrayView args)

This pure virtual function asynchronously calls the RPC method combined with the method and service parameters with the given args and returns an asynchronous response in the form of QGrpcCallReply, which uses the client to deserialize messages.

You may reimplement this function in a subclass to define your own call mechanism behavior. QGrpcChannel or QGrpcHttp2Channel, which are full implementations of QAbstractGrpcChannel are recommended to use.

[pure virtual] std::shared_ptr<QAbstractProtobufSerializer> QAbstractGrpcChannel::serializer() const

This pure virtual function shall return a shared pointer to QAbstractProtobufSerializer.

This function is called to obtain the QAbstractProtobufSerializer used by QAbstractGrpcClient to perform serialization and deserialization of the message.

[pure virtual] void QAbstractGrpcChannel::startStream(QGrpcStream *stream, QLatin1StringView service)

This pure virtual function starts a stream on a stream using QGrpcStream::method() and the service to get the name of the RPC method.

You may reimplement this function in a subclass to define your own stream mechanism behavior. QGrpcChannel or QGrpcHttp2Channel, which are full implementations of QAbstractGrpcChannel are recommended to use.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.