GRPC C++  1.30.0
Data Structures | Public Member Functions
grpc_impl::TemplatedGenericStub< RequestType, ResponseType > Class Template Referencefinal

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

#include <generic_stub_impl.h>

Data Structures

class  experimental_type
 NOTE: class experimental_type is not part of the public API of this class TODO(vjpai): Move these contents to the public API of GenericStub when they are no longer experimental. More...
 

Public Member Functions

 TemplatedGenericStub (std::shared_ptr< grpc::ChannelInterface > channel)
 
std::unique_ptr< ClientAsyncReaderWriter< RequestType, ResponseType > > PrepareCall (ClientContext *context, const grpc::string &method, 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 grpc::string &method, const RequestType &request, 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 grpc::string &method, CompletionQueue *cq, void *tag)
 DEPRECATED for multi-threaded use Begin a call to a named method method using context. More...
 
experimental_type experimental ()
 NOTE: The function experimental() is not stable public API. More...
 

Detailed Description

template<class RequestType, class ResponseType>
class grpc_impl::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).

Constructor & Destructor Documentation

◆ TemplatedGenericStub()

template<class RequestType , class ResponseType >
grpc_impl::TemplatedGenericStub< RequestType, ResponseType >::TemplatedGenericStub ( std::shared_ptr< grpc::ChannelInterface channel)
inlineexplicit

Member Function Documentation

◆ Call()

template<class RequestType , class ResponseType >
std::unique_ptr<ClientAsyncReaderWriter<RequestType, ResponseType> > grpc_impl::TemplatedGenericStub< RequestType, ResponseType >::Call ( ClientContext context,
const grpc::string method,
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).

◆ experimental()

template<class RequestType , class ResponseType >
experimental_type grpc_impl::TemplatedGenericStub< RequestType, ResponseType >::experimental ( )
inline

NOTE: The function experimental() is not stable public API.

It is a view to the experimental components of this class. It may be changed or removed at any time.

◆ PrepareCall()

template<class RequestType , class ResponseType >
std::unique_ptr<ClientAsyncReaderWriter<RequestType, ResponseType> > grpc_impl::TemplatedGenericStub< RequestType, ResponseType >::PrepareCall ( ClientContext context,
const grpc::string method,
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_impl::TemplatedGenericStub< RequestType, ResponseType >::PrepareUnaryCall ( ClientContext context,
const grpc::string method,
const RequestType &  request,
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: