struct ReflectionSchema

Defined at line 115 of file ../../third_party/protobuf/src/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 extensions_offset_
int oneof_case_offset_
int object_size_
int weak_field_map_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 118 of file ../../third_party/protobuf/src/src/google/protobuf/generated_message_reflection.h

bool InRealOneof (const FieldDescriptor * field)

Defined at line 120 of file ../../third_party/protobuf/src/src/google/protobuf/generated_message_reflection.h

template <typename Type = void>
uint32_t GetFieldOffset (const FieldDescriptor * field)

Offset of any field.

Defined at line 126 of file ../../third_party/protobuf/src/src/google/protobuf/generated_message_reflection.h

bool IsFieldInlined (const FieldDescriptor * field)

Defined at line 130 of file ../../third_party/protobuf/src/src/google/protobuf/generated_message_reflection.h

bool IsFieldMicroString (const FieldDescriptor * field)

Defined at line 134 of file ../../third_party/protobuf/src/src/google/protobuf/generated_message_reflection.h

uint32_t GetOneofCaseOffset (const OneofDescriptor * oneof_descriptor)

Defined at line 138 of file ../../third_party/protobuf/src/src/google/protobuf/generated_message_reflection.h

bool HasHasbits ()

Returns true iff the field object has usable hasbit offset.

Note that this is not necessarily correlated with *field presence* :

Fields with implicit presence (i.e. ones that don't expose has_foo API)

can still have hasbits in their underlying implementation.

Defined at line 149 of file ../../third_party/protobuf/src/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 152 of file ../../third_party/protobuf/src/src/google/protobuf/generated_message_reflection.h

uint32_t HasBitsOffset ()

Byte offset of the hasbits array.

Defined at line 160 of file ../../third_party/protobuf/src/src/google/protobuf/generated_message_reflection.h

bool HasExtensionSet ()

Whether this message has an ExtensionSet.

Defined at line 166 of file ../../third_party/protobuf/src/src/google/protobuf/generated_message_reflection.h

uint32_t GetExtensionSetOffset ()

The offset of the ExtensionSet in this message.

Defined at line 169 of file ../../third_party/protobuf/src/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 176 of file ../../third_party/protobuf/src/src/google/protobuf/generated_message_reflection.h

bool IsDefaultInstance (const Message & message)

Defined at line 178 of file ../../third_party/protobuf/src/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 184 of file ../../third_party/protobuf/src/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 190 of file ../../third_party/protobuf/src/src/google/protobuf/generated_message_reflection.h

bool IsSplit ()

Defined at line 196 of file ../../third_party/protobuf/src/src/google/protobuf/generated_message_reflection.h

bool IsSplit (const FieldDescriptor * field)

Defined at line 198 of file ../../third_party/protobuf/src/src/google/protobuf/generated_message_reflection.h

uint32_t SplitOffset ()

Byte offset of _split_.

Defined at line 204 of file ../../third_party/protobuf/src/src/google/protobuf/generated_message_reflection.h

uint32_t SizeofSplit ()

Defined at line 209 of file ../../third_party/protobuf/src/src/google/protobuf/generated_message_reflection.h

bool HasWeakFields ()

Defined at line 215 of file ../../third_party/protobuf/src/src/google/protobuf/generated_message_reflection.h

template <typename Type>
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 237 of file ../../third_party/protobuf/src/src/google/protobuf/generated_message_reflection.h

bool Inlined (uint32_t v, FieldDescriptor::Type type)

Defined at line 252 of file ../../third_party/protobuf/src/src/google/protobuf/generated_message_reflection.h

bool IsMicroString (uint32_t v, FieldDescriptor::Type type)

Defined at line 262 of file ../../third_party/protobuf/src/src/google/protobuf/generated_message_reflection.h