19 #ifndef GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H
20 #define GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H
35 class InterceptorBatchMethodsImpl;
38 namespace experimental {
65 namespace experimental {
88 const char*
method()
const {
return method_; }
107 "violated expectation about Type enum");
110 "violated expectation about Type enum");
113 "violated expectation about Type enum");
116 "violated expectation about Type enum");
133 ClientRpcInfo& operator=(ClientRpcInfo&&) =
default;
139 interceptors_[pos]->Intercept(interceptor_methods);
142 void RegisterInterceptors(
143 const std::vector<std::unique_ptr<
144 experimental::ClientInterceptorFactoryInterface>>& creators,
145 size_t interceptor_pos) {
146 if (interceptor_pos > creators.size()) {
152 for (
auto it = creators.begin() + interceptor_pos; it != creators.end();
154 auto* interceptor = (*it)->CreateClientInterceptor(
this);
155 if (interceptor !=
nullptr) {
156 interceptors_.push_back(
157 std::unique_ptr<experimental::Interceptor>(interceptor));
161 interceptors_.push_back(std::unique_ptr<experimental::Interceptor>(
163 ->CreateClientInterceptor(
this)));
170 const char* method_ =
nullptr;
171 const char* suffix_for_stats_ =
nullptr;
173 std::vector<std::unique_ptr<experimental::Interceptor>> interceptors_;
174 bool hijacked_ =
false;
175 size_t hijacked_interceptor_ = 0;
Codegen interface for grpc::Channel.
Definition: channel_interface.h:71
A ClientContext allows the person implementing a service client to:
Definition: client_context.h:193
Definition: client_interceptor.h:46
virtual Interceptor * CreateClientInterceptor(ClientRpcInfo *info)=0
virtual ~ClientInterceptorFactoryInterface()
Definition: client_interceptor.h:48
Definition: client_interceptor.h:66
ClientRpcInfo(const ClientRpcInfo &)=delete
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:92
ClientRpcInfo(ClientRpcInfo &&)=default
Type type() const
Return the type of the RPC (unary or a streaming flavor)
Definition: client_interceptor.h:102
ChannelInterface * channel()
Return a pointer to the channel on which the RPC is being sent.
Definition: client_interceptor.h:95
const char * method() const
Return the fully-specified method name.
Definition: client_interceptor.h:88
~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:99
Type
Type categorizes RPCs by unary or streaming type.
Definition: client_interceptor.h:71
Class that is passed as an argument to the Intercept method of the application's Interceptor interfac...
Definition: interceptor.h:93
Interface for an interceptor.
Definition: interceptor.h:216
Definition: interceptor_common.h:37
RpcType
Definition: rpc_method.h:31
@ SERVER_STREAMING
Definition: rpc_method.h:34
@ CLIENT_STREAMING
Definition: rpc_method.h:33
@ NORMAL_RPC
Definition: rpc_method.h:32
@ BIDI_STREAMING
Definition: rpc_method.h:35
#define GPR_CODEGEN_ASSERT(x)
Codegen specific version of GPR_ASSERT.
Definition: core_codegen_interface.h:146
void TestOnlyResetGlobalClientInterceptorFactory()
void RegisterGlobalClientInterceptorFactory(ClientInterceptorFactoryInterface *factory)
experimental::ClientInterceptorFactoryInterface * g_global_client_interceptor_factory
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm.h:33