QGrpcClientBase Class
QGrpcClientBase クラスは、生成されるクライアントインターフェースの基底クラスとして機能します。詳細...
| ヘッダー: | #include <QGrpcClientBase> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Grpc) target_link_libraries(mytarget PRIVATE Qt6::Grpc) |
| 以下のように: | Qt 6.5 |
| 継承元: | QObject |
プロパティ
(since 6.7)channel : std::shared_ptr<QAbstractGrpcChannel>
パブリック関数
| virtual | ~QGrpcClientBase() override |
| bool | attachChannel(std::shared_ptr<QAbstractGrpcChannel> channel) |
(since 6.7) std::shared_ptr<QAbstractGrpcChannel> | channel() const |
シグナル
(since 6.7) void | channelChanged() |
詳細な説明
QGrpcClientBase クラスは、 gRPC™ サービス定義に対して、一連の共通機能を提供します。
このクラスの RPC メソッドを直接呼び出してはなりません。
注: 非 const メンバ関数については、スレッドセーフが 保証されています。これらの関数は、オブジェクトが作成されたのと同じthread から呼び出す必要があります。
プロパティのドキュメント
[since 6.7] channel : std::shared_ptr<QAbstractGrpcChannel>
このプロパティには、このクライアントに紐付けられたチャネルが格納されます。このチャネルは、gRPC 操作のトランスポート層として使用されます。
この列挙型は Qt 6.7 で導入されました。
アクセス関数:
| std::shared_ptr<QAbstractGrpcChannel> | channel() const |
| bool | attachChannel(std::shared_ptr<QAbstractGrpcChannel> channel) |
Notifierシグナル:
| void | channelChanged() |
関連項目: ` attachChannel()`。
メンバ関数のドキュメント
[override virtual noexcept] QGrpcClientBase::~QGrpcClientBase()
QGrpcClientBase を削除します。
bool QGrpcClientBase::attachChannel(std::shared_ptr<QAbstractGrpcChannel> channel)
gRPC 操作のトランスポート層として、channel をクライアントにアタッチします。チャネルのアタッチに成功した場合はtrue を返し、失敗した場合はfalse を返します。
リクエストおよびレスポンスメッセージは、チャネルがサポートする形式でシリアライズされます。
注: 警告:Qt GRPC は、チャネルレベルでのスレッドセーフ性を保証しません。QGrpcClientBase と同じスレッド上で、チャネル関連の関数を呼び出す必要があります。
注: プロパティchannel のセッター 関数です。
[since 6.7] std::shared_ptr<QAbstractGrpcChannel> QGrpcClientBase::channel() const
このクライアントに紐付けられているチャンネルを返します。
注: プロパティ `channel`のゲッター 関数です。
この関数は Qt 6.7 で導入されました。
[signal, since 6.7] void QGrpcClientBase::channelChanged()
クライアントに新しいチャネルが接続されたことを示します。
注: プロパティchannel の通知 シグナルです。
この関数は Qt 6.7 で導入されました。
© 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.