GRPC C++  1.3.0
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
grpc::ClientReader< R > Class Template Reference

#include <channel_interface.h>

Public Member Functions

template<class W >
 ClientReader (ChannelInterface *channel, const RpcMethod &method, ClientContext *context, const W &request)
 Blocking create a stream and write the first request out. More...
 
void WaitForInitialMetadata () override
 Blocking wait for initial metadata from server. More...
 
bool NextMessageSize (uint32_t *sz) override
 Upper bound on the next message size available for reading on this stream. More...
 
bool Read (R *msg) override
 Blocking read a message and parse to msg. More...
 
Status Finish () override
 Wait until the stream finishes, and return the final status. More...
 
- Public Member Functions inherited from grpc::ClientStreamingInterface
virtual ~ClientStreamingInterface ()
 
- Public Member Functions inherited from grpc::ReaderInterface< R >
virtual ~ReaderInterface ()
 

Constructor & Destructor Documentation

template<class R >
template<class W >
grpc::ClientReader< R >::ClientReader ( ChannelInterface channel,
const RpcMethod method,
ClientContext context,
const W &  request 
)
inline

Blocking create a stream and write the first request out.

Member Function Documentation

template<class R >
Status grpc::ClientReader< R >::Finish ( )
inlineoverridevirtual

Wait until the stream finishes, and return the final status.

When the client side declares it has no more message to send, either implicitly or by calling WritesDone(), it needs to make sure there is no more message to be received from the server, either implicitly or by getting a false from a Read().

This function will return either:

  • when all incoming messages have been read and the server has returned status.
  • OR when the server has returned a non-OK status.

Implements grpc::ClientStreamingInterface.

template<class R >
bool grpc::ClientReader< R >::NextMessageSize ( uint32_t *  sz)
inlineoverridevirtual

Upper bound on the next message size available for reading on this stream.

Implements grpc::ReaderInterface< R >.

template<class R >
bool grpc::ClientReader< R >::Read ( R *  msg)
inlineoverridevirtual

Blocking read a message and parse to msg.

Returns true on success. This is thread-safe with respect to Write or methods on the same stream. It should not be called concurrently with another Read on the same stream as the order of delivery will not be defined.

Parameters
[out]msgThe read message.
Returns
false when there will be no more incoming messages, either because the other side has called WritesDone() or the stream has failed (or been cancelled).

Implements grpc::ReaderInterface< R >.

template<class R >
void grpc::ClientReader< R >::WaitForInitialMetadata ( )
inlineoverridevirtual

Blocking wait for initial metadata from server.

The received metadata can only be accessed after this call returns. Should only be called before the first read. Calling this method is optional, and if it is not called the metadata will be available in ClientContext after the first read.

status ignored

Implements grpc::ClientReaderInterface< R >.


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