19 #ifndef GRPCXX_IMPL_CODEGEN_SERVER_INTERFACE_H
20 #define GRPCXX_IMPL_CODEGEN_SERVER_INTERFACE_H
30 class AsyncGenericService;
32 class GenericServerContext;
33 class ServerCompletionQueue;
35 class ServerCredentials;
44 class ServerAsyncStreamingInterface;
79 virtual void Wait() = 0;
82 friend class ::grpc::Service;
128 bool delete_on_finalize);
164 IssueRequest(registered_method,
nullptr, notification_cq);
170 template <
class Message>
180 registered_method_(registered_method),
185 notification_cq_(notification_cq),
188 IssueRequest(registered_method, &payload_, notification_cq);
193 if (payload_ ==
nullptr ||
204 stream_, call_cq_, notification_cq_, tag_,
214 void*
const registered_method_;
231 bool delete_on_finalize);
239 template <
class Message>
248 stream, call_cq, notification_cq, tag,
259 call_cq, notification_cq, tag);
274 #endif // GRPCXX_IMPL_CODEGEN_SERVER_INTERFACE_H
struct grpc_call grpc_call
A Call represents an RPC.
Definition: grpc_types.h:71
virtual ~ServerInterface()
Definition: server_interface.h:49
Definition: server_interface.h:156
void RequestAsyncGenericCall(GenericServerContext *context, internal::ServerAsyncStreamingInterface *stream, CompletionQueue *call_cq, ServerCompletionQueue *notification_cq, void *tag)
Definition: server_interface.h:262
void Shutdown()
Shutdown the server, waiting for all rpc processing to finish.
Definition: server_interface.h:70
std::string string
Definition: config.h:35
RegisteredAsyncRequest(ServerInterface *server, ServerContext *context, internal::ServerAsyncStreamingInterface *stream, CompletionQueue *call_cq, void *tag)
virtual gpr_timespec gpr_inf_future(gpr_clock_type type)=0
virtual void Start(ServerCompletionQueue **cqs, size_t num_cqs)=0
Start the server.
An interface allowing implementors to process and filter event tags.
Definition: completion_queue_tag.h:26
#define GPR_CODEGEN_ASSERT(x)
Codegen specific version of GPR_ASSERT.
Definition: core_codegen_interface.h:135
Definition: server_interface.h:171
ServerInterface *const server_
Definition: server_interface.h:134
Desriptor of an RPC service and its various RPC methods.
Definition: service_type.h:58
virtual void ShutdownInternal(gpr_timespec deadline)=0
BaseAsyncRequest(ServerInterface *server, ServerContext *context, internal::ServerAsyncStreamingInterface *stream, CompletionQueue *call_cq, void *tag, bool delete_on_finalize)
Definition: server_interface.h:143
virtual void grpc_call_unref(grpc_call *call)=0
void RequestAsyncCall(internal::RpcServiceMethod *method, ServerContext *context, internal::ServerAsyncStreamingInterface *stream, CompletionQueue *call_cq, ServerCompletionQueue *notification_cq, void *tag, Message *message)
Definition: server_interface.h:240
Monotonic clock.
Definition: gpr_types.h:33
struct grpc_server grpc_server
A server listens to some port and responds to request calls.
Definition: grpc_types.h:66
Definition: service_type.h:39
Definition: grpc_types.h:443
Definition: grpc_types.h:41
virtual void PerformOpsOnCall(internal::CallOpSetInterface *ops, internal::Call *call)=0
Definition: async_generic_service.h:45
If you are trying to use CompletionQueue::AsyncNext with a time class that isn't either gpr_timespec ...
Definition: time.h:40
PayloadAsyncRequest(void *registered_method, ServerInterface *server, ServerContext *context, internal::ServerAsyncStreamingInterface *stream, CompletionQueue *call_cq, ServerCompletionQueue *notification_cq, void *tag, Message *request)
Definition: server_interface.h:173
virtual ~BaseAsyncRequest()
virtual int max_receive_message_size() const =0
Defines how to serialize and deserialize some type.
Definition: serialization_traits.h:58
GenericAsyncRequest(ServerInterface *server, GenericServerContext *context, internal::ServerAsyncStreamingInterface *stream, CompletionQueue *call_cq, ServerCompletionQueue *notification_cq, void *tag, bool delete_on_finalize)
bool FinalizeResult(void **tag, bool *status) override
Called prior to returning from Next(), return value is the status of the operation (return status is ...
virtual grpc_server * server()=0
Wrapper around grpc_server_credentials, a way to authenticate a server.
Definition: server_credentials.h:35
internal::ServerAsyncStreamingInterface *const stream_
Definition: server_interface.h:136
const bool delete_on_finalize_
Definition: server_interface.h:139
Server side rpc method class.
Definition: rpc_service_method.h:56
CoreCodegenInterface * g_core_codegen_interface
Definition: call.h:46
void RequestAsyncCall(internal::RpcServiceMethod *method, ServerContext *context, internal::ServerAsyncStreamingInterface *stream, CompletionQueue *call_cq, ServerCompletionQueue *notification_cq, void *tag)
Definition: server_interface.h:252
A ServerContext allows the person implementing a service handler to:
Definition: server_context.h:96
Definition: server_interface.h:47
grpc_call * call_
Definition: server_interface.h:140
CompletionQueue *const call_cq_
Definition: server_interface.h:137
virtual bool RegisterService(const grpc::string *host, Service *service)=0
Register a service.
Definition: async_generic_service.h:32
A thin wrapper around grpc_completion_queue (see src/core/lib/surface/completion_queue.h).
Definition: completion_queue.h:94
bool FinalizeResult(void **tag, bool *status) override
Called prior to returning from Next(), return value is the status of the operation (return status is ...
Definition: server_interface.h:191
void Shutdown(const T &deadline)
Shutdown the server, blocking until all rpc processing finishes.
Definition: server_interface.h:61
An abstract collection of call ops, used to generate the grpc_call_op structure to pass down to the l...
Definition: call.h:611
ServerContext *const context_
Definition: server_interface.h:135
bool FinalizeResult(void **tag, bool *status) override
Called prior to returning from Next(), return value is the status of the operation (return status is ...
virtual void RegisterAsyncGenericService(AsyncGenericService *service)=0
Register a generic service.
virtual int AddListeningPort(const grpc::string &addr, ServerCredentials *creds)=0
Tries to bind server to the given addr.
Internal errors.
Definition: status.h:127
Analogous to struct timespec.
Definition: gpr_types.h:47
Definition: server_interface.h:225
void *const tag_
Definition: server_interface.h:138
void IssueRequest(void *registered_method, grpc_byte_buffer **payload, ServerCompletionQueue *notification_cq)
NoPayloadAsyncRequest(void *registered_method, ServerInterface *server, ServerContext *context, internal::ServerAsyncStreamingInterface *stream, CompletionQueue *call_cq, ServerCompletionQueue *notification_cq, void *tag)
Definition: server_interface.h:158
virtual void Wait()=0
Block waiting for all work to complete.
A specific type of completion queue used by the processing of notifications by servers.
Definition: completion_queue.h:321
This is an interface that Channel and Server implement to allow them to hook performing ops...
Definition: call_hook.h:30
void * server_tag() const
Definition: rpc_service_method.h:64
Definition: server_interface.h:123
virtual grpc_call_error grpc_call_cancel_with_status(grpc_call *call, grpc_status_code status, const char *description, void *reserved)=0
Straightforward wrapping of the C call object.
Definition: call.h:683
::google::protobuf::Message Message
Definition: config_protobuf.h:72