49 #ifndef GRPCXX_IMPL_CODEGEN_CLIENT_CONTEXT_H 50 #define GRPCXX_IMPL_CODEGEN_CLIENT_CONTEXT_H 69 struct census_context;
75 class ChannelInterface;
76 class CompletionQueue;
77 class CallCredentials;
83 template <
class W,
class R>
84 class ClientReaderWriter;
86 class ClientAsyncReader;
88 class ClientAsyncWriter;
89 template <
class W,
class R>
90 class ClientAsyncReaderWriter;
92 class ClientAsyncResponseReader;
151 class InteropClientContextInspector;
169 static std::unique_ptr<ClientContext> FromServerContext(
195 const std::multimap<grpc::string_ref, grpc::string_ref>&
198 return recv_initial_metadata_;
207 const std::multimap<grpc::string_ref, grpc::string_ref>&
210 return trailing_metadata_;
219 template <
typename T>
231 #ifndef GRPC_CXX0X_NO_CHRONO 232 std::chrono::system_clock::time_point deadline()
const {
236 #endif // !GRPC_CXX0X_NO_CHRONO 249 if (auth_context_.get() ==
nullptr) {
252 return auth_context_;
269 return compression_algorithm_;
289 return census_context_;
315 friend class ::grpc::testing::InteropClientContextInspector;
320 friend class ::grpc::ClientReader;
322 friend class ::grpc::ClientWriter;
323 template <
class W,
class R>
324 friend class ::grpc::ClientReaderWriter;
326 friend class ::grpc::ClientAsyncReader;
328 friend class ::grpc::ClientAsyncWriter;
329 template <
class W,
class R>
330 friend class ::grpc::ClientAsyncReaderWriter;
332 friend class ::grpc::ClientAsyncResponseReader;
333 template <
class InputMessage,
class OutputMessage>
337 const InputMessage& request,
338 OutputMessage* result);
340 grpc_call* call()
const {
return call_; }
341 void set_call(
grpc_call* call,
const std::shared_ptr<Channel>& channel);
343 uint32_t initial_metadata_flags()
const {
350 bool initial_metadata_received_;
353 std::shared_ptr<Channel> channel_;
359 std::shared_ptr<CallCredentials> creds_;
360 mutable std::shared_ptr<const AuthContext> auth_context_;
361 struct census_context* census_context_;
362 std::multimap<grpc::string, grpc::string> send_initial_metadata_;
363 std::multimap<grpc::string_ref, grpc::string_ref> recv_initial_metadata_;
364 std::multimap<grpc::string_ref, grpc::string_ref> trailing_metadata_;
374 #endif // GRPCXX_IMPL_CODEGEN_CLIENT_CONTEXT_H struct grpc_call grpc_call
A Call represents an RPC.
Definition: grpc_types.h:62
std::shared_ptr< const AuthContext > CreateAuthContext(grpc_call *call)
void set_idempotent(bool idempotent)
EXPERIMENTAL: Set this request to be idempotent.
Definition: client_context.h:226
PropagationOptions & enable_census_tracing_propagation()
Definition: client_context.h:124
PropagationOptions & enable_deadline_propagation()
Definition: client_context.h:104
std::string string
Definition: config.h:118
#define GPR_CODEGEN_ASSERT(x)
Codegen specific version of GPR_ASSERT.
Definition: core_codegen_interface.h:97
void set_deadline(const T &deadline)
Set the deadline for the client call.
Definition: client_context.h:220
Definition: sync_no_cxx11.h:45
PropagationOptions & disable_cancellation_propagation()
Definition: client_context.h:139
PropagationOptions & enable_census_stats_propagation()
Definition: client_context.h:114
gpr_timespec raw_time()
Definition: time.h:57
PropagationOptions & enable_cancellation_propagation()
Definition: client_context.h:134
Definition: client_context.h:154
std::shared_ptr< const AuthContext > auth_context() const
Return the authentication context for this client call.
Definition: client_context.h:248
struct census_context * census_context() const
Definition: client_context.h:288
Options for ClientContext::FromServerContext specifying which traits from the ServerContext to propag...
Definition: client_context.h:100
void set_fail_fast(bool fail_fast)
EXPERIMENTAL: Trigger fail-fast or not on this request.
Definition: client_context.h:229
void set_census_context(struct census_context *ccp)
Get and set census context.
Definition: client_context.h:287
#define GRPC_PROPAGATE_CENSUS_TRACING_CONTEXT
Definition: propagation_bits.h:49
Global Callbacks.
Definition: client_context.h:302
grpc_compression_algorithm
Definition: compression_types.h:72
grpc_compression_algorithm compression_algorithm() const
Return the compression algorithm to be used by the client call.
Definition: client_context.h:268
Codegen interface for grpc::Channel.
Definition: channel_interface.h:64
Status BlockingUnaryCall(ChannelInterface *channel, const RpcMethod &method, ClientContext *context, const InputMessage &request, OutputMessage *result)
Definition: client_unary_call.h:52
Definition: server_context.h:91
const std::multimap< grpc::string_ref, grpc::string_ref > & GetServerTrailingMetadata() const
Return a collection of trailing metadata key-value pairs.
Definition: client_context.h:208
#define GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY
Signal that the call should not return UNAVAILABLE before it has started.
Definition: grpc_types.h:224
PropagationOptions & disable_census_tracing_propagation()
Definition: client_context.h:129
Definition: rpc_method.h:43
gpr_timespec raw_deadline() const
Return a gpr_timespec representation of the client call's deadline.
Definition: client_context.h:239
#define GRPC_PROPAGATE_DEFAULTS
Definition: propagation_bits.h:58
#define GRPC_PROPAGATE_CENSUS_STATS_CONTEXT
Propagate census context.
Definition: propagation_bits.h:48
void set_authority(const grpc::string &authority)
Set the per call authority header (see https://tools.ietf.org/html/rfc7540#section-8.1.2.3).
Definition: client_context.h:243
Did it work? If it didn't, why?
Definition: status.h:45
std::chrono::system_clock::time_point Timespec2Timepoint(gpr_timespec t)
const std::multimap< grpc::string_ref, grpc::string_ref > & GetServerInitialMetadata() const
Return a collection of initial metadata key-value pairs.
Definition: client_context.h:196
#define GRPC_PROPAGATE_DEADLINE
Propagate deadline.
Definition: propagation_bits.h:46
PropagationOptions()
Definition: client_context.h:102
uint32_t c_bitmask() const
Definition: client_context.h:144
void set_credentials(const std::shared_ptr< CallCredentials > &creds)
Set credentials for the client call.
Definition: client_context.h:263
PropagationOptions & disable_deadline_propagation()
Definition: client_context.h:109
PropagationOptions & disable_census_stats_propagation()
Definition: client_context.h:119
virtual ~GlobalCallbacks()
Definition: client_context.h:304
#define GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST
Signal that the call is idempotent.
Definition: grpc_types.h:222
#define GRPC_PROPAGATE_CANCELLATION
Propagate cancellation.
Definition: propagation_bits.h:51
Channels represent a connection to an endpoint. Created by CreateChannel.
Definition: channel.h:49