Go to the documentation of this file.
19 #ifndef GRPCPP_IMPL_CODEGEN_SERVER_INTERCEPTOR_H
20 #define GRPCPP_IMPL_CODEGEN_SERVER_INTERCEPTOR_H
36 class InterceptorBatchMethodsImpl;
39 namespace experimental {
76 const char*
method()
const {
return method_; }
88 "violated expectation about Type enum");
91 "violated expectation about Type enum");
94 "violated expectation about Type enum");
97 "violated expectation about Type enum");
107 interceptors_[pos]->Intercept(interceptor_methods);
110 void RegisterInterceptors(
112 std::unique_ptr<experimental::ServerInterceptorFactoryInterface>>&
114 for (
const auto& creator : creators) {
115 auto* interceptor = creator->CreateServerInterceptor(
this);
116 if (interceptor !=
nullptr) {
117 interceptors_.push_back(
118 std::unique_ptr<experimental::Interceptor>(interceptor));
123 void Ref() { ref_.fetch_add(1, std::memory_order_relaxed); }
125 if (
GPR_UNLIKELY(ref_.fetch_sub(1, std::memory_order_acq_rel) == 1)) {
131 const char* method_ =
nullptr;
133 std::atomic<intptr_t> ref_{1};
134 std::vector<std::unique_ptr<experimental::Interceptor>> interceptors_;
143 #endif // GRPCPP_IMPL_CODEGEN_SERVER_INTERCEPTOR_H
grpc_impl::ServerContextBase * server_context()
Return a pointer to the underlying ServerContext structure associated with the RPC to support feature...
Definition: server_interceptor.h:83
This header provides an object that reads bytes directly from a grpc::ByteBuffer, via the ZeroCopyInp...
Definition: alarm.h:24
const char * method() const
Return the fully-specified method name.
Definition: server_interceptor.h:76
Base class of ServerContext. Experimental until callback API is final.
Definition: server_context_impl.h:123
~ServerRpcInfo()
Definition: server_interceptor.h:65
Definition: rpc_method.h:33
Definition: rpc_method.h:35
ServerRpcInfo & operator=(const ServerRpcInfo &)=delete
Definition: rpc_method.h:34
ServerRpcInfo(const ServerRpcInfo &)=delete
RpcType
Definition: rpc_method.h:31
Definition: rpc_method.h:32
ServerRpcInfo represents the state of a particular RPC as it appears to an interceptor.
Definition: server_interceptor.h:60
::grpc_impl::ServerContextBase ServerContextBase
Definition: server_context.h:36
Interface for an interceptor.
Definition: interceptor.h:217
Definition: server_interceptor.h:47
virtual Interceptor * CreateServerInterceptor(ServerRpcInfo *info)=0
virtual ~ServerInterceptorFactoryInterface()
Definition: server_interceptor.h:49
Class that is passed as an argument to the Intercept method of the application's Interceptor interfac...
Definition: interceptor.h:93
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm_impl.h:33
#define GPR_CODEGEN_ASSERT(x)
Codegen specific version of GPR_ASSERT.
Definition: core_codegen_interface.h:146
Type type() const
Return the type of the RPC (unary or a streaming flavor)
Definition: server_interceptor.h:79
Type
Type categorizes RPCs by unary or streaming type.
Definition: server_interceptor.h:63
Definition: interceptor_common.h:36