19 #ifndef GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H 20 #define GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H 39 class InterceptorBatchMethodsImpl;
42 namespace experimental {
69 namespace experimental {
92 const char*
method()
const {
return method_; }
105 static_assert(Type::UNARY ==
106 static_cast<Type>(internal::RpcMethod::NORMAL_RPC),
107 "violated expectation about Type enum");
108 static_assert(Type::CLIENT_STREAMING ==
109 static_cast<Type>(internal::RpcMethod::CLIENT_STREAMING),
110 "violated expectation about Type enum");
111 static_assert(Type::SERVER_STREAMING ==
112 static_cast<Type>(internal::RpcMethod::SERVER_STREAMING),
113 "violated expectation about Type enum");
114 static_assert(Type::BIDI_STREAMING ==
115 static_cast<Type>(internal::RpcMethod::BIDI_STREAMING),
116 "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 #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:83
void RegisterGlobalClientInterceptorFactory(ClientInterceptorFactoryInterface *factory)
ChannelInterface * channel()
Return a pointer to the channel on which the RPC is being sent.
Definition: client_interceptor.h:95
virtual ~ClientInterceptorFactoryInterface()
Definition: client_interceptor.h:52
RpcType
Definition: rpc_method.h:31
A ClientContext allows the person implementing a service client to:
Definition: client_context.h:179
Definition: client_interceptor.h:50
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() const
Return the type of the RPC (unary or a streaming flavor)
Definition: client_interceptor.h:102
::grpc_impl::Channel Channel
Definition: channel.h:26
const char * method() const
Return the fully-specified method name.
Definition: client_interceptor.h:92
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:213
Codegen interface for grpc::Channel.
Definition: channel_interface.h:69
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
Unknown error.
Definition: status_code_enum.h:35
Type
Type categorizes RPCs by unary or streaming type.
Definition: client_interceptor.h:75
Definition: client_interceptor.h:70