GRPC C++  1.80.0
call.h
Go to the documentation of this file.
1 //
2 //
3 // Copyright 2015 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_CALL_H
20 #define GRPCPP_IMPL_CALL_H
21 
22 #include <grpc/impl/grpc_types.h>
23 
24 namespace grpc {
25 class CompletionQueue;
26 namespace experimental {
27 class ClientRpcInfo;
28 class ServerRpcInfo;
29 } // namespace experimental
30 namespace internal {
31 class CallOpSetInterface;
32 
34 class Call final {
35  public:
36  Call() : cq_(nullptr), call_(nullptr), max_receive_message_size_(-1) {}
39  : cq_(cq), call_(call), max_receive_message_size_(-1) {}
40 
43  : cq_(cq),
44  call_(call),
45  max_receive_message_size_(-1),
46  client_rpc_info_(rpc_info) {}
47 
50  : cq_(cq),
51  call_(call),
52  max_receive_message_size_(max_receive_message_size),
53  server_rpc_info_(rpc_info) {}
54 
55  grpc_call* call() const { return call_; }
56  grpc::CompletionQueue* cq() const { return cq_; }
57 
58  int max_receive_message_size() const { return max_receive_message_size_; }
59 
61  return client_rpc_info_;
62  }
63 
65  return server_rpc_info_;
66  }
67 
68  private:
70  grpc_call* call_;
71  int max_receive_message_size_;
72  experimental::ClientRpcInfo* client_rpc_info_ = nullptr;
73  experimental::ServerRpcInfo* server_rpc_info_ = nullptr;
74 };
75 } // namespace internal
76 } // namespace grpc
77 
78 #endif // GRPCPP_IMPL_CALL_H
grpc::internal::Call::cq
grpc::CompletionQueue * cq() const
Definition: call.h:56
grpc::internal::Call::max_receive_message_size
int max_receive_message_size() const
Definition: call.h:58
grpc
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm.h:33
grpc::internal::Call::Call
Call(grpc_call *call, grpc::CompletionQueue *cq)
call is owned by the caller
Definition: call.h:38
grpc::internal::Call
Straightforward wrapping of the C call object.
Definition: call.h:34
grpc_types.h
grpc::internal::Call::Call
Call()
Definition: call.h:36
grpc::experimental::ClientRpcInfo
Definition: client_interceptor.h:71
grpc::internal::Call::Call
Call(grpc_call *call, grpc::CompletionQueue *cq, experimental::ClientRpcInfo *rpc_info)
Definition: call.h:41
grpc_call
struct grpc_call grpc_call
A Call represents an RPC.
Definition: grpc_types.h:68
grpc::experimental::ServerRpcInfo
ServerRpcInfo represents the state of a particular RPC as it appears to an interceptor.
Definition: server_interceptor.h:58
grpc::internal::Call::server_rpc_info
experimental::ServerRpcInfo * server_rpc_info() const
Definition: call.h:64
grpc::internal::Call::call
grpc_call * call() const
Definition: call.h:55
grpc::CompletionQueue
A thin wrapper around grpc_completion_queue (see src/core/lib/surface/completion_queue....
Definition: completion_queue.h:104
grpc::internal::Call::Call
Call(grpc_call *call, grpc::CompletionQueue *cq, int max_receive_message_size, experimental::ServerRpcInfo *rpc_info)
Definition: call.h:48
grpc::internal::Call::client_rpc_info
experimental::ClientRpcInfo * client_rpc_info() const
Definition: call.h:60