class ProtoBufferWriter

Defined at line 56 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/proto_buffer_writer.h

This is a specialization of the protobuf class ZeroCopyOutputStream.

The principle is to give the proto layer one buffer of bytes at a time

that it can use to serialize the next portion of the message, with the

option to "backup" if more buffer is given than required at the last buffer.

Read more about ZeroCopyOutputStream interface here:

https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.io.zero_copy_stream#ZeroCopyOutputStream

Public Methods

void ProtoBufferWriter (ByteBuffer * byte_buffer, int block_size, int total_size)

Constructor for this derived class

Parameters

byte_buffer [out] A pointer to the grpc::ByteBuffer created
block_size How big are the chunks to allocate at a time
total_size How many total bytes are required for this proto

Defined at line 63 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/proto_buffer_writer.h

void ~ProtoBufferWriter ()

Defined at line 75 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/proto_buffer_writer.h

bool Next (void ** data, int * size)

Give the proto library the next buffer of bytes and its size. It is

safe for the caller to write from data[0, size - 1].

Defined at line 83 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/proto_buffer_writer.h

void BackUp (int count)

Backup by

bytes because Next returned more bytes than needed

(only used in the last buffer).

must be less than or equal too

the last buffer returned from next.

Defined at line 123 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/proto_buffer_writer.h

int64_t ByteCount ()

Returns the total number of bytes written since this object was created.

Defined at line 153 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/proto_buffer_writer.h

bool WriteCord (const absl::Cord & cord)

Writes cord to the backing byte_buffer, sharing the memory between the

blocks of the cord, and the slices of the byte_buffer.

(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 162 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/proto_buffer_writer.h

Protected Methods

grpc_slice_buffer * slice_buffer ()

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 202 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/proto_buffer_writer.h

void set_byte_count (int64_t byte_count)

Defined at line 203 of file ../../third_party/grpc-migrating/src/include/grpcpp/support/proto_buffer_writer.h

Friends

class ProtoBufferWriterPeer