修改pods
This commit is contained in:
83
Pods/gRPC-C++/include/grpcpp/generic/generic_stub.h
generated
83
Pods/gRPC-C++/include/grpcpp/generic/generic_stub.h
generated
@@ -19,15 +19,12 @@
|
||||
#ifndef GRPCPP_GENERIC_GENERIC_STUB_H
|
||||
#define GRPCPP_GENERIC_GENERIC_STUB_H
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include <grpcpp/client_context.h>
|
||||
#include <grpcpp/impl/generic_stub_internal.h>
|
||||
#include <grpcpp/impl/rpc_method.h>
|
||||
#include <grpcpp/support/async_stream.h>
|
||||
#include <grpcpp/support/async_unary_call.h>
|
||||
#include <grpcpp/support/byte_buffer.h>
|
||||
#include <grpcpp/support/client_callback.h>
|
||||
#include <grpcpp/support/status.h>
|
||||
#include <grpcpp/support/stub_options.h>
|
||||
|
||||
namespace grpc {
|
||||
@@ -42,10 +39,12 @@ typedef ClientAsyncResponseReader<ByteBuffer> GenericClientAsyncResponseReader;
|
||||
/// by name. In practice, the Request and Response types should be basic
|
||||
/// types like grpc::ByteBuffer or proto::MessageLite (the base protobuf).
|
||||
template <class RequestType, class ResponseType>
|
||||
class TemplatedGenericStub final {
|
||||
class TemplatedGenericStub final
|
||||
: public internal::TemplatedGenericStubCallbackInternal<RequestType,
|
||||
ResponseType> {
|
||||
public:
|
||||
explicit TemplatedGenericStub(std::shared_ptr<grpc::ChannelInterface> channel)
|
||||
: channel_(channel) {}
|
||||
using internal::TemplatedGenericStubCallbackInternal<
|
||||
RequestType, ResponseType>::TemplatedGenericStubCallbackInternal;
|
||||
|
||||
/// 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.
|
||||
@@ -74,6 +73,9 @@ class TemplatedGenericStub final {
|
||||
context, request));
|
||||
}
|
||||
|
||||
using internal::TemplatedGenericStubCallbackInternal<
|
||||
RequestType, ResponseType>::PrepareUnaryCall;
|
||||
|
||||
/// 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
|
||||
@@ -87,72 +89,9 @@ class TemplatedGenericStub final {
|
||||
true, tag);
|
||||
}
|
||||
|
||||
/// Setup and start a unary call to a named method \a method using
|
||||
/// \a context and specifying the \a request and \a response buffers.
|
||||
void UnaryCall(ClientContext* context, const std::string& method,
|
||||
StubOptions options, const RequestType* request,
|
||||
ResponseType* response,
|
||||
std::function<void(grpc::Status)> on_completion) {
|
||||
UnaryCallInternal(context, method, options, request, response,
|
||||
std::move(on_completion));
|
||||
}
|
||||
|
||||
/// Setup a unary call to a named method \a method using
|
||||
/// \a context and specifying the \a request and \a response buffers.
|
||||
/// Like any other reactor-based RPC, it will not be activated until
|
||||
/// StartCall is invoked on its reactor.
|
||||
void PrepareUnaryCall(ClientContext* context, const std::string& method,
|
||||
StubOptions options, const RequestType* request,
|
||||
ResponseType* response, ClientUnaryReactor* reactor) {
|
||||
PrepareUnaryCallInternal(context, method, options, request, response,
|
||||
reactor);
|
||||
}
|
||||
|
||||
/// Setup a call to a named method \a method using \a context and tied to
|
||||
/// \a reactor . Like any other bidi streaming RPC, it will not be activated
|
||||
/// until StartCall is invoked on its reactor.
|
||||
void PrepareBidiStreamingCall(
|
||||
ClientContext* context, const std::string& method, StubOptions options,
|
||||
ClientBidiReactor<RequestType, ResponseType>* reactor) {
|
||||
PrepareBidiStreamingCallInternal(context, method, options, reactor);
|
||||
}
|
||||
|
||||
private:
|
||||
std::shared_ptr<grpc::ChannelInterface> channel_;
|
||||
|
||||
void UnaryCallInternal(ClientContext* context, const std::string& method,
|
||||
StubOptions options, const RequestType* request,
|
||||
ResponseType* response,
|
||||
std::function<void(grpc::Status)> on_completion) {
|
||||
internal::CallbackUnaryCall(
|
||||
channel_.get(),
|
||||
grpc::internal::RpcMethod(method.c_str(), options.suffix_for_stats(),
|
||||
grpc::internal::RpcMethod::NORMAL_RPC),
|
||||
context, request, response, std::move(on_completion));
|
||||
}
|
||||
|
||||
void PrepareUnaryCallInternal(ClientContext* context,
|
||||
const std::string& method, StubOptions options,
|
||||
const RequestType* request,
|
||||
ResponseType* response,
|
||||
ClientUnaryReactor* reactor) {
|
||||
internal::ClientCallbackUnaryFactory::Create<RequestType, ResponseType>(
|
||||
channel_.get(),
|
||||
grpc::internal::RpcMethod(method.c_str(), options.suffix_for_stats(),
|
||||
grpc::internal::RpcMethod::NORMAL_RPC),
|
||||
context, request, response, reactor);
|
||||
}
|
||||
|
||||
void PrepareBidiStreamingCallInternal(
|
||||
ClientContext* context, const std::string& method, StubOptions options,
|
||||
ClientBidiReactor<RequestType, ResponseType>* reactor) {
|
||||
internal::ClientCallbackReaderWriterFactory<RequestType, ResponseType>::
|
||||
Create(channel_.get(),
|
||||
grpc::internal::RpcMethod(
|
||||
method.c_str(), options.suffix_for_stats(),
|
||||
grpc::internal::RpcMethod::BIDI_STREAMING),
|
||||
context, reactor);
|
||||
}
|
||||
using internal::TemplatedGenericStubCallbackInternal<RequestType,
|
||||
ResponseType>::channel_;
|
||||
|
||||
std::unique_ptr<ClientAsyncReaderWriter<RequestType, ResponseType>>
|
||||
CallInternal(grpc::ChannelInterface* channel, ClientContext* context,
|
||||
|
||||
Reference in New Issue
Block a user