Public Member Functions | Private Member Functions | Private Attributes | List of all members
grpc::TemplatedGenericStub< RequestType, ResponseType > Class Template Referencefinal

#include <generic_stub.h>

Public Member Functions

std::unique_ptr< ClientAsyncReaderWriter< RequestType, ResponseType > > Call (ClientContext *context, const std::string &method, grpc::CompletionQueue *cq, void *tag)
 
void PrepareBidiStreamingCall (ClientContext *context, const std::string &method, StubOptions options, ClientBidiReactor< RequestType, ResponseType > *reactor)
 
std::unique_ptr< ClientAsyncReaderWriter< RequestType, ResponseType > > PrepareCall (ClientContext *context, const std::string &method, grpc::CompletionQueue *cq)
 
std::unique_ptr< ClientAsyncResponseReader< ResponseType > > PrepareUnaryCall (ClientContext *context, const std::string &method, const RequestType &request, grpc::CompletionQueue *cq)
 
void PrepareUnaryCall (ClientContext *context, const std::string &method, StubOptions options, const RequestType *request, ResponseType *response, ClientUnaryReactor *reactor)
 
 TemplatedGenericStub (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)
 

Private Member Functions

std::unique_ptr< ClientAsyncReaderWriter< RequestType, ResponseType > > CallInternal (grpc::ChannelInterface *channel, ClientContext *context, const std::string &method, StubOptions options, grpc::CompletionQueue *cq, bool start, void *tag)
 
void PrepareBidiStreamingCallInternal (ClientContext *context, const std::string &method, StubOptions options, ClientBidiReactor< RequestType, ResponseType > *reactor)
 
void PrepareUnaryCallInternal (ClientContext *context, const std::string &method, StubOptions options, const RequestType *request, ResponseType *response, ClientUnaryReactor *reactor)
 
void UnaryCallInternal (ClientContext *context, const std::string &method, StubOptions options, const RequestType *request, ResponseType *response, std::function< void(grpc::Status)> on_completion)
 

Private Attributes

std::shared_ptr< grpc::ChannelInterfacechannel_
 

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).

Definition at line 45 of file grpcpp/generic/generic_stub.h.

Constructor & Destructor Documentation

◆ TemplatedGenericStub()

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

Definition at line 47 of file grpcpp/generic/generic_stub.h.

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).

Definition at line 83 of file grpcpp/generic/generic_stub.h.

◆ CallInternal()

template<class RequestType , class ResponseType >
std::unique_ptr<ClientAsyncReaderWriter<RequestType, ResponseType> > grpc::TemplatedGenericStub< RequestType, ResponseType >::CallInternal ( grpc::ChannelInterface channel,
ClientContext context,
const std::string &  method,
StubOptions  options,
grpc::CompletionQueue cq,
bool  start,
void *  tag 
)
inlineprivate

Definition at line 158 of file grpcpp/generic/generic_stub.h.

◆ PrepareBidiStreamingCall()

template<class RequestType , class ResponseType >
void grpc::TemplatedGenericStub< RequestType, ResponseType >::PrepareBidiStreamingCall ( ClientContext context,
const std::string &  method,
StubOptions  options,
ClientBidiReactor< RequestType, ResponseType > *  reactor 
)
inline

Setup a call to a named method method using context and tied to reactor . Like any other bidi streaming RPC, it will not be activated until StartCall is invoked on its reactor.

Definition at line 114 of file grpcpp/generic/generic_stub.h.

◆ PrepareBidiStreamingCallInternal()

template<class RequestType , class ResponseType >
void grpc::TemplatedGenericStub< RequestType, ResponseType >::PrepareBidiStreamingCallInternal ( ClientContext context,
const std::string &  method,
StubOptions  options,
ClientBidiReactor< RequestType, ResponseType > *  reactor 
)
inlineprivate

Definition at line 146 of file grpcpp/generic/generic_stub.h.

◆ 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).

Definition at line 55 of file grpcpp/generic/generic_stub.h.

◆ PrepareUnaryCall() [1/2]

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).

Definition at line 65 of file grpcpp/generic/generic_stub.h.

◆ PrepareUnaryCall() [2/2]

template<class RequestType , class ResponseType >
void grpc::TemplatedGenericStub< RequestType, ResponseType >::PrepareUnaryCall ( ClientContext context,
const std::string &  method,
StubOptions  options,
const RequestType *  request,
ResponseType *  response,
ClientUnaryReactor reactor 
)
inline

Setup a unary call to a named method method using context and specifying the request and response buffers. Like any other reactor-based RPC, it will not be activated until StartCall is invoked on its reactor.

Definition at line 104 of file grpcpp/generic/generic_stub.h.

◆ PrepareUnaryCallInternal()

template<class RequestType , class ResponseType >
void grpc::TemplatedGenericStub< RequestType, ResponseType >::PrepareUnaryCallInternal ( ClientContext context,
const std::string &  method,
StubOptions  options,
const RequestType *  request,
ResponseType *  response,
ClientUnaryReactor reactor 
)
inlineprivate

Definition at line 134 of file grpcpp/generic/generic_stub.h.

◆ UnaryCall()

template<class RequestType , class ResponseType >
void grpc::TemplatedGenericStub< RequestType, ResponseType >::UnaryCall ( ClientContext context,
const std::string &  method,
StubOptions  options,
const RequestType *  request,
ResponseType *  response,
std::function< void(grpc::Status)>  on_completion 
)
inline

Setup and start a unary call to a named method method using context and specifying the request and response buffers.

Definition at line 92 of file grpcpp/generic/generic_stub.h.

◆ UnaryCallInternal()

template<class RequestType , class ResponseType >
void grpc::TemplatedGenericStub< RequestType, ResponseType >::UnaryCallInternal ( ClientContext context,
const std::string &  method,
StubOptions  options,
const RequestType *  request,
ResponseType *  response,
std::function< void(grpc::Status)>  on_completion 
)
inlineprivate

Definition at line 123 of file grpcpp/generic/generic_stub.h.

Member Data Documentation

◆ channel_

template<class RequestType , class ResponseType >
std::shared_ptr<grpc::ChannelInterface> grpc::TemplatedGenericStub< RequestType, ResponseType >::channel_
private

Definition at line 121 of file grpcpp/generic/generic_stub.h.


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


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:31