impl/codegen/interceptor.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2018 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef GRPCPP_IMPL_CODEGEN_INTERCEPTOR_H
20 #define GRPCPP_IMPL_CODEGEN_INTERCEPTOR_H
21 
22 // IWYU pragma: private, include <grpcpp/support/interceptor.h>
23 
24 #include <map>
25 #include <memory>
26 #include <string>
27 
34 
35 namespace grpc {
36 
37 class ChannelInterface;
38 class Status;
39 
40 namespace experimental {
41 
64  PRE_SEND_STATUS, // server only
65  PRE_SEND_CLOSE, // client only: WritesDone for stream; after write in unary
74  POST_RECV_STATUS, // client only
75  POST_RECV_CLOSE, // server only
84 };
85 
99  public:
113  virtual void Proceed() = 0;
119  virtual void Hijack() = 0;
120 
138 
142  virtual ByteBuffer* GetSerializedSendMessage() = 0;
143 
147  virtual const void* GetSendMessage() = 0;
148 
156  virtual void ModifySendMessage(const void* message) = 0;
157 
160  virtual bool GetSendMessageStatus() = 0;
161 
165  virtual std::multimap<std::string, std::string>* GetSendInitialMetadata() = 0;
166 
168  virtual Status GetSendStatus() = 0;
169 
172  virtual void ModifySendStatus(const Status& status) = 0;
173 
177  virtual std::multimap<std::string, std::string>*
179 
185  virtual void* GetRecvMessage() = 0;
186 
190  virtual std::multimap<grpc::string_ref, grpc::string_ref>*
192 
195  virtual Status* GetRecvStatus() = 0;
196 
199  virtual std::multimap<grpc::string_ref, grpc::string_ref>*
201 
207  virtual std::unique_ptr<ChannelInterface> GetInterceptedChannel() = 0;
208 
212  virtual void FailHijackedRecvMessage() = 0;
213 
216  virtual void FailHijackedSendMessage() = 0;
217 };
218 
221 class Interceptor {
222  public:
223  virtual ~Interceptor() {}
224 
227  virtual void Intercept(InterceptorBatchMethods* methods) = 0;
228 };
229 
230 } // namespace experimental
231 } // namespace grpc
232 
233 #endif // GRPCPP_IMPL_CODEGEN_INTERCEPTOR_H
grpc::status
auto status
Definition: cpp/client/credentials_test.cc:200
grpc::experimental::InterceptionHookPoints::POST_RECV_STATUS
@ POST_RECV_STATUS
grpc::experimental::InterceptionHookPoints::PRE_SEND_CLOSE
@ PRE_SEND_CLOSE
grpc::experimental::InterceptorBatchMethods::GetRecvMessage
virtual void * GetRecvMessage()=0
grpc::experimental::InterceptionHookPoints::PRE_SEND_INITIAL_METADATA
@ PRE_SEND_INITIAL_METADATA
The first three in this list are for clients and servers.
grpc
Definition: grpcpp/alarm.h:33
grpc::experimental::InterceptionHookPoints::POST_RECV_INITIAL_METADATA
@ POST_RECV_INITIAL_METADATA
The following two are for all clients and servers.
grpc::experimental::InterceptionHookPoints::POST_RECV_MESSAGE
@ POST_RECV_MESSAGE
grpc::experimental::InterceptionHookPoints::PRE_RECV_MESSAGE
@ PRE_RECV_MESSAGE
grpc::experimental::InterceptionHookPoints::PRE_RECV_STATUS
@ PRE_RECV_STATUS
grpc::experimental::InterceptorBatchMethods::GetRecvTrailingMetadata
virtual std::multimap< grpc::string_ref, grpc::string_ref > * GetRecvTrailingMetadata()=0
core_codegen_interface.h
grpc::experimental::InterceptorBatchMethods::QueryInterceptionHookPoint
virtual bool QueryInterceptionHookPoint(InterceptionHookPoints type)=0
message
char * message
Definition: libuv/docs/code/tty-gravity/main.c:12
grpc::experimental::Interceptor::~Interceptor
virtual ~Interceptor()
Definition: impl/codegen/interceptor.h:223
config.h
metadata_map.h
grpc::experimental::InterceptionHookPoints::PRE_SEND_STATUS
@ PRE_SEND_STATUS
grpc::experimental::InterceptionHookPoints::PRE_SEND_CANCEL
@ PRE_SEND_CANCEL
grpc_types.h
grpc::experimental::InterceptorBatchMethods::GetSendMessageStatus
virtual bool GetSendMessageStatus()=0
grpc::experimental::InterceptorBatchMethods::ModifySendMessage
virtual void ModifySendMessage(const void *message)=0
grpc::experimental::InterceptorBatchMethods::GetSendTrailingMetadata
virtual std::multimap< std::string, std::string > * GetSendTrailingMetadata()=0
grpc::experimental::InterceptorBatchMethods::GetSendStatus
virtual Status GetSendStatus()=0
Returns the status to be sent. Valid for PRE_SEND_STATUS interceptions.
grpc::ByteBuffer
A sequence of bytes.
Definition: include/grpcpp/impl/codegen/byte_buffer.h:61
byte_buffer.h
grpc::experimental::InterceptorBatchMethods::FailHijackedRecvMessage
virtual void FailHijackedRecvMessage()=0
grpc::experimental::InterceptorBatchMethods
Definition: impl/codegen/interceptor.h:98
grpc::experimental::InterceptorBatchMethods::Hijack
virtual void Hijack()=0
grpc::experimental::InterceptorBatchMethods::FailHijackedSendMessage
virtual void FailHijackedSendMessage()=0
grpc::experimental::InterceptorBatchMethods::GetRecvInitialMetadata
virtual std::multimap< grpc::string_ref, grpc::string_ref > * GetRecvInitialMetadata()=0
grpc::experimental::InterceptionHookPoints::NUM_INTERCEPTION_HOOKS
@ NUM_INTERCEPTION_HOOKS
grpc::experimental::InterceptionHookPoints::PRE_SEND_MESSAGE
@ PRE_SEND_MESSAGE
grpc::experimental::InterceptorBatchMethods::ModifySendStatus
virtual void ModifySendStatus(const Status &status)=0
grpc::experimental::InterceptorBatchMethods::GetSendInitialMetadata
virtual std::multimap< std::string, std::string > * GetSendInitialMetadata()=0
string_ref.h
grpc::experimental::InterceptorBatchMethods::GetSerializedSendMessage
virtual ByteBuffer * GetSerializedSendMessage()=0
grpc::experimental::InterceptionHookPoints::POST_SEND_MESSAGE
@ POST_SEND_MESSAGE
grpc::experimental::Interceptor
Definition: impl/codegen/interceptor.h:221
grpc::protobuf::util::Status
GRPC_CUSTOM_UTIL_STATUS Status
Definition: include/grpcpp/impl/codegen/config_protobuf.h:93
grpc::Status
Definition: include/grpcpp/impl/codegen/status.h:35
grpc::experimental::InterceptorBatchMethods::~InterceptorBatchMethods
virtual ~InterceptorBatchMethods()
Definition: impl/codegen/interceptor.h:100
grpc::experimental::InterceptionHookPoints::POST_RECV_CLOSE
@ POST_RECV_CLOSE
grpc::experimental::InterceptorBatchMethods::GetInterceptedChannel
virtual std::unique_ptr< ChannelInterface > GetInterceptedChannel()=0
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
grpc::experimental::InterceptorBatchMethods::GetSendMessage
virtual const void * GetSendMessage()=0
grpc::experimental::InterceptorBatchMethods::Proceed
virtual void Proceed()=0
grpc::experimental::InterceptionHookPoints
InterceptionHookPoints
Definition: impl/codegen/interceptor.h:59
grpc::experimental::InterceptorBatchMethods::GetRecvStatus
virtual Status * GetRecvStatus()=0
grpc::experimental::InterceptionHookPoints::PRE_RECV_INITIAL_METADATA
@ PRE_RECV_INITIAL_METADATA
grpc::experimental::Interceptor::Intercept
virtual void Intercept(InterceptorBatchMethods *methods)=0


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:00:21