Go to the documentation of this file.
19 #ifndef GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H
20 #define GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H
35 class InterceptorBatchMethodsImpl;
38 namespace experimental {
57 extern experimental::ClientInterceptorFactoryInterface*
65 namespace experimental {
88 const char*
method()
const {
return method_; }
103 "violated expectation about Type enum");
106 "violated expectation about Type enum");
109 "violated expectation about Type enum");
112 "violated expectation about Type enum");
127 ClientRpcInfo& operator=(ClientRpcInfo&&) =
default;
133 interceptors_[pos]->Intercept(interceptor_methods);
136 void RegisterInterceptors(
137 const std::vector<std::unique_ptr<
138 experimental::ClientInterceptorFactoryInterface>>& creators,
139 size_t interceptor_pos) {
140 if (interceptor_pos > creators.size()) {
146 for (
auto it = creators.begin() + interceptor_pos; it != creators.end();
148 auto* interceptor = (*it)->CreateClientInterceptor(
this);
149 if (interceptor !=
nullptr) {
150 interceptors_.push_back(
151 std::unique_ptr<experimental::Interceptor>(interceptor));
155 interceptors_.push_back(std::unique_ptr<experimental::Interceptor>(
157 ->CreateClientInterceptor(
this)));
164 const char* method_ =
nullptr;
166 std::vector<std::unique_ptr<experimental::Interceptor>> interceptors_;
167 bool hijacked_ =
false;
168 size_t hijacked_interceptor_ = 0;
190 #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:98
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm.h:33
const char * method() const
Return the fully-specified method name.
Definition: client_interceptor.h:88
Type
Type categorizes RPCs by unary or streaming type.
Definition: client_interceptor.h:71
@ CLIENT_STREAMING
Definition: rpc_method.h:33
Definition: client_interceptor.h:66
experimental::ClientInterceptorFactoryInterface * g_global_client_interceptor_factory
@ BIDI_STREAMING
Definition: rpc_method.h:35
virtual ~ClientInterceptorFactoryInterface()
Definition: client_interceptor.h:48
A ClientContext allows the person implementing a service client to:
Definition: client_context.h:192
void RegisterGlobalClientInterceptorFactory(ClientInterceptorFactoryInterface *factory)
~ClientRpcInfo()
Definition: client_interceptor.h:79
grpc::ClientContext * client_context()
Return a pointer to the underlying ClientContext structure associated with the RPC to support feature...
Definition: client_interceptor.h:95
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:91
@ 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:216
Definition: client_interceptor.h:46
Class that is passed as an argument to the Intercept method of the application's Interceptor interfac...
Definition: interceptor.h:93
#define GPR_CODEGEN_ASSERT(x)
Codegen specific version of GPR_ASSERT.
Definition: core_codegen_interface.h:146
Definition: interceptor_common.h:36
void TestOnlyResetGlobalClientInterceptorFactory()