struct ReflectionSchema
Defined at line 112 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
This struct describes the internal layout of the message, hence this is
used to act on the message reflectively.
default_instance: The default instance of the message. This is only
used to obtain pointers to default instances of embedded
messages, which GetMessage() will return if the particular
sub-message has not been initialized yet. (Thus, all
embedded message fields *must* have non-null pointers
in the default instance.)
offsets: An array of ints giving the byte offsets.
For each oneof or weak field, the offset is relative to the
default_instance. These can be computed at compile time
using the
PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET()
macro. For each none oneof field, the offset is related to
the start of the message object. These can be computed at
compile time using the
PROTO2_GENERATED_MESSAGE_FIELD_OFFSET() macro.
Besides offsets for all fields, this array also contains
offsets for oneof unions. The offset of the i-th oneof union
is offsets[descriptor->field_count() + i].
has_bit_indices: Mapping from field indexes to their index in the has
bit array.
has_bits_offset: Offset in the message of an array of uint32s of size
descriptor->field_count()/32, rounded up. This is a
bitfield where each bit indicates whether or not the
corresponding field of the message has been initialized.
The bit for field index i is obtained by the expression:
has_bits[i / 32]
&
(1
<
<
(i % 32))
unknown_fields_offset: Offset in the message of the UnknownFieldSet for
the message.
extensions_offset: Offset in the message of the ExtensionSet for the
message, or -1 if the message type has no extension
ranges.
oneof_case_offset: Offset in the message of an array of uint32s of
size descriptor->oneof_decl_count(). Each uint32_t
indicates what field is set for each oneof.
object_size: The size of a message object of this type, as measured
by sizeof().
arena_offset: If a message doesn't have a unknown_field_set that stores
the arena, it must have a direct pointer to the arena.
weak_field_map_offset: If the message proto has weak fields, this is the
offset of _weak_field_map_ in the generated proto. Otherwise
-1.
Public Members
const Message * default_instance_
const uint32_t * offsets_
const uint32_t * has_bit_indices_
int has_bits_offset_
int metadata_offset_
int extensions_offset_
int oneof_case_offset_
int object_size_
int weak_field_map_offset_
const uint32_t * inlined_string_indices_
int inlined_string_donated_offset_
int split_offset_
int sizeof_split_
Public Methods
uint32_t GetObjectSize ()
Size of a google::protobuf::Message object of this type.
Defined at line 115 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
bool InRealOneof (const FieldDescriptor * field)
Defined at line 117 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
uint32_t GetFieldOffsetNonOneof (const FieldDescriptor * field)
Offset of a non-oneof field. Getting a field offset is slightly more
efficient when we know statically that it is not a oneof field.
Defined at line 123 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
uint32_t GetFieldOffset (const FieldDescriptor * field)
Offset of any field.
Defined at line 129 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
bool IsFieldInlined (const FieldDescriptor * field)
Defined at line 140 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
uint32_t GetOneofCaseOffset (const OneofDescriptor * oneof_descriptor)
Defined at line 144 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
bool HasHasbits ()
Defined at line 151 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
uint32_t HasBitIndex (const FieldDescriptor * field)
Bit index within the bit array of hasbits. Bit order is low-to-high.
Defined at line 154 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
uint32_t HasBitsOffset ()
Byte offset of the hasbits array.
Defined at line 161 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
bool HasInlinedString ()
Defined at line 166 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
uint32_t InlinedStringIndex (const FieldDescriptor * field)
Bit index within the bit array of _inlined_string_donated_. Bit order is
low-to-high.
Defined at line 170 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
uint32_t InlinedStringDonatedOffset ()
Byte offset of the _inlined_string_donated_ array.
Defined at line 176 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
uint32_t GetMetadataOffset ()
The offset of the InternalMetadataWithArena member.
For Lite this will actually be an InternalMetadataWithArenaLite.
The schema doesn't contain enough information to distinguish between
these two cases.
Defined at line 185 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
bool HasExtensionSet ()
Whether this message has an ExtensionSet.
Defined at line 190 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
uint32_t GetExtensionSetOffset ()
The offset of the ExtensionSet in this message.
Defined at line 193 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
int GetWeakFieldMapOffset ()
The off set of WeakFieldMap when the message contains weak fields.
The default is 0 for now.
Defined at line 200 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
bool IsDefaultInstance (const Message & message)
Defined at line 202 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
const void * GetFieldDefault (const FieldDescriptor * field)
Returns a pointer to the default value for this field. The size and type
of the underlying data depends on the field's type.
Defined at line 208 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
bool IsEagerlyVerifiedLazyField (const FieldDescriptor * field)
Returns true if the field is implicitly backed by LazyField.
Defined at line 214 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
bool IsSplit ()
Defined at line 220 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
bool IsSplit (const FieldDescriptor * field)
Defined at line 222 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
uint32_t SplitOffset ()
Byte offset of _split_.
Defined at line 228 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
uint32_t SizeofSplit ()
Defined at line 233 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
bool HasWeakFields ()
Defined at line 239 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
uint32_t OffsetValue (uint32_t v, FieldDescriptor::Type type)
We tag offset values to provide additional data about fields (such as
"unused" or "lazy" or "inlined").
Defined at line 263 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h
bool Inlined (uint32_t v, FieldDescriptor::Type type)
Defined at line 272 of file ../../third_party/protobuf/src/google/protobuf/generated_message_reflection.h