class PackedBufferBase
Defined at line 48 of file ../../third_party/perfetto/include/perfetto/protozero/packed_repeated_fields.h
This file contains classes used when encoding packed repeated fields.
To encode such a field, the caller is first expected to accumulate all of the
values in one of the following types (depending on the wire type of the
individual elements), defined below:
* protozero::PackedVarInt
* protozero::PackedFixedSizeInt
</
*element_type=*/ uint32_t>
Then that buffer is passed to the protozero-generated setters as an argument.
After calling the setter, the buffer can be destroyed.
An example of encoding a packed field:
protozero::HeapBuffered
<protozero
::Message> msg;
protozero::PackedVarInt buf;
buf.Append(42);
buf.Append(-1);
msg->set_fieldname(buf);
msg.SerializeAsString();
Protected Members
uint8_t * storage_begin_
uint8_t * storage_end_
uint8_t * write_ptr_
unique_ptr heap_buf_
uint8_t[8160] stack_buf_
static const size_t kMaxElementSize
static const size_t kOnStackStorageSize
Public Methods
void PackedBufferBase ()
Defined at line 50 of file ../../third_party/perfetto/include/perfetto/protozero/packed_repeated_fields.h
void PackedBufferBase (const PackedBufferBase & )
Copy or move is disabled due to pointers to stack addresses.
Defined at line 53 of file ../../third_party/perfetto/include/perfetto/protozero/packed_repeated_fields.h
void PackedBufferBase (PackedBufferBase && )
Defined at line 54 of file ../../third_party/perfetto/include/perfetto/protozero/packed_repeated_fields.h
void Reset ()
PackedBufferBase & operator= (const PackedBufferBase & )
Defined at line 55 of file ../../third_party/perfetto/include/perfetto/protozero/packed_repeated_fields.h
PackedBufferBase & operator= (PackedBufferBase && )
Defined at line 56 of file ../../third_party/perfetto/include/perfetto/protozero/packed_repeated_fields.h
const uint8_t * data ()
Defined at line 60 of file ../../third_party/perfetto/include/perfetto/protozero/packed_repeated_fields.h
size_t size ()
Defined at line 62 of file ../../third_party/perfetto/include/perfetto/protozero/packed_repeated_fields.h
Protected Methods
void GrowIfNeeded ()
Defined at line 67 of file ../../third_party/perfetto/include/perfetto/protozero/packed_repeated_fields.h
void GrowSlowpath ()