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
34 template <
class InputMessage,
class OutputMessage>
37 const InputMessage& request, OutputMessage* result) {
39 channel, method, context, request, result)
43 template <
class InputMessage,
class OutputMessage>
44 class BlockingUnaryCallImpl {
48 const InputMessage& request, OutputMessage* result) {
57 status_ = ops.SendMessagePtr(&request);
61 ops.SendInitialMetadata(&context->send_initial_metadata_,
62 context->initial_metadata_flags());
63 ops.RecvInitialMetadata(context);
64 ops.RecvMessage(result);
66 ops.ClientSendClose();
67 ops.ClientRecvStatus(context, &status_);
68 call.PerformOps(&ops);
77 if (!ops.got_message && status_.
ok()) {
79 "No message returned for unary request");
91 #endif // GRPCPP_IMPL_CODEGEN_CLIENT_UNARY_CALL_H
Definition: call_op_set.h:618
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:850
Definition: call_op_set.h:287
Definition: channel_interface.h:70
Straightforward wrapping of the C call object.
Definition: call.h:35
bool ok() const
Is the status OK?
Definition: status.h:118
Did it work? If it didn't, why?
Definition: status.h:31
@ GRPC_CQ_DEFAULT_POLLING
The completion queue will have an associated pollset and there is no restriction on the type of file ...
Definition: grpc_types.h:710
Status BlockingUnaryCall(ChannelInterface *channel, const RpcMethod &method, grpc::ClientContext *context, const InputMessage &request, OutputMessage *result)
Wrapper that performs a blocking unary call.
Definition: client_unary_call.h:35
A ClientContext allows the person implementing a service client to:
Definition: client_context.h:195
Codegen interface for grpc::Channel.
Definition: channel_interface.h:74
@ GRPC_CQ_PLUCK
Events are popped out by calling grpc_completion_queue_pluck() API ONLY.
Definition: grpc_types.h:730
Definition: grpc_types.h:761
BlockingUnaryCallImpl(ChannelInterface *channel, const RpcMethod &method, grpc::ClientContext *context, const InputMessage &request, OutputMessage *result)
Definition: client_unary_call.h:46
::google::protobuf::util::Status Status
Definition: config_protobuf.h:90
@ UNIMPLEMENTED
Operation is not implemented or not supported/enabled in this service.
Definition: status_code_enum.h:115
#define GRPC_CQ_CURRENT_VERSION
Definition: grpc_types.h:759
Definition: call_op_set.h:768
A thin wrapper around grpc_completion_queue (see src/core/lib/surface/completion_queue....
Definition: completion_queue.h:99
Definition: byte_buffer.h:58
Descriptor of an RPC method.
Definition: rpc_method.h:29
Status status()
Definition: client_unary_call.h:82