Go to the documentation of this file.
19 #ifndef GRPCPP_IMPL_CODEGEN_SERVER_INTERFACE_H
20 #define GRPCPP_IMPL_CODEGEN_SERVER_INTERFACE_H
43 class AsyncGenericService;
44 class GenericServerContext;
53 class ServerAsyncStreamingInterface;
56 #ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
57 namespace experimental {
59 class CallbackGenericService;
60 #ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
64 namespace experimental {
65 class ServerInterceptorFactoryInterface;
123 virtual void Wait() = 0;
126 friend class ::grpc::Service;
136 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
141 virtual void RegisterCallbackGenericService(CallbackGenericService*
144 class experimental_registration_interface {
203 void* tag,
bool delete_on_finalize);
209 void ContinueFinalizeResultAfterInterception();
233 void* tag,
const char* name,
244 *
server_->interceptor_creators()));
265 server, context, stream, call_cq, notification_cq, tag,
266 registered_method->name(), registered_method->method_type()) {
273 template <
class Message>
284 server, context, stream, call_cq, notification_cq, tag,
285 registered_method->name(), registered_method->method_type()),
286 registered_method_(registered_method),
303 payload_.bbuf_ptr(), request_)
338 void* tag,
bool delete_on_finalize);
346 template <
class Message>
355 notification_cq, tag, message);
366 notification_cq, tag);
385 std::unique_ptr<experimental::ServerInterceptorFactoryInterface>>*
386 interceptor_creators() {
403 #endif // GRPCPP_IMPL_CODEGEN_SERVER_INTERFACE_H
Definition: server_interface.h:196
RegisteredAsyncRequest is not part of the C++ API.
Definition: server_interface.h:226
Definition: service_type.h:41
bool done_intercepting_
Definition: server_interface.h:222
Internal errors.
Definition: status.h:127
RegisteredAsyncRequest(ServerInterface *server, ::grpc_impl::ServerContext *context, internal::ServerAsyncStreamingInterface *stream, ::grpc_impl::CompletionQueue *call_cq, ::grpc_impl::ServerCompletionQueue *notification_cq, void *tag, const char *name, internal::RpcMethod::RpcType type)
This header provides an object that reads bytes directly from a grpc::ByteBuffer, via the ZeroCopyInp...
Definition: alarm.h:24
virtual experimental_registration_interface * experimental_registration()
NOTE: The function experimental_registration() is not stable public API.
Definition: server_interface.h:159
::grpc_impl::ServerCredentials ServerCredentials
Definition: server_credentials.h:30
void Shutdown()
Shutdown the server without a deadline and forced cancellation.
Definition: server_interface.h:114
This is an interface that Channel and Server implement to allow them to hook performing ops.
Definition: call_hook.h:30
Definition: grpc_types.h:552
::grpc_impl::CompletionQueue CompletionQueue
Definition: completion_queue.h:26
const char * name_
Definition: server_interface.h:251
PayloadAsyncRequest(internal::RpcServiceMethod *registered_method, ServerInterface *server, ::grpc_impl::ServerContext *context, internal::ServerAsyncStreamingInterface *stream, ::grpc_impl::CompletionQueue *call_cq, ::grpc_impl::ServerCompletionQueue *notification_cq, void *tag, Message *request)
Definition: server_interface.h:276
Straightforward wrapping of the C call object.
Definition: call.h:38
::grpc_impl::ServerCompletionQueue *const notification_cq_
Definition: server_interface.h:216
Definition: server_interface.h:274
virtual void ShutdownInternal(gpr_timespec deadline)=0
Desriptor of an RPC service and its various RPC methods.
Definition: service_type.h:60
::grpc_impl::CompletionQueue *const call_cq_
Definition: server_interface.h:215
BaseAsyncRequest(ServerInterface *server, ::grpc_impl::ServerContext *context, internal::ServerAsyncStreamingInterface *stream, ::grpc_impl::CompletionQueue *call_cq, ::grpc_impl::ServerCompletionQueue *notification_cq, void *tag, bool delete_on_finalize)
virtual grpc_call_error grpc_call_cancel_with_status(grpc_call *call, grpc_status_code status, const char *description, void *reserved)=0
A specific type of completion queue used by the processing of notifications by servers.
Definition: completion_queue_impl.h:424
void *const tag_
Definition: server_interface.h:217
virtual gpr_timespec gpr_inf_future(gpr_clock_type type)=0
A ServerContext or CallbackServerContext allows the code implementing a service handler to:
Definition: server_context_impl.h:510
internal::Call call_wrapper_
Definition: server_interface.h:220
virtual ~experimental_registration_interface()
Definition: server_interface.h:149
bool FinalizeResult(void **tag, bool *status) override
FinalizeResult must be called before informing user code that the operation bound to the underlying c...
virtual bool RegisterService(const grpc::string *host, Service *service)=0
Register a service.
bool FinalizeResult(void **tag, bool *status) override
FinalizeResult must be called before informing user code that the operation bound to the underlying c...
virtual void Start(::grpc_impl::ServerCompletionQueue **cqs, size_t num_cqs)=0
Start the server.
virtual int AddListeningPort(const grpc::string &addr, grpc_impl::ServerCredentials *creds)=0
Tries to bind server to the given addr.
struct grpc_call grpc_call
A Call represents an RPC.
Definition: grpc_types.h:70
Definition: grpc_types.h:40
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
A sequence of bytes.
Definition: byte_buffer.h:67
NOTE: class experimental_registration_interface is not part of the public API of this class TODO(vjpa...
Definition: server_interface.h:147
const bool delete_on_finalize_
Definition: server_interface.h:218
virtual void RegisterAsyncGenericService(AsyncGenericService *service)=0
Register a generic service.
virtual grpc_server * server()=0
virtual int max_receive_message_size() const =0
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:65
Definition: server_interface.h:255
void Shutdown(const T &deadline)
Shutdown does the following things:
Definition: server_interface.h:105
Wrapper around grpc_server_credentials, a way to authenticate a server.
Definition: server_credentials_impl.h:40
Defines how to serialize and deserialize some type.
Definition: serialization_traits.h:58
grpc_call * call_
Definition: server_interface.h:219
CallbackGenericService is the base class for generic services implemented using the callback API and ...
Definition: async_generic_service.h:125
Definition: async_generic_service.h:77
ServerInterface *const server_
Definition: server_interface.h:212
void * server_tag() const
Definition: rpc_service_method.h:106
RpcType
Definition: rpc_method.h:31
Definition: async_generic_service.h:41
void RequestAsyncGenericCall(GenericServerContext *context, internal::ServerAsyncStreamingInterface *stream, ::grpc_impl::CompletionQueue *call_cq, ::grpc_impl::ServerCompletionQueue *notification_cq, void *tag)
Definition: server_interface.h:369
virtual void PerformOpsOnCall(internal::CallOpSetInterface *ops, internal::Call *call)=0
An interface allowing implementors to process and filter event tags.
Definition: completion_queue_tag.h:26
void SetRecvMessage(void *message, bool *hijacked_recv_message_failed)
Definition: interceptor_common.h:169
virtual void grpc_call_unref(grpc_call *call)=0
~PayloadAsyncRequest()
Definition: server_interface.h:292
const internal::RpcMethod::RpcType type_
Definition: server_interface.h:252
GenericAsyncRequest(ServerInterface *server, GenericServerContext *context, internal::ServerAsyncStreamingInterface *stream, ::grpc_impl::CompletionQueue *call_cq, ::grpc_impl::ServerCompletionQueue *notification_cq, void *tag, bool delete_on_finalize)
virtual void RegisterCallbackGenericService(experimental::CallbackGenericService *)
May not be abstract since this is a post-1.0 API addition.
Definition: server_interface.h:151
virtual ~BaseAsyncRequest()
NoPayloadAsyncRequest(internal::RpcServiceMethod *registered_method, ServerInterface *server, ::grpc_impl::ServerContext *context, internal::ServerAsyncStreamingInterface *stream, ::grpc_impl::CompletionQueue *call_cq, ::grpc_impl::ServerCompletionQueue *notification_cq, void *tag)
Definition: server_interface.h:257
A thin wrapper around grpc_completion_queue (see src/core/lib/surface/completion_queue....
Definition: completion_queue_impl.h:103
void RequestAsyncCall(internal::RpcServiceMethod *method, ::grpc_impl::ServerContext *context, internal::ServerAsyncStreamingInterface *stream, ::grpc_impl::CompletionQueue *call_cq, ::grpc_impl::ServerCompletionQueue *notification_cq, void *tag)
Definition: server_interface.h:358
std::string string
Definition: config.h:35
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm_impl.h:33
Definition: server_interface.h:332
bool Valid() const
Is this ByteBuffer valid?
Definition: byte_buffer.h:163
internal::ServerAsyncStreamingInterface *const stream_
Definition: server_interface.h:214
void RequestAsyncCall(internal::RpcServiceMethod *method, ::grpc_impl::ServerContext *context, internal::ServerAsyncStreamingInterface *stream, ::grpc_impl::CompletionQueue *call_cq, ::grpc_impl::ServerCompletionQueue *notification_cq, void *tag, Message *message)
Definition: server_interface.h:347
CoreCodegenInterface * g_core_codegen_interface
Definition: completion_queue_impl.h:93
#define GPR_CODEGEN_ASSERT(x)
Codegen specific version of GPR_ASSERT.
Definition: core_codegen_interface.h:146
Server side rpc method class.
Definition: rpc_service_method.h:87
void Release()
Forget underlying byte buffer without destroying Use this only for un-owned byte buffers.
Definition: byte_buffer.h:146
Definition: server_interface.h:68
virtual ~ServerInterface()
Definition: server_interface.h:70
::grpc_impl::ServerCompletionQueue ServerCompletionQueue
Definition: completion_queue.h:27
Analogous to struct timespec.
Definition: gpr_types.h:47
::google::protobuf::Message Message
Definition: config_protobuf.h:75
virtual void Wait()=0
Block waiting for all work to complete.
void IssueRequest(void *registered_method, grpc_byte_buffer **payload, ::grpc_impl::ServerCompletionQueue *notification_cq)
internal::InterceptorBatchMethodsImpl interceptor_methods_
Definition: server_interface.h:221
virtual bool FinalizeResult(void **tag, bool *status) override
FinalizeResult must be called before informing user code that the operation bound to the underlying c...
Definition: server_interface.h:236
bool FinalizeResult(void **tag, bool *status) override
FinalizeResult must be called before informing user code that the operation bound to the underlying c...
Definition: server_interface.h:296
Definition: interceptor_common.h:36
If you are trying to use CompletionQueue::AsyncNext with a time class that isn't either gpr_timespec ...
Definition: time.h:40
void AddInterceptionHookPoint(experimental::InterceptionHookPoints type)
Definition: interceptor_common.h:78
::grpc_impl::Channel Channel
Definition: channel.h:26
::grpc_impl::ServerContext *const context_
Definition: server_interface.h:213