The QGrpcClientBase class serves as base for generated client interfaces. 更多...
| 头: |
#include <QGrpcClientBase>
|
| CMake: |
find_package(Qt6 REQUIRED COMPONENTS Grpc)
target_link_libraries(mytarget PRIVATE Qt6::Grpc)
|
| Since: | Qt 6.5 |
| 继承: | QObject |
(从 6.7 起)
channel
: std::shared_ptr<QAbstractGrpcChannel>
| virtual | ~QGrpcClientBase () override |
| bool | attachChannel (std::shared_ptr<QAbstractGrpcChannel> channel ) |
(从 6.7 起)
std::shared_ptr<QAbstractGrpcChannel>
|
channel () const |
(从 6.7 起)
void
|
channelChanged () |
The QGrpcClientBase class provides a common set of functionalities for the generated client interface of the gRPC ™ service definition.
The RPC methods of this class should not be called directly.
注意: Thread safety is enforced for the non-const member functions. These functions must be called from the same thread in which the object was created.
[since 6.7]
channel
:
std::shared_ptr
<
QAbstractGrpcChannel
>
This property holds the channel attached to this client. The channel is used as the transport layer for gRPC operations.
该特性在 Qt 6.7 引入。
访问函数:
| std::shared_ptr<QAbstractGrpcChannel> | channel () const |
| bool | attachChannel (std::shared_ptr<QAbstractGrpcChannel> channel ) |
通知程序信号:
| void | channelChanged () |
另请参阅 attachChannel ().
[override virtual noexcept]
QGrpcClientBase::
~QGrpcClientBase
()
销毁 QGrpcClientBase .
Attaches
channel
to the client as transport layer for
gRPC
operations. Returns
true
if the channel successfully attached; otherwise, returns
false
.
Request and response messages will be serialized in a format that the channel supports.
注意: 警告 : Qt GRPC doesn't guarantee thread safety on the channel level. You have to invoke the channel-related functions on the same thread as QGrpcClientBase .
注意: setter 函数对于特性 channel .
[since 6.7]
std::shared_ptr
<
QAbstractGrpcChannel
> QGrpcClientBase::
channel
() const
Returns the channel attached to this client.
注意: Getter function for property channel.
该函数在 Qt 6.7 引入。
[signal, since 6.7]
void
QGrpcClientBase::
channelChanged
()
Indicates that a new channel got attached to the client.
注意: 通知程序信号对于特性 channel .
该函数在 Qt 6.7 引入。