QGrpcClientInterceptor Class

Base class for Qt GRPC client interceptors. 更多...

头: #include <QGrpcClientInterceptor>
CMake: find_package(Qt6 REQUIRED COMPONENTS Grpc)
target_link_libraries(mytarget PRIVATE Qt6::Grpc)
Since: Qt 6.7
状态: 技术预览

公共函数

virtual ~QGrpcClientInterceptor ()
void intercept (std::shared_ptr<QGrpcChannelOperation> operation , typename QGrpcInterceptorContinuation<T>::ReplyType response , QGrpcInterceptorContinuation<T> & continuation )

保护函数

virtual void interceptBidirStream (std::shared_ptr<QGrpcChannelOperation> operation , std::shared_ptr<QGrpcBidirStream> response , QGrpcInterceptorContinuation<QGrpcBidirStream> & continuation )
virtual void interceptCall (std::shared_ptr<QGrpcChannelOperation> operation , std::shared_ptr<QGrpcCallReply> response , QGrpcInterceptorContinuation<QGrpcCallReply> & continuation )
virtual void interceptClientStream (std::shared_ptr<QGrpcChannelOperation> operation , std::shared_ptr<QGrpcClientStream> response , QGrpcInterceptorContinuation<QGrpcClientStream> & continuation )
virtual void interceptServerStream (std::shared_ptr<QGrpcChannelOperation> operation , std::shared_ptr<QGrpcServerStream> response , QGrpcInterceptorContinuation<QGrpcServerStream> & continuation )

详细描述

The QGrpcClientInterceptor class provides a base for creating custom Qt GRPC client interceptors. It defines methods for intercepting different types of Qt GRPC calls and streams. Users can it to implement specific interception behavior.

另请参阅 Qt GRPC Client Interceptors .

成员函数文档编制

[virtual noexcept] QGrpcClientInterceptor:: ~QGrpcClientInterceptor ()

Default destructor of QGrpcClientInterceptor 对象。

template <typename T> void QGrpcClientInterceptor:: intercept ( std::shared_ptr < QGrpcChannelOperation > operation , typename QGrpcInterceptorContinuation < T > ::ReplyType response , QGrpcInterceptorContinuation < T > & continuation )

Intercepts a Qt GRPC call or stream operation.

This method provides a generic interface for intercepting Qt GRPC operations based on the specified QGrpcOperation . It delegates to specialized methods for different types of Qt GRPC operations and passes operation , response ,和 continuation parameters to specialized method.

[virtual protected] void QGrpcClientInterceptor:: interceptBidirStream ( std::shared_ptr < QGrpcChannelOperation > operation , std::shared_ptr < QGrpcBidirStream > response , QGrpcInterceptorContinuation < QGrpcBidirStream > & continuation )

Intercepts a Qt GRPC bidirectional streaming operation.

This method provides the default implementation of a virtual function. Users have the option to override this to offer specific functionality for QGrpcClientInterceptor .

The operation carries the values associated with the call. The response carries a preallocated QGrpcBidirStream of the stream response.

The continuation is a delegate that initiates the processing of the next interceptor or calls the underlying gRPC function. Implementations may call continuation zero or more times, depending on the desired outcome.

[virtual protected] void QGrpcClientInterceptor:: interceptCall ( std::shared_ptr < QGrpcChannelOperation > operation , std::shared_ptr < QGrpcCallReply > response , QGrpcInterceptorContinuation < QGrpcCallReply > & continuation )

Intercepts a Qt GRPC call operation.

This method provides the default implementation of a virtual function. Users have the option to override this to offer specific functionality for QGrpcClientInterceptor .

The operation carries the values associated with the call. The response carries a preallocated QGrpcCallReply of the call response.

The continuation is a delegate that initiates the processing of the next interceptor or calls the underlying gRPC function. Implementations may call continuation zero or more times, depending on the desired outcome.

[virtual protected] void QGrpcClientInterceptor:: interceptClientStream ( std::shared_ptr < QGrpcChannelOperation > operation , std::shared_ptr < QGrpcClientStream > response , QGrpcInterceptorContinuation < QGrpcClientStream > & continuation )

Intercepts a Qt GRPC client streaming operation.

This method provides the default implementation of a virtual function. Users have the option to override this to offer specific functionality for QGrpcClientInterceptor .

The operation carries the values associated with the call. The response carries a preallocated QGrpcClientStream of the stream response.

The continuation is a delegate that initiates the processing of the next interceptor or calls the underlying gRPC function. Implementations may call continuation zero or more times, depending on the desired outcome.

[virtual protected] void QGrpcClientInterceptor:: interceptServerStream ( std::shared_ptr < QGrpcChannelOperation > operation , std::shared_ptr < QGrpcServerStream > response , QGrpcInterceptorContinuation < QGrpcServerStream > & continuation )

Intercepts a Qt GRPC server streaming operation.

This method provides the default implementation of a virtual function. Users have the option to override this to offer specific functionality for QGrpcClientInterceptor .

The operation carries the values associated with the call. The response carries a preallocated QGrpcServerStream of the stream response.

The continuation is a delegate that initiates the processing of the next interceptor or calls the underlying gRPC function. Implementations may call continuation zero or more times, depending on the desired outcome.