QGrpcClientBase Class
La classe QGrpcClientBase sert de base aux interfaces client générées. Plus d'informations...
| 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 : | 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 dans la gRPC™ définition du service.
Les méthodes RPC de cette classe ne doivent pas être appelées directement.
Remarque : la sécurité des threads est assurée pour les fonctions membres non constantes. Ces fonctions doivent être appelées à partir du même site thread que celui dans lequel l'objet a été créé.
Documentation sur les propriétés
[since 6.7] channel : std::shared_ptr<QAbstractGrpcChannel>
Cette propriété contient le canal attaché à ce client. Le canal est utilisé comme couche de transport pour les opérations gRPC.
Cette propriété a été introduite dans Qt 6.7.
Fonctions d'accès :
| std::shared_ptr<QAbstractGrpcChannel> | channel() const |
| bool | attachChannel(std::shared_ptr<QAbstractGrpcChannel> channel) |
Notifier signal :
| void | channelChanged() |
Voir aussi attachChannel().
Documentation des fonctions membres
[override virtual noexcept] QGrpcClientBase::~QGrpcClientBase()
Détruit le site QGrpcClientBase.
bool QGrpcClientBase::attachChannel(std::shared_ptr<QAbstractGrpcChannel> channel)
Attache channel au client en tant que couche de transport pour les opérations gRPC. Retourne true si le canal est attaché avec succès ; sinon, retourne false.
Les messages de demande et de réponse seront sérialisés dans un format pris en charge par le canal.
Note : Avertissement: Qt GRPC ne garantit pas la sécurité des threads au niveau du canal. Vous devez invoquer les fonctions liées au canal dans le même thread que QGrpcClientBase.
Note : Fonction Setter pour la propriété channel.
[since 6.7] std::shared_ptr<QAbstractGrpcChannel> QGrpcClientBase::channel() const
Renvoie le canal attaché à ce client.
Note : Fonction Getter 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é attaché au client.
Remarque : signal de 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.