class EpsCopyOutputStream
Defined at line 642 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
EpsCopyOutputStream wraps a ZeroCopyOutputStream and exposes a new stream,
which has the property you can write kSlopBytes (16 bytes) from the current
position without bounds checks. The cursor into the stream is managed by
the user of the class and is an explicit parameter in the methods. Careful
use of this class, ie. keep ptr a local variable, eliminates the need to
for the compiler to sync the ptr value between register and memory.
Public Methods
void EnableAliasing (bool enabled)
Instructs the EpsCopyOutputStream to allow the underlying
ZeroCopyOutputStream to hold pointers to the original structure instead of
copying, if it supports it (i.e. output->AllowsAliasing() is true). If the
underlying stream does not support aliasing, then enabling it has no
affect. For now, this only affects the behavior of
WriteRawMaybeAliased().
NOTE: It is caller's responsibility to ensure that the chunk of memory
remains live until all of the data has been consumed from the stream.
int64_t ByteCount (uint8_t * ptr)
The number of bytes written to the stream at position ptr, relative to the
stream's overall position.
void EpsCopyOutputStream (ZeroCopyOutputStream *stream,booldeterministic,uint8_t **pp)
Initialize from a stream.
Defined at line 648 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
void EpsCopyOutputStream (void *data,intsize,booldeterministic)
Only for array serialization. No overflow protection, end_ will be the
pointed to the end of the array. When using this the total size is already
known, so no need to maintain the slop region.
Defined at line 659 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
void EpsCopyOutputStream (void *data,intsize,ZeroCopyOutputStream *stream,booldeterministic,uint8_t **pp)
Initialize from stream but with the first buffer already given (eager).
Defined at line 666 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
uint8_t * EnsureSpace (uint8_t * ptr)
After this it's guaranteed you can safely write kSlopBytes to ptr. This
will never fail! The underlying stream can produce an error. Use HadError
to check for errors.
Defined at line 679 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
size_t BytesAvailable (uint8_t * ptr)
Returns the number of bytes available to write to the stream.
Defined at line 687 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
uint8_t * Trim (uint8_t * ptr)
Flush everything that's written into the underlying ZeroCopyOutputStream
and trims the underlying stream to the location of ptr.
uint8_t * WriteRaw (const void *data,intsize,uint8_t *ptr)
Defined at line 691 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
uint8_t * WriteBytesMaybeAliased (uint32_tnum,absl::string_views,uint8_t *ptr)
Defined at line 735 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
uint8_t * WriteCord (const absl::Cord & cord, uint8_t * ptr)
uint8_t * WriteRawMaybeAliased (const void *data,intsize,uint8_t *ptr)
Defined at line 704 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
uint8_t * WriteStringMaybeAliased (uint32_tnum,absl::string_views,uint8_t *ptr)
Defined at line 719 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
template <typename T>
uint8_t * WriteString (uint32_tnum,const T &s,uint8_t *ptr)
Defined at line 741 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
uint8_t * WriteString (uint32_tnum,const absl::Cord &s,uint8_t *ptr)
Defined at line 754 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
template <typename T>
uint8_t * WriteBytes (uint32_tnum,const T &s,uint8_t *ptr)
Defined at line 763 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
template <typename T>
uint8_t * WriteInt32Packed (intnum,const T &r,intsize,uint8_t *ptr)
Defined at line 772 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
template <typename T>
uint8_t * WriteUInt32Packed (intnum,const T &r,intsize,uint8_t *ptr)
Defined at line 777 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
template <typename T>
uint8_t * WriteSInt32Packed (intnum,const T &r,intsize,uint8_t *ptr)
Defined at line 782 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
template <typename T>
uint8_t * WriteInt64Packed (intnum,const T &r,intsize,uint8_t *ptr)
Defined at line 787 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
template <typename T>
uint8_t * WriteUInt64Packed (intnum,const T &r,intsize,uint8_t *ptr)
Defined at line 792 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
template <typename T>
uint8_t * WriteSInt64Packed (intnum,const T &r,intsize,uint8_t *ptr)
Defined at line 797 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
template <typename T>
uint8_t * WriteEnumPacked (intnum,const T &r,intsize,uint8_t *ptr)
Defined at line 802 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
template <typename T>
uint8_t * WriteFixedPacked (intnum,const T &r,uint8_t *ptr)
Defined at line 808 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
template <int kElementSize>
uint8_t * WriteRawNumericArrayLittleEndian (const void *data,intsize,uint8_t *ptr)
Defined at line 819 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
bool HadError ()
Returns true if there was an underlying I/O error since this object was
created.
Defined at line 826 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
void SetSerializationDeterministic (bool value)
See documentation on CodedOutputStream::SetSerializationDeterministic.
Defined at line 842 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
bool IsSerializationDeterministic ()
See documentation on CodedOutputStream::IsSerializationDeterministic.
Defined at line 847 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
uint8_t * SetInitialBuffer (void * data, int size)
These methods are for CodedOutputStream. Ideally they should be private
but to match current behavior of CodedOutputStream as close as possible
we allow it some functionality.
Defined at line 972 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
Enumerations
enum (unnamed)
| Name | Value |
|---|---|
| kSlopBytes | 16 |
Defined at line 645 of file ../../third_party/protobuf/src/src/google/protobuf/io/coded_stream.h
Friends
class CodedOutputStream