19 #ifndef GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H 20 #define GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H 38 class InterceptorBatchMethodsImpl;
41 namespace experimental {
68 namespace experimental {
91 const char*
method()
const {
return method_; }
104 static_assert(Type::UNARY ==
105 static_cast<Type>(internal::RpcMethod::NORMAL_RPC),
106 "violated expectation about Type enum");
107 static_assert(Type::CLIENT_STREAMING ==
108 static_cast<Type>(internal::RpcMethod::CLIENT_STREAMING),
109 "violated expectation about Type enum");
110 static_assert(Type::SERVER_STREAMING ==
111 static_cast<Type>(internal::RpcMethod::SERVER_STREAMING),
112 "violated expectation about Type enum");
113 static_assert(Type::BIDI_STREAMING ==
114 static_cast<Type>(internal::RpcMethod::BIDI_STREAMING),
115 "violated expectation about Type enum");
125 type_(static_cast<Type>(type)),
137 interceptors_[pos]->Intercept(interceptor_methods);
140 void RegisterInterceptors(
141 const std::vector<std::unique_ptr<
143 size_t interceptor_pos) {
144 if (interceptor_pos > creators.size()) {
148 for (
auto it = creators.begin() + interceptor_pos; it != creators.end();
150 auto* interceptor = (*it)->CreateClientInterceptor(
this);
151 if (interceptor !=
nullptr) {
152 interceptors_.push_back(
153 std::unique_ptr<experimental::Interceptor>(interceptor));
157 interceptors_.push_back(std::unique_ptr<experimental::Interceptor>(
159 ->CreateClientInterceptor(
this)));
166 const char* method_ =
nullptr;
168 std::vector<std::unique_ptr<experimental::Interceptor>> interceptors_;
169 bool hijacked_ =
false;
170 size_t hijacked_interceptor_ = 0;
192 #endif // GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H ::grpc_impl::ClientContext ClientContext
Definition: client_context.h:26
#define GPR_CODEGEN_ASSERT(x)
Codegen specific version of GPR_ASSERT.
Definition: core_codegen_interface.h:145
Class that is passed as an argument to the Intercept method of the application's Interceptor interfac...
Definition: interceptor.h:91
~ClientRpcInfo()
Definition: client_interceptor.h:82
void RegisterGlobalClientInterceptorFactory(ClientInterceptorFactoryInterface *factory)
ChannelInterface * channel()
Return a pointer to the channel on which the RPC is being sent.
Definition: client_interceptor.h:94
virtual ~ClientInterceptorFactoryInterface()
Definition: client_interceptor.h:51
RpcType
Definition: rpc_method.h:31
Definition: client_interceptor.h:49
Type type() const
Return the type of the RPC (unary or a streaming flavor)
Definition: client_interceptor.h:101
::grpc_impl::Channel Channel
Definition: channel.h:26
const char * method() const
Return the fully-specified method name.
Definition: client_interceptor.h:91
This header provides an object that reads bytes directly from a grpc::ByteBuffer, via the ZeroCopyInp...
Definition: alarm.h:24
Interface for an interceptor.
Definition: interceptor.h:215
Codegen interface for grpc::Channel.
Definition: channel_interface.h:70
Definition: interceptor_common.h:36
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm_impl.h:33
void TestOnlyResetGlobalClientInterceptorFactory()
experimental::ClientInterceptorFactoryInterface * g_global_client_interceptor_factory
A ClientContext allows the person implementing a service client to:
Definition: client_context_impl.h:180
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
Unknown error.
Definition: status_code_enum.h:35
Type
Type categorizes RPCs by unary or streaming type.
Definition: client_interceptor.h:74
Definition: client_interceptor.h:69