34 #ifndef GRPCXX_IMPL_CODEGEN_SERVER_CONTEXT_H
35 #define GRPCXX_IMPL_CODEGEN_SERVER_CONTEXT_H
42 #include <grpc/load_reporting.h>
53 struct census_context;
57 template <
class W,
class R>
58 class ServerAsyncReader;
60 class ServerAsyncWriter;
62 class ServerAsyncResponseWriter;
63 template <
class W,
class R>
64 class ServerAsyncReaderWriter;
70 template <
class W,
class R>
71 class ServerReaderWriterBody;
73 template <
class ServiceType,
class RequestType,
class ResponseType>
74 class RpcMethodHandler;
75 template <
class ServiceType,
class RequestType,
class ResponseType>
76 class ClientStreamingHandler;
77 template <
class ServiceType,
class RequestType,
class ResponseType>
78 class ServerStreamingHandler;
79 template <
class ServiceType,
class RequestType,
class ResponseType>
80 class BidiStreamingHandler;
81 class UnknownMethodHandler;
85 class CompletionQueue;
87 class ServerInterface;
90 class InteropServerContextInspector;
91 class ServerContextTestSpouse;
100 std::chrono::system_clock::time_point
deadline()
const {
129 return *client_metadata_.
map();
133 return compression_level_;
137 compression_level_set_ =
true;
138 compression_level_ = level;
144 return compression_algorithm_;
152 if (auth_context_.get() ==
nullptr) {
155 return auth_context_;
170 has_notify_when_done_tag_ =
true;
171 async_notify_when_done_tag_ = tag;
179 friend class ::grpc::testing::InteropServerContextInspector;
180 friend class ::grpc::testing::ServerContextTestSpouse;
181 friend class ::grpc::ServerInterface;
182 friend class ::grpc::Server;
183 template <
class W,
class R>
184 friend class ::grpc::ServerAsyncReader;
186 friend class ::grpc::ServerAsyncWriter;
188 friend class ::grpc::ServerAsyncResponseWriter;
189 template <
class W,
class R>
190 friend class ::grpc::ServerAsyncReaderWriter;
192 friend class ::grpc::ServerReader;
194 friend class ::grpc::ServerWriter;
195 template <
class W,
class R>
196 friend class ::grpc::internal::ServerReaderWriterBody;
197 template <
class ServiceType,
class RequestType,
class ResponseType>
199 template <
class ServiceType,
class RequestType,
class ResponseType>
201 template <
class ServiceType,
class RequestType,
class ResponseType>
203 template <
class Streamer,
bool WriteNeeded>
206 friend class ::grpc::ClientContext;
214 void BeginCompletionOp(
Call* call);
218 void set_call(
grpc_call* call) { call_ = call; }
220 uint32_t initial_metadata_flags()
const {
return 0; }
222 CompletionOp* completion_op_;
223 bool has_notify_when_done_tag_;
224 void* async_notify_when_done_tag_;
228 CompletionQueue* cq_;
229 bool sent_initial_metadata_;
230 mutable std::shared_ptr<const AuthContext> auth_context_;
231 MetadataMap client_metadata_;
232 std::multimap<grpc::string, grpc::string> initial_metadata_;
233 std::multimap<grpc::string, grpc::string> trailing_metadata_;
235 bool compression_level_set_;
242 #endif // GRPCXX_IMPL_CODEGEN_SERVER_CONTEXT_H
grpc_compression_algorithm compression_algorithm() const
Definition: server_context.h:143
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:132
std::string string
Definition: config.h:50
gpr_timespec raw_deadline() const
Definition: server_context.h:104
void set_compression_level(grpc_compression_level level)
Definition: server_context.h:136
void AsyncNotifyWhenDone(void *tag)
Definition: server_context.h:169
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:95
grpc::string peer() const
const std::multimap< grpc::string_ref, grpc::string_ref > & client_metadata() const
Definition: server_context.h:127
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:176
void AddTrailingMetadata(const grpc::string &key, const grpc::string &value)
std::shared_ptr< const AuthContext > auth_context() const
Definition: server_context.h:151
bool compression_level_set() const
Definition: server_context.h:141
std::chrono::system_clock::time_point deadline() const
Definition: server_context.h:100