19 #ifndef GRPCPP_IMPL_CODEGEN_SERVER_CONTEXT_IMPL_H 20 #define GRPCPP_IMPL_CODEGEN_SERVER_CONTEXT_IMPL_H 41 struct census_context;
47 template <
class W,
class R>
53 template <
class W,
class R>
61 template <
class ServiceType,
class RequestType,
class ResponseType>
63 template <
class RequestType,
class ResponseType>
65 template <
class RequestType,
class ResponseType>
67 template <
class RequestType,
class ResponseType>
69 template <
class RequestType,
class ResponseType>
71 template <
class W,
class R>
78 class GenericServerContext;
79 class ServerInterface;
82 template <
class ServiceType,
class RequestType,
class ResponseType>
83 class ClientStreamingHandler;
84 template <
class ServiceType,
class RequestType,
class ResponseType>
85 class ServerStreamingHandler;
86 template <
class ServiceType,
class RequestType,
class ResponseType>
87 class RpcMethodHandler;
88 template <
class Streamer,
bool WriteNeeded>
89 class TemplatedBidiStreamingHandler;
90 template <StatusCode code>
91 class ErrorMethodHandler;
95 class ServerInterface;
97 class InteropServerContextInspector;
98 class ServerContextTestSpouse;
124 std::chrono::system_clock::time_point
deadline()
const {
176 bool IsCancelled()
const;
194 void TryCancel()
const;
207 return *client_metadata_.map();
212 return compression_level_;
219 compression_level_set_ =
true;
220 compression_level_ = level;
233 return compression_algorithm_;
241 void SetLoadReportingCosts(
const std::vector<grpc::string>& cost_data);
247 if (auth_context_.get() ==
nullptr) {
250 return auth_context_;
260 const struct census_context* census_context()
const;
268 has_notify_when_done_tag_ =
true;
269 async_notify_when_done_tag_ = tag;
277 friend class ::grpc::testing::InteropServerContextInspector;
278 friend class ::grpc::testing::ServerContextTestSpouse;
279 friend class ::grpc::ServerInterface;
281 template <
class W,
class R>
287 template <
class W,
class R>
293 template <
class W,
class R>
294 friend class ::grpc_impl::internal::ServerReaderWriterBody;
295 template <
class ServiceType,
class RequestType,
class ResponseType>
296 friend class ::grpc::internal::RpcMethodHandler;
297 template <
class ServiceType,
class RequestType,
class ResponseType>
298 friend class ::grpc::internal::ClientStreamingHandler;
299 template <
class ServiceType,
class RequestType,
class ResponseType>
300 friend class ::grpc::internal::ServerStreamingHandler;
301 template <
class Streamer,
bool WriteNeeded>
302 friend class ::grpc::internal::TemplatedBidiStreamingHandler;
303 template <
class RequestType,
class ResponseType>
304 friend class ::grpc_impl::internal::CallbackUnaryHandler;
305 template <
class RequestType,
class ResponseType>
306 friend class ::grpc_impl::internal::CallbackClientStreamingHandler;
307 template <
class RequestType,
class ResponseType>
308 friend class ::grpc_impl::internal::CallbackServerStreamingHandler;
309 template <
class RequestType,
class ResponseType>
310 friend class ::grpc_impl::internal::CallbackBidiHandler;
311 template <::grpc::StatusCode code>
312 friend class ::grpc::internal::ErrorMethodHandler;
314 friend class ::grpc::GenericServerContext;
323 std::function<
void(
bool)> callback,
330 void set_call(
grpc_call* call) { call_ = call; }
338 uint32_t initial_metadata_flags()
const {
return 0; }
340 void SetCancelCallback(std::function<
void()> callback);
341 void ClearCancelCallback();
345 const std::vector<std::unique_ptr<
347 if (creators.size() != 0) {
348 rpc_info_ = new ::grpc::experimental::ServerRpcInfo(
this, method, type);
349 rpc_info_->RegisterInterceptors(creators);
354 CompletionOp* completion_op_;
355 bool has_notify_when_done_tag_;
356 void* async_notify_when_done_tag_;
362 bool sent_initial_metadata_;
363 mutable std::shared_ptr<const ::grpc::AuthContext> auth_context_;
364 mutable ::grpc::internal::MetadataMap client_metadata_;
365 std::multimap<grpc::string, grpc::string> initial_metadata_;
366 std::multimap<grpc::string, grpc::string> trailing_metadata_;
368 bool compression_level_set_;
375 bool has_pending_ops_;
380 #endif // GRPCPP_IMPL_CODEGEN_SERVER_CONTEXT_IMPL_H
struct grpc_call grpc_call
A Call represents an RPC.
Definition: grpc_types.h:70
std::shared_ptr< const AuthContext > CreateAuthContext(grpc_call *call)
Definition: byte_buffer.h:38
const std::multimap< grpc::string_ref, grpc::string_ref > & client_metadata() const
Return a collection of initial metadata key-value pairs sent from the client.
Definition: server_context_impl.h:205
::grpc_impl::ClientContext ClientContext
Definition: client_context.h:26
std::string string
Definition: config.h:35
An interface allowing implementors to process and filter event tags.
Definition: completion_queue_tag.h:26
void AsyncNotifyWhenDone(void *tag)
Async only.
Definition: server_context_impl.h:267
::grpc_impl::Server Server
Definition: server.h:26
Primary implementation of CallOpSetInterface.
Definition: call_op_set.h:821
::grpc_impl::ServerAsyncResponseWriter< W > ServerAsyncResponseWriter
Definition: async_unary_call.h:34
Definition: completion_queue_impl.h:62
::grpc_impl::ServerAsyncWriter< W > ServerAsyncWriter
Definition: async_stream.h:69
grpc_compression_level
Compression levels allow a party with knowledge of its peer's accepted encodings to request compressi...
Definition: compression_types.h:71
RpcType
Definition: rpc_method.h:31
::grpc_impl::ServerContext ServerContext
Definition: server_context.h:25
A ServerContext allows the person implementing a service handler to:
Definition: server_context_impl.h:118
std::shared_ptr< const ::grpc::AuthContext > auth_context() const
Return the authentication context for this server call.
Definition: server_context_impl.h:246
Definition: server_interceptor.h:47
grpc_call * c_call()
Should be used for framework-level extensions only.
Definition: server_context_impl.h:274
void set_compression_level(grpc_compression_level level)
Set level to be the compression level used for the server call.
Definition: server_context_impl.h:218
::grpc_impl::ServerReader< R > ServerReader
Definition: sync_stream.h:75
::grpc_impl::CompletionQueue CompletionQueue
Definition: completion_queue.h:26
std::chrono::system_clock::time_point deadline() const
Return the deadline for the server call.
Definition: server_context_impl.h:124
Definition: server_context_impl.h:62
Definition: call_op_set.h:288
grpc_compression_algorithm
The various compression algorithms supported by gRPC (not sorted by compression level) ...
Definition: compression_types.h:57
ServerRpcInfo represents the state of a particular RPC as it appears to an interceptor.
Definition: server_interceptor.h:60
grpc_compression_level compression_level() const
Return the compression algorithm to be used by the server call.
Definition: server_context_impl.h:211
grpc_compression_algorithm compression_algorithm() const
Return the compression algorithm the server call will request be used.
Definition: server_context_impl.h:232
This header provides an object that reads bytes directly from a grpc::ByteBuffer, via the ZeroCopyInp...
Definition: alarm.h:24
Definition: byte_buffer.h:36
gpr_timespec raw_deadline() const
Return a gpr_timespec representation of the server call's deadline.
Definition: server_context_impl.h:129
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm_impl.h:33
::grpc_impl::ServerAsyncReaderWriter< W, R > ServerAsyncReaderWriter
Definition: async_stream.h:76
Definition: server_callback_impl.h:46
CallbackWithSuccessTag can be reused multiple times, and will be used in this fashion for streaming o...
Definition: callback_common.h:132
::grpc_impl::ServerAsyncReader< W, R > ServerAsyncReader
Definition: async_stream.h:63
A thin wrapper around grpc_completion_queue (see src/core/lib/surface/completion_queue.h).
Definition: completion_queue_impl.h:101
bool compression_level_set() const
Return a bool indicating whether the compression level for this call has been set (either implicitly ...
Definition: server_context_impl.h:226
Analogous to struct timespec.
Definition: gpr_types.h:47
std::chrono::system_clock::time_point Timespec2Timepoint(gpr_timespec t)
::grpc_impl::ServerWriter< W > ServerWriter
Definition: sync_stream.h:81
Definition: server_callback_impl.h:42
Definition: server_callback_impl.h:48
Straightforward wrapping of the C call object.
Definition: call.h:38