diff options
Diffstat (limited to 'include/grpc++/impl/service_type.h')
-rw-r--r-- | include/grpc++/impl/service_type.h | 88 |
1 files changed, 2 insertions, 86 deletions
diff --git a/include/grpc++/impl/service_type.h b/include/grpc++/impl/service_type.h index 3b6ac1de77..b33fbec739 100644 --- a/include/grpc++/impl/service_type.h +++ b/include/grpc++/impl/service_type.h @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,90 +34,6 @@ #ifndef GRPCXX_IMPL_SERVICE_TYPE_H #define GRPCXX_IMPL_SERVICE_TYPE_H -#include <grpc++/impl/serialization_traits.h> -#include <grpc++/server.h> -#include <grpc++/support/config.h> -#include <grpc++/support/status.h> - -namespace grpc { - -class Call; -class CompletionQueue; -class RpcService; -class Server; -class ServerCompletionQueue; -class ServerContext; - -class SynchronousService { - public: - virtual ~SynchronousService() {} - virtual RpcService* service() = 0; -}; - -class ServerAsyncStreamingInterface { - public: - virtual ~ServerAsyncStreamingInterface() {} - - virtual void SendInitialMetadata(void* tag) = 0; - - private: - friend class Server; - virtual void BindCall(Call* call) = 0; -}; - -class AsynchronousService { - public: - AsynchronousService(const char** method_names, size_t method_count) - : server_(nullptr), - method_names_(method_names), - method_count_(method_count), - request_args_(nullptr) {} - - ~AsynchronousService() { delete[] request_args_; } - - protected: - template <class Message> - void RequestAsyncUnary(int index, ServerContext* context, Message* request, - ServerAsyncStreamingInterface* stream, - CompletionQueue* call_cq, - ServerCompletionQueue* notification_cq, void* tag) { - server_->RequestAsyncCall(request_args_[index], context, stream, call_cq, - notification_cq, tag, request); - } - void RequestClientStreaming(int index, ServerContext* context, - ServerAsyncStreamingInterface* stream, - CompletionQueue* call_cq, - ServerCompletionQueue* notification_cq, - void* tag) { - server_->RequestAsyncCall(request_args_[index], context, stream, call_cq, - notification_cq, tag); - } - template <class Message> - void RequestServerStreaming(int index, ServerContext* context, - Message* request, - ServerAsyncStreamingInterface* stream, - CompletionQueue* call_cq, - ServerCompletionQueue* notification_cq, - void* tag) { - server_->RequestAsyncCall(request_args_[index], context, stream, call_cq, - notification_cq, tag, request); - } - void RequestBidiStreaming(int index, ServerContext* context, - ServerAsyncStreamingInterface* stream, - CompletionQueue* call_cq, - ServerCompletionQueue* notification_cq, void* tag) { - server_->RequestAsyncCall(request_args_[index], context, stream, call_cq, - notification_cq, tag); - } - - private: - friend class Server; - Server* server_; - const char** const method_names_; - size_t method_count_; - void** request_args_; -}; - -} // namespace grpc +#include <grpc++/impl/codegen/service_type.h> #endif // GRPCXX_IMPL_SERVICE_TYPE_H |