このページでは

QGrpcWriteMessageInterceptor Class

RPC向けに作成された送信メッセージをインターセプトします。詳細...

ヘッダー: #include <QGrpcInterceptor>
CMake: find_package(Qt6 REQUIRED COMPONENTS Grpc)
target_link_libraries(mytarget PRIVATE Qt6::Grpc)
以下より: Qt 6.11

注:このクラスのすべての関数は再入可能です。

パブリック関数

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

詳細な説明

QGrpcWriteMessageInterceptor を実装して、RPC の開始後にその一環として書き込まれるメッセージを監視または変更します。

インターセプトの仕組みや、インターセプタ・インターフェースが RPC のライフサイクルにどのように関与するかについての概要については、「Qt GRPC インターセプタの概要」を参照してください。

注:この インターセプタは 、受信方向で動作します。複数のインターセプタ・コールバックがチェーン内をどのように流れるかについての詳細は、「方向と流れ」のセクションを参照してください。

「 QtGrpc::InterceptorCapability::WriteMessage 」および「QGrpcInterceptionContext 」も参照してください 。

メンバ関数のドキュメント

[virtual noexcept] QGrpcWriteMessageInterceptor::~QGrpcWriteMessageInterceptor()

インターセプターを破壊する。

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

RPC用に送信先のmessage が書き込まれようとしているときに呼び出されます。

context は、インターセプトされたRPCに関する情報を提供します。message は、その場で変更することができます。

QGrpcClientStream::writeMessage() およびQGrpcBidiStream::writeMessage()も参照してください 。

© 2026 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.