Go to the documentation of this file.
19 #ifndef GRPCPP_IMPL_CODEGEN_CLIENT_UNARY_CALL_H
20 #define GRPCPP_IMPL_CODEGEN_CLIENT_UNARY_CALL_H
37 template <
class InputMessage,
class OutputMessage>
40 const InputMessage& request, OutputMessage* result) {
42 channel, method, context, request, result)
46 template <
class InputMessage,
class OutputMessage>
47 class BlockingUnaryCallImpl {
51 const InputMessage& request, OutputMessage* result) {
60 status_ = ops.SendMessagePtr(&request);
64 ops.SendInitialMetadata(&context->send_initial_metadata_,
65 context->initial_metadata_flags());
66 ops.RecvInitialMetadata(context);
67 ops.RecvMessage(result);
69 ops.ClientSendClose();
70 ops.ClientRecvStatus(context, &status_);
71 call.PerformOps(&ops);
80 if (!ops.got_message && status_.
ok()) {
82 "No message returned for unary request");
94 #endif // GRPCPP_IMPL_CODEGEN_CLIENT_UNARY_CALL_H
Definition: call_op_set.h:617
This header provides an object that reads bytes directly from a grpc::ByteBuffer, via the ZeroCopyInp...
Definition: alarm.h:24
Primary implementation of CallOpSetInterface.
Definition: call_op_set.h:849
Definition: call_op_set.h:286
Status BlockingUnaryCall(ChannelInterface *channel, const RpcMethod &method, grpc_impl::ClientContext *context, const InputMessage &request, OutputMessage *result)
Wrapper that performs a blocking unary call.
Definition: client_unary_call.h:38
Definition: channel_interface.h:70
Straightforward wrapping of the C call object.
Definition: call.h:38
bool ok() const
Is the status OK?
Definition: status.h:118
Did it work? If it didn't, why?
Definition: status.h:31
The completion queue will have an associated pollset and there is no restriction on the type of file ...
Definition: grpc_types.h:708
Codegen interface for grpc::Channel.
Definition: channel_interface.h:74
Events are popped out by calling grpc_completion_queue_pluck() API ONLY.
Definition: grpc_types.h:728
Definition: grpc_types.h:759
::google::protobuf::util::Status Status
Definition: config_protobuf.h:90
Operation is not implemented or not supported/enabled in this service.
Definition: status_code_enum.h:115
A thin wrapper around grpc_completion_queue (see src/core/lib/surface/completion_queue....
Definition: completion_queue_impl.h:103
#define GRPC_CQ_CURRENT_VERSION
Definition: grpc_types.h:757
Definition: call_op_set.h:767
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm_impl.h:33
BlockingUnaryCallImpl(ChannelInterface *channel, const RpcMethod &method, grpc_impl::ClientContext *context, const InputMessage &request, OutputMessage *result)
Definition: client_unary_call.h:49
A ClientContext allows the person implementing a service client to:
Definition: client_context_impl.h:184
Definition: byte_buffer.h:58
::grpc_impl::ClientContext ClientContext
Definition: client_context.h:26
Descriptor of an RPC method.
Definition: rpc_method.h:29
Status status()
Definition: client_unary_call.h:85