GRPC C++  1.66.0
Public Member Functions
grpc::TemplatedGenericStub< RequestType, ResponseType > Class Template Referencefinal

Generic stubs provide a type-unaware interface to call gRPC methods by name. More...

#include <generic_stub.h>

Public Member Functions

std::unique_ptr< ClientAsyncReaderWriter< RequestType, ResponseType > > PrepareCall (ClientContext *context, const std::string &method, grpc::CompletionQueue *cq)
 Setup a call to a named method method using context, but don't start it. More...
 
std::unique_ptr< ClientAsyncResponseReader< ResponseType > > PrepareUnaryCall (ClientContext *context, const std::string &method, const RequestType &request, grpc::CompletionQueue *cq)
 Setup a unary call to a named method method using context, and don't start it. More...
 
std::unique_ptr< ClientAsyncReaderWriter< RequestType, ResponseType > > Call (ClientContext *context, const std::string &method, grpc::CompletionQueue *cq, void *tag)
 DEPRECATED for multi-threaded use Begin a call to a named method method using context. More...
 
- Public Member Functions inherited from grpc::internal::TemplatedGenericStubCallbackInternal< RequestType, ResponseType >
 TemplatedGenericStubCallbackInternal (std::shared_ptr< grpc::ChannelInterface > channel)
 
void UnaryCall (ClientContext *context, const std::string &method, StubOptions options, const RequestType *request, ResponseType *response, std::function< void(grpc::Status)> on_completion)
 Setup and start a unary call to a named method method using context and specifying the request and response buffers. More...
 
void PrepareUnaryCall (ClientContext *context, const std::string &method, StubOptions options, const RequestType *request, ResponseType *response, ClientUnaryReactor *reactor)
 Setup a unary call to a named method method using context and specifying the request and response buffers. More...
 
void PrepareBidiStreamingCall (ClientContext *context, const std::string &method, StubOptions options, ClientBidiReactor< RequestType, ResponseType > *reactor)
 Setup a call to a named method method using context and tied to reactor . More...
 

Detailed Description

template<class RequestType, class ResponseType>
class grpc::TemplatedGenericStub< RequestType, ResponseType >

Generic stubs provide a type-unaware interface to call gRPC methods by name.

In practice, the Request and Response types should be basic types like grpc::ByteBuffer or proto::MessageLite (the base protobuf).

Member Function Documentation

◆ Call()

template<class RequestType , class ResponseType >
std::unique_ptr<ClientAsyncReaderWriter<RequestType, ResponseType> > grpc::TemplatedGenericStub< RequestType, ResponseType >::Call ( ClientContext context,
const std::string &  method,
grpc::CompletionQueue cq,
void *  tag 
)
inline

DEPRECATED for multi-threaded use Begin a call to a named method method using context.

A tag tag will be delivered to 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).

◆ PrepareCall()

template<class RequestType , class ResponseType >
std::unique_ptr<ClientAsyncReaderWriter<RequestType, ResponseType> > grpc::TemplatedGenericStub< RequestType, ResponseType >::PrepareCall ( ClientContext context,
const std::string &  method,
grpc::CompletionQueue cq 
)
inline

Setup a call to a named method method using 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).

◆ PrepareUnaryCall()

template<class RequestType , class ResponseType >
std::unique_ptr<ClientAsyncResponseReader<ResponseType> > grpc::TemplatedGenericStub< RequestType, ResponseType >::PrepareUnaryCall ( ClientContext context,
const std::string &  method,
const RequestType &  request,
grpc::CompletionQueue cq 
)
inline

Setup a unary call to a named method method using 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).


The documentation for this class was generated from the following file: