Go to the documentation of this file.
19 #ifndef GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H
20 #define GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H
36 class InterceptorBatchMethodsImpl;
39 namespace experimental {
58 extern experimental::ClientInterceptorFactoryInterface*
61 extern experimental::ClientInterceptorFactoryInterface*
69 namespace experimental {
92 const char*
method()
const {
return method_; }
111 "violated expectation about Type enum");
114 "violated expectation about Type enum");
117 "violated expectation about Type enum");
120 "violated expectation about Type enum");
137 ClientRpcInfo& operator=(ClientRpcInfo&&) =
default;
143 interceptors_[pos]->Intercept(interceptor_methods);
146 void RegisterInterceptors(
147 const std::vector<std::unique_ptr<
148 experimental::ClientInterceptorFactoryInterface>>& creators,
149 size_t interceptor_pos) {
152 size_t num_interceptors =
156 if (interceptor_pos > num_interceptors) {
161 interceptors_.push_back(std::unique_ptr<experimental::Interceptor>(
163 ->CreateClientInterceptor(
this)));
168 for (
auto it = creators.begin() + interceptor_pos; it != creators.end();
170 auto* interceptor = (*it)->CreateClientInterceptor(
this);
171 if (interceptor !=
nullptr) {
172 interceptors_.push_back(
173 std::unique_ptr<experimental::Interceptor>(interceptor));
177 interceptors_.push_back(std::unique_ptr<experimental::Interceptor>(
179 ->CreateClientInterceptor(
this)));
186 const char* method_ =
nullptr;
187 const char* suffix_for_stats_ =
nullptr;
189 std::vector<std::unique_ptr<experimental::Interceptor>> interceptors_;
190 bool hijacked_ =
false;
191 size_t hijacked_interceptor_ = 0;
213 #endif // GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H
Type type() const
Return the type of the RPC (unary or a streaming flavor)
Definition: client_interceptor.h:106
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm.h:33
experimental::ClientInterceptorFactoryInterface * g_global_client_stats_interceptor_factory
const char * method() const
Return the fully-specified method name.
Definition: client_interceptor.h:92
#define GPR_ASSERT(x)
abort() the process if x is zero, having written a line to the log.
Definition: log.h:95
Type
Type categorizes RPCs by unary or streaming type.
Definition: client_interceptor.h:75
@ CLIENT_STREAMING
Definition: rpc_method.h:33
const char * suffix_for_stats() const
Return an identifying suffix for the client stub, or nullptr if one wasn't specified.
Definition: client_interceptor.h:96
Definition: client_interceptor.h:70
experimental::ClientInterceptorFactoryInterface * g_global_client_interceptor_factory
@ BIDI_STREAMING
Definition: rpc_method.h:35
virtual ~ClientInterceptorFactoryInterface()
Definition: client_interceptor.h:49
A ClientContext allows the person implementing a service client to:
Definition: client_context.h:193
void RegisterGlobalClientInterceptorFactory(ClientInterceptorFactoryInterface *factory)
~ClientRpcInfo()
Definition: client_interceptor.h:83
grpc::ClientContext * client_context()
Return a pointer to the underlying ClientContext structure associated with the RPC to support feature...
Definition: client_interceptor.h:103
Codegen interface for grpc::Channel.
Definition: channel_interface.h:71
ChannelInterface * channel()
Return a pointer to the channel on which the RPC is being sent.
Definition: client_interceptor.h:99
@ SERVER_STREAMING
Definition: rpc_method.h:34
virtual Interceptor * CreateClientInterceptor(ClientRpcInfo *info)=0
RpcType
Definition: rpc_method.h:31
@ NORMAL_RPC
Definition: rpc_method.h:32
Interface for an interceptor.
Definition: interceptor.h:218
Definition: client_interceptor.h:47
Class that is passed as an argument to the Intercept method of the application's Interceptor interfac...
Definition: interceptor.h:95
Definition: interceptor_common.h:36
void TestOnlyResetGlobalClientInterceptorFactory()