Go to the documentation of this file.
19 #ifndef GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H
20 #define GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H
38 class InterceptorBatchMethodsImpl;
41 namespace experimental {
60 extern experimental::ClientInterceptorFactoryInterface*
68 namespace experimental {
91 const char*
method()
const {
return method_; }
106 "violated expectation about Type enum");
109 "violated expectation about Type enum");
112 "violated expectation about Type enum");
115 "violated expectation about Type enum");
131 ClientRpcInfo& operator=(ClientRpcInfo&&) =
default;
137 interceptors_[pos]->Intercept(interceptor_methods);
140 void RegisterInterceptors(
141 const std::vector<std::unique_ptr<
142 experimental::ClientInterceptorFactoryInterface>>& creators,
143 size_t interceptor_pos) {
144 if (interceptor_pos > creators.size()) {
150 for (
auto it = creators.begin() + interceptor_pos; it != creators.end();
152 auto* interceptor = (*it)->CreateClientInterceptor(
this);
153 if (interceptor !=
nullptr) {
154 interceptors_.push_back(
155 std::unique_ptr<experimental::Interceptor>(interceptor));
159 interceptors_.push_back(std::unique_ptr<experimental::Interceptor>(
161 ->CreateClientInterceptor(
this)));
168 const char* method_ =
nullptr;
170 std::vector<std::unique_ptr<experimental::Interceptor>> interceptors_;
171 bool hijacked_ =
false;
172 size_t hijacked_interceptor_ = 0;
194 #endif // GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H
Type type() const
Return the type of the RPC (unary or a streaming flavor)
Definition: client_interceptor.h:101
This header provides an object that reads bytes directly from a grpc::ByteBuffer, via the ZeroCopyInp...
Definition: alarm.h:24
grpc_impl::ClientContext * client_context()
Return a pointer to the underlying ClientContext structure associated with the RPC to support feature...
Definition: client_interceptor.h:98
const char * method() const
Return the fully-specified method name.
Definition: client_interceptor.h:91
Type
Type categorizes RPCs by unary or streaming type.
Definition: client_interceptor.h:74
Definition: rpc_method.h:33
Definition: client_interceptor.h:69
experimental::ClientInterceptorFactoryInterface * g_global_client_interceptor_factory
Definition: rpc_method.h:35
virtual ~ClientInterceptorFactoryInterface()
Definition: client_interceptor.h:51
void RegisterGlobalClientInterceptorFactory(ClientInterceptorFactoryInterface *factory)
~ClientRpcInfo()
Definition: client_interceptor.h:82
Codegen interface for grpc::Channel.
Definition: channel_interface.h:74
ChannelInterface * channel()
Return a pointer to the channel on which the RPC is being sent.
Definition: client_interceptor.h:94
Definition: rpc_method.h:34
virtual Interceptor * CreateClientInterceptor(ClientRpcInfo *info)=0
RpcType
Definition: rpc_method.h:31
Definition: rpc_method.h:32
Interface for an interceptor.
Definition: interceptor.h:217
Definition: client_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
A ClientContext allows the person implementing a service client to:
Definition: client_context_impl.h:184
::grpc_impl::ClientContext ClientContext
Definition: client_context.h:26
Definition: interceptor_common.h:36
::grpc_impl::Channel Channel
Definition: channel.h:26
void TestOnlyResetGlobalClientInterceptorFactory()