GRPC C++  1.30.0
call.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 #ifndef GRPCPP_IMPL_CODEGEN_CALL_H
19 #define GRPCPP_IMPL_CODEGEN_CALL_H
20 
23 
24 namespace grpc_impl {
25 class CompletionQueue;
26 }
27 
28 namespace grpc {
29 namespace experimental {
30 class ClientRpcInfo;
31 class ServerRpcInfo;
32 } // namespace experimental
33 namespace internal {
34 class CallHook;
35 class CallOpSetInterface;
36 
38 class Call final {
39  public:
40  Call()
41  : call_hook_(nullptr),
42  cq_(nullptr),
43  call_(nullptr),
44  max_receive_message_size_(-1) {}
47  : call_hook_(call_hook),
48  cq_(cq),
49  call_(call),
50  max_receive_message_size_(-1) {}
51 
54  : call_hook_(call_hook),
55  cq_(cq),
56  call_(call),
57  max_receive_message_size_(-1),
58  client_rpc_info_(rpc_info) {}
59 
62  : call_hook_(call_hook),
63  cq_(cq),
64  call_(call),
65  max_receive_message_size_(max_receive_message_size),
66  server_rpc_info_(rpc_info) {}
67 
69  call_hook_->PerformOpsOnCall(ops, this);
70  }
71 
72  grpc_call* call() const { return call_; }
73  ::grpc_impl::CompletionQueue* cq() const { return cq_; }
74 
75  int max_receive_message_size() const { return max_receive_message_size_; }
76 
78  return client_rpc_info_;
79  }
80 
82  return server_rpc_info_;
83  }
84 
85  private:
86  CallHook* call_hook_;
88  grpc_call* call_;
89  int max_receive_message_size_;
90  experimental::ClientRpcInfo* client_rpc_info_ = nullptr;
91  experimental::ServerRpcInfo* server_rpc_info_ = nullptr;
92 };
93 } // namespace internal
94 } // namespace grpc
95 
96 #endif // GRPCPP_IMPL_CODEGEN_CALL_H
grpc::internal::Call::max_receive_message_size
int max_receive_message_size() const
Definition: call.h:75
grpc
This header provides an object that reads bytes directly from a grpc::ByteBuffer, via the ZeroCopyInp...
Definition: alarm.h:24
grpc::internal::CallHook
This is an interface that Channel and Server implement to allow them to hook performing ops.
Definition: call_hook.h:30
grpc::CompletionQueue
::grpc_impl::CompletionQueue CompletionQueue
Definition: completion_queue.h:26
grpc::internal::Call
Straightforward wrapping of the C call object.
Definition: call.h:38
grpc::internal::Call::Call
Call(grpc_call *call, CallHook *call_hook, ::grpc_impl::CompletionQueue *cq)
call is owned by the caller
Definition: call.h:46
grpc_types.h
grpc::internal::Call::Call
Call()
Definition: call.h:40
grpc::experimental::ClientRpcInfo
Definition: client_interceptor.h:69
grpc_call
struct grpc_call grpc_call
A Call represents an RPC.
Definition: grpc_types.h:70
grpc::internal::CallOpSetInterface
An abstract collection of call ops, used to generate the grpc_call_op structure to pass down to the l...
Definition: call_op_set_interface.h:34
grpc::experimental::ServerRpcInfo
ServerRpcInfo represents the state of a particular RPC as it appears to an interceptor.
Definition: server_interceptor.h:60
grpc::internal::Call::server_rpc_info
experimental::ServerRpcInfo * server_rpc_info() const
Definition: call.h:81
grpc::internal::CallHook::PerformOpsOnCall
virtual void PerformOpsOnCall(CallOpSetInterface *ops, Call *call)=0
grpc_impl::CompletionQueue
A thin wrapper around grpc_completion_queue (see src/core/lib/surface/completion_queue....
Definition: completion_queue_impl.h:103
grpc::internal::Call::Call
Call(grpc_call *call, CallHook *call_hook, ::grpc_impl::CompletionQueue *cq, int max_receive_message_size, experimental::ServerRpcInfo *rpc_info)
Definition: call.h:60
grpc::internal::Call::PerformOps
void PerformOps(CallOpSetInterface *ops)
Definition: call.h:68
grpc::internal::Call::call
grpc_call * call() const
Definition: call.h:72
call_hook.h
grpc_impl
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm_impl.h:33
grpc::internal::Call::cq
::grpc_impl::CompletionQueue * cq() const
Definition: call.h:73
grpc::internal::Call::Call
Call(grpc_call *call, CallHook *call_hook, ::grpc_impl::CompletionQueue *cq, experimental::ClientRpcInfo *rpc_info)
Definition: call.h:52
grpc::internal::Call::client_rpc_info
experimental::ClientRpcInfo * client_rpc_info() const
Definition: call.h:77