QGrpcClientBase Class
La classe `QGrpcClientBase` sert de base aux interfaces client générées. En savoir plus...
| En-tête : | #include <QGrpcClientBase> |
| CMake : | find_package(Qt6 REQUIRED COMPONENTS Grpc) target_link_libraries(mytarget PRIVATE Qt6::Grpc) |
| Depuis : | Qt 6.5 |
| Hérite de : | QObject |
Propriétés
(since 6.7)channel : std::shared_ptr<QAbstractGrpcChannel>
Fonctions publiques
| virtual | ~QGrpcClientBase() override |
| bool | attachChannel(std::shared_ptr<QAbstractGrpcChannel> channel) |
(since 6.7) std::shared_ptr<QAbstractGrpcChannel> | channel() const |
Signaux
(since 6.7) void | channelChanged() |
Description détaillée
La classe QGrpcClientBase fournit un ensemble commun de fonctionnalités pour l'interface client générée de la gRPC™ définition de service.
Les méthodes RPC de cette classe ne doivent pas être appelées directement.
Remarque : la sécuritéinter-thread est garantie pour les fonctions membres non const. Ces fonctions doivent être appelées depuis le même thread que celui dans lequel l’objet a été créé.
Documentation des propriétés
[since 6.7] channel : std::shared_ptr<QAbstractGrpcChannel>
Cette propriété contient le canal associé à ce client. Le canal sert de couche de transport pour les opérations gRPC.
Cette énumération a été introduite dans Qt 6.7.
Fonctions d'accès :
| std::shared_ptr<QAbstractGrpcChannel> | channel() const |
| bool | attachChannel(std::shared_ptr<QAbstractGrpcChannel> channel) |
Signal de notification :
| void | channelChanged() |
Voir également attachChannel().
Documentation des fonctions membres
[override virtual noexcept] QGrpcClientBase::~QGrpcClientBase()
Supprime l’ QGrpcClientBase.
bool QGrpcClientBase::attachChannel(std::shared_ptr<QAbstractGrpcChannel> channel)
Associe channel au client en tant que couche de transport pour les opérations gRPC. Renvoie true si le canal a été associé avec succès ; sinon, renvoie false.
Les messages de requête et de réponse seront sérialisés dans un format pris en charge par le canal.
Remarque : Avertissement: ` Qt GRPC ` ne garantit pas la sécurité des threads au niveau du canal. Vous devez appeler les fonctions liées au canal sur le même thread que ` QGrpcClientBase`.
Remarque : fonctionde définition pour la propriété channel.
[since 6.7] std::shared_ptr<QAbstractGrpcChannel> QGrpcClientBase::channel() const
Renvoie le canal associé à ce client.
Remarque : fonctiongetter pour la propriété channel.
Cette fonction a été introduite dans Qt 6.7.
[signal, since 6.7] void QGrpcClientBase::channelChanged()
Indique qu'un nouveau canal a été associé au client.
Remarque : signalde notification pour la propriété channel.
Cette fonction a été introduite dans 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.