34 #ifndef GRPCXX_IMPL_CODEGEN_SERVER_CONTEXT_H
35 #define GRPCXX_IMPL_CODEGEN_SERVER_CONTEXT_H
52 struct census_context;
56 template <
class W,
class R>
57 class ServerAsyncReader;
59 class ServerAsyncWriter;
61 class ServerAsyncResponseWriter;
62 template <
class W,
class R>
63 class ServerAsyncReaderWriter;
69 template <
class W,
class R>
70 class ServerReaderWriterBody;
72 template <
class ServiceType,
class RequestType,
class ResponseType>
73 class RpcMethodHandler;
74 template <
class ServiceType,
class RequestType,
class ResponseType>
75 class ClientStreamingHandler;
76 template <
class ServiceType,
class RequestType,
class ResponseType>
77 class ServerStreamingHandler;
78 template <
class ServiceType,
class RequestType,
class ResponseType>
79 class BidiStreamingHandler;
80 class UnknownMethodHandler;
84 class CompletionQueue;
86 class ServerInterface;
89 class InteropServerContextInspector;
90 class ServerContextTestSpouse;
99 std::chrono::system_clock::time_point
deadline()
const {
128 return *client_metadata_.
map();
132 return compression_level_;
136 compression_level_set_ =
true;
137 compression_level_ = level;
143 return compression_algorithm_;
151 if (auth_context_.get() ==
nullptr) {
154 return auth_context_;
169 has_notify_when_done_tag_ =
true;
170 async_notify_when_done_tag_ = tag;
178 friend class ::grpc::testing::InteropServerContextInspector;
179 friend class ::grpc::testing::ServerContextTestSpouse;
180 friend class ::grpc::ServerInterface;
181 friend class ::grpc::Server;
182 template <
class W,
class R>
183 friend class ::grpc::ServerAsyncReader;
185 friend class ::grpc::ServerAsyncWriter;
187 friend class ::grpc::ServerAsyncResponseWriter;
188 template <
class W,
class R>
189 friend class ::grpc::ServerAsyncReaderWriter;
191 friend class ::grpc::ServerReader;
193 friend class ::grpc::ServerWriter;
194 template <
class W,
class R>
195 friend class ::grpc::internal::ServerReaderWriterBody;
196 template <
class ServiceType,
class RequestType,
class ResponseType>
198 template <
class ServiceType,
class RequestType,
class ResponseType>
200 template <
class ServiceType,
class RequestType,
class ResponseType>
202 template <
class Streamer,
bool WriteNeeded>
205 friend class ::grpc::ClientContext;
213 void BeginCompletionOp(
Call* call);
217 void set_call(
grpc_call* call) { call_ = call; }
219 uint32_t initial_metadata_flags()
const {
return 0; }
221 CompletionOp* completion_op_;
222 bool has_notify_when_done_tag_;
223 void* async_notify_when_done_tag_;
227 CompletionQueue* cq_;
228 bool sent_initial_metadata_;
229 mutable std::shared_ptr<const AuthContext> auth_context_;
230 MetadataMap client_metadata_;
231 std::multimap<grpc::string, grpc::string> initial_metadata_;
232 std::multimap<grpc::string, grpc::string> trailing_metadata_;
234 bool compression_level_set_;
241 #endif // GRPCXX_IMPL_CODEGEN_SERVER_CONTEXT_H
grpc_compression_algorithm compression_algorithm() const
Definition: server_context.h:142
struct grpc_call grpc_call
A Call represents an RPC.
Definition: grpc_types.h:85
std::shared_ptr< const AuthContext > CreateAuthContext(grpc_call *call)
void SetLoadReportingCosts(const std::vector< grpc::string > &cost_data)
void set_compression_algorithm(grpc_compression_algorithm algorithm)
grpc_compression_level compression_level() const
Definition: server_context.h:131
std::string string
Definition: config.h:50
gpr_timespec raw_deadline() const
Definition: server_context.h:103
void set_compression_level(grpc_compression_level level)
Definition: server_context.h:135
void AsyncNotifyWhenDone(void *tag)
Definition: server_context.h:168
grpc_compression_level
Compression levels allow a party with knowledge of its peer's accepted encodings to request compressi...
Definition: compression_types.h:84
void AddInitialMetadata(const grpc::string &key, const grpc::string &value)
Definition: method_handler_impl.h:253
const struct census_context * census_context() const
Definition: method_handler_impl.h:177
grpc_compression_algorithm
Definition: compression_types.h:72
Definition: completion_queue.h:76
Definition: server_context.h:94
grpc::string peer() const
const std::multimap< grpc::string_ref, grpc::string_ref > & client_metadata() const
Definition: server_context.h:126
Definition: completion_queue.h:78
Definition: completion_queue.h:80
Definition: gpr_types.h:63
std::chrono::system_clock::time_point Timespec2Timepoint(gpr_timespec t)
grpc_call * c_call()
Definition: server_context.h:175
void AddTrailingMetadata(const grpc::string &key, const grpc::string &value)
std::shared_ptr< const AuthContext > auth_context() const
Definition: server_context.h:150
bool compression_level_set() const
Definition: server_context.h:140
std::chrono::system_clock::time_point deadline() const
Definition: server_context.h:99