34 #ifndef GRPCXX_IMPL_CODEGEN_SERVER_CONTEXT_H
35 #define GRPCXX_IMPL_CODEGEN_SERVER_CONTEXT_H
40 #include <grpc/impl/codegen/compression_types.h>
41 #include <grpc/impl/codegen/time.h>
50 struct census_context;
55 template <
class W,
class R>
56 class ServerAsyncReader;
58 class ServerAsyncWriter;
60 class ServerAsyncResponseWriter;
61 template <
class W,
class R>
62 class ServerAsyncReaderWriter;
67 template <
class W,
class R>
68 class ServerReaderWriter;
69 template <
class ServiceType,
class RequestType,
class ResponseType>
70 class RpcMethodHandler;
71 template <
class ServiceType,
class RequestType,
class ResponseType>
72 class ClientStreamingHandler;
73 template <
class ServiceType,
class RequestType,
class ResponseType>
74 class ServerStreamingHandler;
75 template <
class ServiceType,
class RequestType,
class ResponseType>
76 class BidiStreamingHandler;
77 class UnknownMethodHandler;
81 class CompletionQueue;
83 class ServerInterface;
86 class InteropServerContextInspector;
95 #ifndef GRPC_CXX0X_NO_CHRONO
96 std::chrono::system_clock::time_point
deadline() {
99 #endif // !GRPC_CXX0X_NO_CHRONO
122 return client_metadata_;
126 return compression_level_;
131 return compression_algorithm_;
135 std::shared_ptr<const AuthContext>
auth_context()
const;
149 has_notify_when_done_tag_ =
true;
150 async_notify_when_done_tag_ = tag;
154 friend class ::grpc::testing::InteropServerContextInspector;
155 friend class ::grpc::ServerInterface;
156 friend class ::grpc::Server;
157 template <
class W,
class R>
158 friend class ::grpc::ServerAsyncReader;
160 friend class ::grpc::ServerAsyncWriter;
162 friend class ::grpc::ServerAsyncResponseWriter;
163 template <
class W,
class R>
164 friend class ::grpc::ServerAsyncReaderWriter;
166 friend class ::grpc::ServerReader;
168 friend class ::grpc::ServerWriter;
169 template <
class W,
class R>
170 friend class ::grpc::ServerReaderWriter;
171 template <
class ServiceType,
class RequestType,
class ResponseType>
173 template <
class ServiceType,
class RequestType,
class ResponseType>
175 template <
class ServiceType,
class RequestType,
class ResponseType>
177 template <
class ServiceType,
class RequestType,
class ResponseType>
180 friend class ::grpc::ClientContext;
188 void BeginCompletionOp(
Call* call);
191 size_t metadata_count);
193 void set_call(grpc_call* call);
195 CompletionOp* completion_op_;
196 bool has_notify_when_done_tag_;
197 void* async_notify_when_done_tag_;
199 gpr_timespec deadline_;
202 bool sent_initial_metadata_;
203 mutable std::shared_ptr<const AuthContext> auth_context_;
204 std::multimap<grpc::string_ref, grpc::string_ref> client_metadata_;
205 std::multimap<grpc::string, grpc::string> initial_metadata_;
206 std::multimap<grpc::string, grpc::string> trailing_metadata_;
208 grpc_compression_level compression_level_;
209 grpc_compression_algorithm compression_algorithm_;
214 #endif // GRPCXX_IMPL_CODEGEN_SERVER_CONTEXT_H
const std::multimap< grpc::string_ref, grpc::string_ref > & client_metadata()
Definition: server_context.h:121
grpc_compression_algorithm compression_algorithm() const
Definition: server_context.h:130
std::chrono::system_clock::time_point deadline()
Definition: server_context.h:96
void set_compression_algorithm(grpc_compression_algorithm algorithm)
grpc_compression_level compression_level() const
Definition: server_context.h:125
std::string string
Definition: config.h:112
void set_compression_level(grpc_compression_level level)
void AsyncNotifyWhenDone(void *tag)
Definition: server_context.h:148
void AddInitialMetadata(const grpc::string &key, const grpc::string &value)
Definition: method_handler_impl.h:181
const struct census_context * census_context() const
Definition: completion_queue.h:60
Definition: server_context.h:90
grpc::string peer() const
A thin wrapper around grpc_completion_queue (see / src/core/surface/completion_queue.h).
Definition: completion_queue.h:81
Definition: completion_queue.h:62
Definition: completion_queue.h:64
std::chrono::system_clock::time_point Timespec2Timepoint(gpr_timespec t)
void AddTrailingMetadata(const grpc::string &key, const grpc::string &value)
gpr_timespec raw_deadline()
Definition: server_context.h:101
std::shared_ptr< const AuthContext > auth_context() const
Definition: completion_queue.h:66