QGrpcWriteMessageInterceptor Class | Qt GRPC | Qt 6.11.1
Description: Intercepts outgoing messages written for an RPC.

- Qt 6.11
- Qt GRPC
- C++ Classes
- QGrpcWriteMessageInterceptor
- Qt 6.11.1 Reference Documentation

# QGrpcWriteMessageInterceptor Class

Intercepts outgoing messages written for an RPC. More...

Header: | `#include <QGrpcInterceptor>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS Grpc)` `target_link_libraries(mytarget PRIVATE Qt6::Grpc)`
Since: | Qt 6.11

- List of all members, including inherited members
- QGrpcWriteMessageInterceptor is part of Qt GRPC Interceptors.

Note: All functions in this class are reentrant.

## Public Functions

virtual | ~QGrpcWriteMessageInterceptor()
virtual void | onWriteMessage(QGrpcInterceptionContext &context, QProtobufMessage &message) = 0

## Detailed Description

Implement QGrpcWriteMessageInterceptor to observe or modify messages that are written as part of an RPC after it has been started.

For an introduction to the interception mechanism and how interceptor interfaces participate in the lifecycle of an RPC, see the Qt GRPC Interceptors Overview.

Note: This interceptor operates in the inbound direction. For details on how multiple interceptor callbacks flow through the chain, see the Direction and flow section.

See also QtGrpc::InterceptorCapability::WriteMessage and QGrpcInterceptionContext.

## Member Function Documentation

### `[virtual noexcept]` QGrpcWriteMessageInterceptor::~QGrpcWriteMessageInterceptor()

Destroys the interceptor.

### `[pure virtual]` void QGrpcWriteMessageInterceptor::onWriteMessage(QGrpcInterceptionContext &context, QProtobufMessage &message)

Called when an outgoing message is about to be written for the RPC.

The context provides information about the intercepted RPC. The message can be modified in place.

See also QGrpcClientStream::writeMessage() and QGrpcBidiStream::writeMessage().