19 #ifndef GRPCPP_IMPL_CODEGEN_SERVER_CONTEXT_H 20 #define GRPCPP_IMPL_CODEGEN_SERVER_CONTEXT_H 42 struct census_context;
46 template <
class W,
class R>
47 class ServerAsyncReader;
49 class ServerAsyncWriter;
51 class ServerAsyncResponseWriter;
52 template <
class W,
class R>
53 class ServerAsyncReaderWriter;
59 template <
class W,
class R>
60 class ServerReaderWriterBody;
61 template <
class ServiceType,
class RequestType,
class ResponseType>
62 class RpcMethodHandler;
63 template <
class ServiceType,
class RequestType,
class ResponseType>
64 class ClientStreamingHandler;
65 template <
class ServiceType,
class RequestType,
class ResponseType>
66 class ServerStreamingHandler;
67 template <
class ServiceType,
class RequestType,
class ResponseType>
68 class BidiStreamingHandler;
69 template <
class ServiceType,
class RequestType,
class ResponseType>
70 class CallbackUnaryHandler;
71 template <
class Streamer,
bool WriteNeeded>
72 class TemplatedBidiStreamingHandler;
73 template <StatusCode code>
74 class ErrorMethodHandler;
78 class CompletionQueue;
80 class ServerInterface;
83 class InteropServerContextInspector;
84 class ServerContextTestSpouse;
108 std::chrono::system_clock::time_point
deadline()
const {
146 bool IsCancelled()
const;
164 void TryCancel()
const;
177 return *client_metadata_.map();
182 return compression_level_;
189 compression_level_set_ =
true;
190 compression_level_ = level;
203 return compression_algorithm_;
211 void SetLoadReportingCosts(
const std::vector<grpc::string>& cost_data);
217 if (auth_context_.get() ==
nullptr) {
220 return auth_context_;
230 const struct census_context* census_context()
const;
238 has_notify_when_done_tag_ =
true;
239 async_notify_when_done_tag_ = tag;
247 friend class ::grpc::testing::InteropServerContextInspector;
248 friend class ::grpc::testing::ServerContextTestSpouse;
249 friend class ::grpc::ServerInterface;
250 friend class ::grpc::Server;
251 template <
class W,
class R>
252 friend class ::grpc::ServerAsyncReader;
254 friend class ::grpc::ServerAsyncWriter;
256 friend class ::grpc::ServerAsyncResponseWriter;
257 template <
class W,
class R>
258 friend class ::grpc::ServerAsyncReaderWriter;
260 friend class ::grpc::ServerReader;
262 friend class ::grpc::ServerWriter;
263 template <
class W,
class R>
264 friend class ::grpc::internal::ServerReaderWriterBody;
265 template <
class ServiceType,
class RequestType,
class ResponseType>
266 friend class ::grpc::internal::RpcMethodHandler;
267 template <
class ServiceType,
class RequestType,
class ResponseType>
268 friend class ::grpc::internal::ClientStreamingHandler;
269 template <
class ServiceType,
class RequestType,
class ResponseType>
270 friend class ::grpc::internal::ServerStreamingHandler;
271 template <
class Streamer,
bool WriteNeeded>
272 friend class ::grpc::internal::TemplatedBidiStreamingHandler;
273 template <
class ServiceType,
class RequestType,
class ResponseType>
274 friend class ::grpc::internal::CallbackUnaryHandler;
275 template <StatusCode code>
277 friend class ::grpc::ClientContext;
291 void set_call(
grpc_call* call) { call_ = call; }
299 uint32_t initial_metadata_flags()
const {
return 0; }
304 std::unique_ptr<experimental::ServerInterceptorFactoryInterface>>&
306 if (creators.size() != 0) {
308 rpc_info_->RegisterInterceptors(creators);
313 CompletionOp* completion_op_;
314 bool has_notify_when_done_tag_;
315 void* async_notify_when_done_tag_;
321 bool sent_initial_metadata_;
322 mutable std::shared_ptr<const AuthContext> auth_context_;
324 std::multimap<grpc::string, grpc::string> initial_metadata_;
325 std::multimap<grpc::string, grpc::string> trailing_metadata_;
327 bool compression_level_set_;
334 bool has_pending_ops_;
341 #endif // GRPCPP_IMPL_CODEGEN_SERVER_CONTEXT_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)
std::string string
Definition: config.h:35
An interface allowing implementors to process and filter event tags.
Definition: completion_queue_tag.h:26
Primary implementation of CallOpSetInterface.
Definition: call_op_set.h:755
void set_compression_level(grpc_compression_level level)
Set level to be the compression level used for the server call.
Definition: server_context.h:188
grpc_compression_algorithm compression_algorithm() const
Return the compression algorithm the server call will request be used.
Definition: server_context.h:202
void AsyncNotifyWhenDone(void *tag)
Async only.
Definition: server_context.h:237
grpc_compression_level
Compression levels allow a party with knowledge of its peer's accepted encodings to request compressi...
Definition: compression_types.h:70
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.h:175
grpc_compression_level compression_level() const
Return the compression algorithm to be used by the server call.
Definition: server_context.h:181
std::chrono::system_clock::time_point deadline() const
Return the deadline for the server call.
Definition: server_context.h:108
bool compression_level_set() const
Return a bool indicating whether the compression level for this call has been set (either implicitly ...
Definition: server_context.h:196
Definition: call_op_set.h:293
grpc_compression_algorithm
The various compression algorithms supported by gRPC.
Definition: compression_types.h:56
Definition: server_interceptor.h:45
An Alarm posts the user provided tag to its associated completion queue upon expiry or cancellation...
Definition: alarm.h:33
A ServerContext allows the person implementing a service handler to:
Definition: server_context.h:102
gpr_timespec raw_deadline() const
Return a gpr_timespec representation of the server call's deadline.
Definition: server_context.h:113
A thin wrapper around grpc_completion_queue (see src/core/lib/surface/completion_queue.h).
Definition: completion_queue.h:95
CallbackWithSuccessTag can be reused multiple times, and will be used in this fashion for streaming o...
Definition: callback_common.h:116
std::shared_ptr< const AuthContext > auth_context() const
Return the authentication context for this server call.
Definition: server_context.h:216
General method handler class for errors that prevent real method use e.g., handle unknown method by r...
Definition: byte_buffer.h:51
Analogous to struct timespec.
Definition: gpr_types.h:47
std::chrono::system_clock::time_point Timespec2Timepoint(gpr_timespec t)
grpc_call * c_call()
Should be used for framework-level extensions only.
Definition: server_context.h:244
Straightforward wrapping of the C call object.
Definition: call.h:36