QAbstractGrpcChannel Class

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

头: #include <QAbstractGrpcChannel>
CMake: find_package(Qt6 REQUIRED COMPONENTS Grpc)
target_link_libraries(mytarget PRIVATE Qt6::Grpc)
Since: Qt 6.5
继承者: QGrpcChannel and QGrpcHttp2Channel

公共函数

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

详细描述

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.

成员函数文档编制

[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 ,使用 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 使用 QGrpcStream::method () 和 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.