34 #ifndef GRPCXX_SERVER_CONTEXT_H
35 #define GRPCXX_SERVER_CONTEXT_H
40 #include <grpc/compression.h>
41 #include <grpc/support/time.h>
50 struct census_context;
55 template <
class W,
class R>
61 template <
class R,
class W>
67 template <
class R,
class W>
69 template <
class ServiceType,
class RequestType,
class ResponseType>
71 template <
class ServiceType,
class RequestType,
class ResponseType>
73 template <
class ServiceType,
class RequestType,
class ResponseType>
75 template <
class ServiceType,
class RequestType,
class ResponseType>
85 class InteropServerContextInspector;
94 #ifndef GRPC_CXX0X_NO_CHRONO
95 std::chrono::system_clock::time_point
deadline() {
98 #endif // !GRPC_CXX0X_NO_CHRONO
108 return client_metadata_;
112 return compression_level_;
117 return compression_algorithm_;
121 std::shared_ptr<const AuthContext>
auth_context()
const;
135 has_notify_when_done_tag_ =
true;
136 async_notify_when_done_tag_ = tag;
140 friend class ::grpc::testing::InteropServerContextInspector;
141 friend class ::grpc::Server;
142 template <
class W,
class R>
143 friend class ::grpc::ServerAsyncReader;
145 friend class ::grpc::ServerAsyncWriter;
147 friend class ::grpc::ServerAsyncResponseWriter;
148 template <
class R,
class W>
149 friend class ::grpc::ServerAsyncReaderWriter;
151 friend class ::grpc::ServerReader;
153 friend class ::grpc::ServerWriter;
154 template <
class R,
class W>
155 friend class ::grpc::ServerReaderWriter;
156 template <
class ServiceType,
class RequestType,
class ResponseType>
158 template <
class ServiceType,
class RequestType,
class ResponseType>
160 template <
class ServiceType,
class RequestType,
class ResponseType>
162 template <
class ServiceType,
class RequestType,
class ResponseType>
165 friend class ::grpc::ClientContext;
173 void BeginCompletionOp(
Call* call);
176 size_t metadata_count);
178 void set_call(grpc_call* call);
180 CompletionOp* completion_op_;
181 bool has_notify_when_done_tag_;
182 void* async_notify_when_done_tag_;
184 gpr_timespec deadline_;
187 bool sent_initial_metadata_;
188 mutable std::shared_ptr<const AuthContext> auth_context_;
189 std::multimap<grpc::string_ref, grpc::string_ref> client_metadata_;
190 std::multimap<grpc::string, grpc::string> initial_metadata_;
191 std::multimap<grpc::string, grpc::string> trailing_metadata_;
193 grpc_compression_level compression_level_;
194 grpc_compression_algorithm compression_algorithm_;
199 #endif // GRPCXX_SERVER_CONTEXT_H
const std::multimap< grpc::string_ref, grpc::string_ref > & client_metadata()
Definition: server_context.h:107
grpc_compression_algorithm compression_algorithm() const
Definition: server_context.h:116
std::chrono::system_clock::time_point deadline()
Definition: server_context.h:95
void set_compression_algorithm(grpc_compression_algorithm algorithm)
grpc_compression_level compression_level() const
Definition: server_context.h:111
std::string string
Definition: config.h:112
Server-side interface for asynchronous bi-directional streaming.
Definition: server_context.h:62
void set_compression_level(grpc_compression_level level)
void AsyncNotifyWhenDone(void *tag)
Definition: server_context.h:134
void AddInitialMetadata(const grpc::string &key, const grpc::string &value)
Definition: completion_queue.h:55
Definition: server_context.h:58
Definition: rpc_service_method.h:212
const struct census_context * census_context() const
Models a gRPC server.
Definition: server.h:63
Definition: completion_queue.h:61
Definition: server_context.h:89
grpc::string peer() const
Definition: completion_queue.h:57
A thin wrapper around grpc_completion_queue (see / src/core/surface/completion_queue.h).
Definition: completion_queue.h:81
Definition: completion_queue.h:63
Server-side interface for bi-directional streaming.
Definition: completion_queue.h:59
Definition: completion_queue.h:65
Definition: server_context.h:60
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:100
std::shared_ptr< const AuthContext > auth_context() const
Definition: server_context.h:56
Definition: completion_queue.h:67