class ProtoBufferReader
Defined at line 47 of file ../../third_party/grpc/src/include/grpcpp/support/proto_buffer_reader.h
This is a specialization of the protobuf class ZeroCopyInputStream
The principle is to get one chunk of data at a time from the proto layer,
with options to backup (re-see some bytes) or skip (forward past some bytes)
Read more about ZeroCopyInputStream interface here:
https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.io.zero_copy_stream#ZeroCopyInputStream
Public Methods
void ProtoBufferReader (ByteBuffer * buffer)
Constructs buffer reader from
Will set
to non ok
if
is invalid (the internal buffer has not been initialized).
Defined at line 51 of file ../../third_party/grpc/src/include/grpcpp/support/proto_buffer_reader.h
void ~ProtoBufferReader ()
Defined at line 62 of file ../../third_party/grpc/src/include/grpcpp/support/proto_buffer_reader.h
bool Next (const void ** data, int * size)
Give the proto library a chunk of data from the stream. The caller
may safely read from data[0, size - 1].
Defined at line 70 of file ../../third_party/grpc/src/include/grpcpp/support/proto_buffer_reader.h
Status status ()
Returns the status of the buffer reader.
Defined at line 95 of file ../../third_party/grpc/src/include/grpcpp/support/proto_buffer_reader.h
void BackUp (int count)
The proto library calls this to indicate that we should back up
bytes that have already been returned by the last call of Next.
So do the backup and have that ready for a later Next.
Defined at line 100 of file ../../third_party/grpc/src/include/grpcpp/support/proto_buffer_reader.h
bool Skip (int count)
The proto library calls this to skip over
bytes. Implement this
using Next and BackUp combined.
Defined at line 107 of file ../../third_party/grpc/src/include/grpcpp/support/proto_buffer_reader.h
int64_t ByteCount ()
Returns the total number of bytes read since this object was created.
Defined at line 123 of file ../../third_party/grpc/src/include/grpcpp/support/proto_buffer_reader.h
bool ReadCord (absl::Cord * cord, int count)
Read the next `count` bytes and append it to the given Cord.
(override is conditionally omitted here to support old Protobuf which
doesn't have ReadCord method)
NOLINTBEGIN(modernize-use-override,
clang-diagnostic-inconsistent-missing-override)
Defined at line 131 of file ../../third_party/grpc/src/include/grpcpp/support/proto_buffer_reader.h
Protected Methods
void set_byte_count (int64_t byte_count)
These protected members are needed to support internal optimizations.
they expose internal bits of grpc core that are NOT stable. If you have
a use case needs to use one of these functions, please send an email to
https://groups.google.com/forum/#!forum/grpc-io.
Defined at line 187 of file ../../third_party/grpc/src/include/grpcpp/support/proto_buffer_reader.h
int64_t backup_count ()
Defined at line 188 of file ../../third_party/grpc/src/include/grpcpp/support/proto_buffer_reader.h
void set_backup_count (int64_t backup_count)
Defined at line 189 of file ../../third_party/grpc/src/include/grpcpp/support/proto_buffer_reader.h
grpc_byte_buffer_reader * reader ()
Defined at line 190 of file ../../third_party/grpc/src/include/grpcpp/support/proto_buffer_reader.h
grpc_slice * slice ()
Defined at line 191 of file ../../third_party/grpc/src/include/grpcpp/support/proto_buffer_reader.h
grpc_slice ** mutable_slice_ptr ()
Defined at line 192 of file ../../third_party/grpc/src/include/grpcpp/support/proto_buffer_reader.h