diff options
Diffstat (limited to 'include/grpc++/generic/generic_stub.h')
-rw-r--r-- | include/grpc++/generic/generic_stub.h | 55 |
1 files changed, 6 insertions, 49 deletions
diff --git a/include/grpc++/generic/generic_stub.h b/include/grpc++/generic/generic_stub.h index e72826bdc1..502953b5de 100644 --- a/include/grpc++/generic/generic_stub.h +++ b/include/grpc++/generic/generic_stub.h @@ -1,6 +1,6 @@ /* * - * Copyright 2015 gRPC authors. + * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,56 +16,13 @@ * */ +// DEPRECATED: The headers in include/grpc++ are deprecated. Please include the +// headers in include/grpcpp instead. This header exists only for backwards +// compatibility. + #ifndef GRPCXX_GENERIC_GENERIC_STUB_H #define GRPCXX_GENERIC_GENERIC_STUB_H -#include <grpc++/support/async_stream.h> -#include <grpc++/support/async_unary_call.h> -#include <grpc++/support/byte_buffer.h> - -namespace grpc { - -class CompletionQueue; -typedef ClientAsyncReaderWriter<ByteBuffer, ByteBuffer> - GenericClientAsyncReaderWriter; -typedef ClientAsyncResponseReader<ByteBuffer> GenericClientAsyncResponseReader; - -/// Generic stubs provide a type-unsafe interface to call gRPC methods -/// by name. -class GenericStub final { - public: - explicit GenericStub(std::shared_ptr<ChannelInterface> channel) - : channel_(channel) {} - - /// Setup a call to a named method \a method using \a context, but don't - /// start it. Let it be started explicitly with StartCall and a tag. - /// The return value only indicates whether or not registration of the call - /// succeeded (i.e. the call won't proceed if the return value is nullptr). - std::unique_ptr<GenericClientAsyncReaderWriter> PrepareCall( - ClientContext* context, const grpc::string& method, CompletionQueue* cq); - - /// Setup a unary call to a named method \a method using \a context, and don't - /// start it. Let it be started explicitly with StartCall. - /// The return value only indicates whether or not registration of the call - /// succeeded (i.e. the call won't proceed if the return value is nullptr). - std::unique_ptr<GenericClientAsyncResponseReader> PrepareUnaryCall( - ClientContext* context, const grpc::string& method, - const ByteBuffer& request, CompletionQueue* cq); - - /// DEPRECATED for multi-threaded use - /// Begin a call to a named method \a method using \a context. - /// A tag \a tag will be delivered to \a cq when the call has been started - /// (i.e, initial metadata has been sent). - /// The return value only indicates whether or not registration of the call - /// succeeded (i.e. the call won't proceed if the return value is nullptr). - std::unique_ptr<GenericClientAsyncReaderWriter> Call( - ClientContext* context, const grpc::string& method, CompletionQueue* cq, - void* tag); - - private: - std::shared_ptr<ChannelInterface> channel_; -}; - -} // namespace grpc +#include <grpcpp/generic/generic_stub.h> #endif // GRPCXX_GENERIC_GENERIC_STUB_H |