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_; }
101 static_assert(Type::UNARY ==
103 "violated expectation about Type enum");
104 static_assert(Type::CLIENT_STREAMING ==
106 "violated expectation about Type enum");
107 static_assert(Type::SERVER_STREAMING ==
109 "violated expectation about Type enum");
110 static_assert(Type::BIDI_STREAMING ==
112 "violated expectation about Type enum");
121 type_(static_cast<Type>(type)),
133 interceptors_[pos]->Intercept(interceptor_methods);
136 void RegisterInterceptors(
137 const std::vector<std::unique_ptr<
139 size_t interceptor_pos) {
140 if (interceptor_pos > creators.size()) {
144 for (
auto it = creators.begin() + interceptor_pos; it != creators.end();
146 auto* interceptor = (*it)->CreateClientInterceptor(
this);
147 if (interceptor !=
nullptr) {
148 interceptors_.push_back(
149 std::unique_ptr<experimental::Interceptor>(interceptor));
153 interceptors_.push_back(std::unique_ptr<experimental::Interceptor>(
155 ->CreateClientInterceptor(
this)));
162 const char* method_ =
nullptr;
164 std::vector<std::unique_ptr<experimental::Interceptor>> interceptors_;
165 bool hijacked_ =
false;
166 size_t hijacked_interceptor_ = 0;
189 #endif // GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H #define GPR_CODEGEN_ASSERT(x)
Codegen specific version of GPR_ASSERT.
Definition: core_codegen_interface.h:141
Definition: rpc_method.h:32
Class that is passed as an argument to the Intercept method of the application's Interceptor interfac...
Definition: interceptor.h:87
~ClientRpcInfo()
Definition: client_interceptor.h:79
void RegisterGlobalClientInterceptorFactory(ClientInterceptorFactoryInterface *factory)
Definition: rpc_method.h:34
ChannelInterface * channel()
Return a pointer to the channel on which the RPC is being sent.
Definition: client_interceptor.h:91
virtual ~ClientInterceptorFactoryInterface()
Definition: client_interceptor.h:48
RpcType
Definition: rpc_method.h:31
A ClientContext allows the person implementing a service client to:
Definition: client_context.h:174
Definition: client_interceptor.h:46
grpc::ClientContext * client_context()
Return a pointer to the underlying ClientContext structure associated with the RPC to support feature...
Definition: client_interceptor.h:95
Type type() const
Return the type of the RPC (unary or a streaming flavor)
Definition: client_interceptor.h:98
const char * method() const
Return the fully-specified method name.
Definition: client_interceptor.h:88
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:190
Codegen interface for grpc::Channel.
Definition: channel_interface.h:65
Definition: interceptor_common.h:36
experimental::ClientInterceptorFactoryInterface * g_global_client_interceptor_factory
Definition: rpc_method.h:33
Definition: rpc_method.h:35
Unknown error.
Definition: status_code_enum.h:35
Type
Type categorizes RPCs by unary or streaming type.
Definition: client_interceptor.h:71
Definition: client_interceptor.h:66