Devirtualize IsInitialized and move the implementation to a function pointer in ClassData.

Trivial messages that do not need this can leave the pointer as null.
This reduces binary size.

PiperOrigin-RevId: 625420851
pull/16528/head
Protobuf Team Bot 10 months ago committed by Copybara-Service
parent c7b9d540bd
commit d5210bb702
  1. 7
      src/google/protobuf/compiler/cpp/field.h
  2. 6
      src/google/protobuf/compiler/cpp/field_generators/map_field.cc
  3. 32
      src/google/protobuf/compiler/cpp/field_generators/message_field.cc
  4. 88
      src/google/protobuf/compiler/cpp/message.cc
  5. 1
      src/google/protobuf/compiler/cpp/message.h
  6. 4
      src/google/protobuf/compiler/java/java_features.pb.cc
  7. 5
      src/google/protobuf/compiler/java/java_features.pb.h
  8. 23
      src/google/protobuf/compiler/plugin.pb.cc
  9. 25
      src/google/protobuf/compiler/plugin.pb.h
  10. 4
      src/google/protobuf/cpp_features.pb.cc
  11. 5
      src/google/protobuf/cpp_features.pb.h
  12. 344
      src/google/protobuf/descriptor.pb.cc
  13. 285
      src/google/protobuf/descriptor.pb.h
  14. 1
      src/google/protobuf/dynamic_message.cc
  15. 1
      src/google/protobuf/generated_message_bases.h
  16. 1
      src/google/protobuf/implicit_weak_message.cc
  17. 2
      src/google/protobuf/implicit_weak_message.h
  18. 4
      src/google/protobuf/message.cc
  19. 7
      src/google/protobuf/message.h
  20. 5
      src/google/protobuf/message_lite.cc
  21. 14
      src/google/protobuf/message_lite.h

@ -182,7 +182,10 @@ class FieldGeneratorBase {
virtual void GenerateByteSize(io::Printer* p) const = 0;
virtual void GenerateIsInitialized(io::Printer* p) const {}
virtual void GenerateIsInitialized(io::Printer* p) const {
ABSL_CHECK(!NeedsIsInitialized());
}
virtual bool NeedsIsInitialized() const { return false; }
virtual bool IsInlined() const { return false; }
@ -474,6 +477,8 @@ class FieldGenerator {
impl_->GenerateIsInitialized(p);
}
bool NeedsIsInitialized() const { return impl_->NeedsIsInitialized(); }
// TODO: Document this properly.
bool IsInlined() const { return impl_->IsInlined(); }

@ -111,15 +111,17 @@ class Map : public FieldGeneratorBase {
}
void GenerateIsInitialized(io::Printer* p) const override {
if (!has_required_) return;
if (!NeedsIsInitialized()) return;
p->Emit(R"cc(
if (!$pbi$::AllAreInitialized($field_$)) {
if (!$pbi$::AllAreInitialized(this_.$field_$)) {
return false;
}
)cc");
}
bool NeedsIsInitialized() const override { return has_required_; }
void GenerateConstexprAggregateInitializer(io::Printer* p) const override {
p->Emit(R"cc(
/* decltype($field_$) */ {},

@ -116,6 +116,7 @@ class SingularMessage : public FieldGeneratorBase {
void GenerateSerializeWithCachedSizesToArray(io::Printer* p) const override;
void GenerateByteSize(io::Printer* p) const override;
void GenerateIsInitialized(io::Printer* p) const override;
bool NeedsIsInitialized() const override;
void GenerateConstexprAggregateInitializer(io::Printer* p) const override;
void GenerateAggregateInitializer(io::Printer* p) const override;
void GenerateCopyAggregateInitializer(io::Printer* p) const override;
@ -418,23 +419,25 @@ void SingularMessage::GenerateByteSize(io::Printer* p) const {
}
void SingularMessage::GenerateIsInitialized(io::Printer* p) const {
if (!has_required_) return;
if (!NeedsIsInitialized()) return;
if (HasHasbit(field_)) {
p->Emit(R"cc(
if (($has_hasbit$) != 0) {
if (!$field_$->IsInitialized()) return false;
if ((this_.$has_hasbit$) != 0) {
if (!this_.$field_$->IsInitialized()) return false;
}
)cc");
} else {
p->Emit(R"cc(
if (_internal_has_$name$()) {
if (!$field_$->IsInitialized()) return false;
if (this_._internal_has_$name$()) {
if (!this_.$field_$->IsInitialized()) return false;
}
)cc");
}
}
bool SingularMessage::NeedsIsInitialized() const { return has_required_; }
void SingularMessage::GenerateConstexprAggregateInitializer(
io::Printer* p) const {
p->Emit(R"cc(
@ -477,6 +480,7 @@ class OneofMessage : public SingularMessage {
void GenerateConstructorCode(io::Printer* p) const override;
void GenerateCopyConstructorCode(io::Printer* p) const override;
void GenerateIsInitialized(io::Printer* p) const override;
bool NeedsIsInitialized() const override;
void GenerateMergingCode(io::Printer* p) const override;
bool RequiresArena(GeneratorFunction func) const override;
};
@ -645,13 +649,16 @@ void OneofMessage::GenerateCopyConstructorCode(io::Printer* p) const {
}
void OneofMessage::GenerateIsInitialized(io::Printer* p) const {
if (!has_required_) return;
if (!NeedsIsInitialized()) return;
p->Emit(R"cc(
if ($has_field$ && !$field_$->IsInitialized()) return false;
if (this_.$has_field$ && !this_.$field_$->IsInitialized())
return false;
)cc");
}
bool OneofMessage::NeedsIsInitialized() const { return has_required_; }
void OneofMessage::GenerateMergingCode(io::Printer* p) const {
if (is_weak()) {
p->Emit(R"cc(
@ -706,6 +713,7 @@ class RepeatedMessage : public FieldGeneratorBase {
void GenerateSerializeWithCachedSizesToArray(io::Printer* p) const override;
void GenerateByteSize(io::Printer* p) const override;
void GenerateIsInitialized(io::Printer* p) const override;
bool NeedsIsInitialized() const override;
private:
const Options* opts_;
@ -995,20 +1003,24 @@ void RepeatedMessage::GenerateByteSize(io::Printer* p) const {
}
void RepeatedMessage::GenerateIsInitialized(io::Printer* p) const {
if (!has_required_) return;
if (!NeedsIsInitialized()) return;
if (is_weak()) {
p->Emit(
R"cc(
if (!$pbi$::AllAreInitializedWeak($field_$.weak)) return false;
if (!$pbi$::AllAreInitializedWeak(this_.$field_$.weak))
return false;
)cc");
} else {
p->Emit(
R"cc(
if (!$pbi$::AllAreInitialized(_internal_$name$())) return false;
if (!$pbi$::AllAreInitialized(this_._internal_$name$()))
return false;
)cc");
}
}
bool RepeatedMessage::NeedsIsInitialized() const { return has_required_; }
} // namespace
std::unique_ptr<FieldGeneratorBase> MakeSinguarMessageGenerator(

@ -1726,11 +1726,30 @@ void MessageGenerator::GenerateClassDefinition(io::Printer* p) {
)cc");
}
if (NeedsIsInitialized()) {
p->Emit(R"cc(
bool IsInitialized() const {
$WeakDescriptorSelfPin$;
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
)cc");
} else {
p->Emit(R"cc(
bool IsInitialized() const {
$WeakDescriptorSelfPin$;
return true;
}
)cc");
}
if (!HasSimpleBaseClass(descriptor_, options_)) {
p->Emit(R"cc(
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
::size_t ByteSizeLong() const final;
$uint8$* _InternalSerialize(
$uint8$* target,
@ -3515,6 +3534,17 @@ void MessageGenerator::GenerateClassData(io::Printer* p) {
)cc");
}
};
const auto is_initialized = [&] {
if (NeedsIsInitialized()) {
p->Emit(R"cc(
$classname$::IsInitializedImpl,
)cc");
} else {
p->Emit(R"cc(
nullptr, // IsInitialized
)cc");
}
};
if (HasDescriptorMethods(descriptor_->file(), options_)) {
const auto pin_weak_descriptor = [&] {
@ -3541,6 +3571,7 @@ void MessageGenerator::GenerateClassData(io::Printer* p) {
p->Emit(
{
{"on_demand_register_arena_dtor", on_demand_register_arena_dtor},
{"is_initialized", is_initialized},
{"pin_weak_descriptor", pin_weak_descriptor},
{"table",
[&] {
@ -3577,6 +3608,7 @@ void MessageGenerator::GenerateClassData(io::Printer* p) {
{
$table$,
$on_demand_register_arena_dtor$,
$is_initialized$,
PROTOBUF_FIELD_OFFSET($classname$, $cached_size$),
false,
},
@ -3595,6 +3627,7 @@ void MessageGenerator::GenerateClassData(io::Printer* p) {
{
{"type_size", descriptor_->full_name().size() + 1},
{"on_demand_register_arena_dtor", on_demand_register_arena_dtor},
{"is_initialized", is_initialized},
},
R"cc(
const ::$proto_ns$::MessageLite::ClassData*
@ -3604,6 +3637,7 @@ void MessageGenerator::GenerateClassData(io::Printer* p) {
{
&_table_.header,
$on_demand_register_arena_dtor$,
$is_initialized$,
PROTOBUF_FIELD_OFFSET($classname$, $cached_size$),
true,
},
@ -4631,8 +4665,27 @@ void MessageGenerator::GenerateByteSize(io::Printer* p) {
format("}\n");
}
bool MessageGenerator::NeedsIsInitialized() {
if (HasSimpleBaseClass(descriptor_, options_)) return false;
if (descriptor_->extension_range_count() != 0) return true;
if (num_required_fields_ != 0) return true;
for (const auto* field : optimized_order_) {
if (field_generators_.get(field).NeedsIsInitialized()) return true;
}
if (num_weak_fields_ != 0) return true;
for (const auto* oneof : OneOfRange(descriptor_)) {
for (const auto* field : FieldRange(oneof)) {
if (field_generators_.get(field).NeedsIsInitialized()) return true;
}
}
return false;
}
void MessageGenerator::GenerateIsInitialized(io::Printer* p) {
if (HasSimpleBaseClass(descriptor_, options_)) return;
if (!NeedsIsInitialized()) return;
auto has_required_field = [&](const auto* oneof) {
for (const auto* field : FieldRange(oneof)) {
@ -4651,7 +4704,8 @@ void MessageGenerator::GenerateIsInitialized(io::Printer* p) {
[&] {
if (descriptor_->extension_range_count() == 0) return;
p->Emit(R"cc(
if (!$extensions$.IsInitialized(internal_default_instance())) {
if (!this_.$extensions$.IsInitialized(
internal_default_instance())) {
return false;
}
)cc");
@ -4660,7 +4714,7 @@ void MessageGenerator::GenerateIsInitialized(io::Printer* p) {
[&] {
if (num_required_fields_ == 0) return;
p->Emit(R"cc(
if (_Internal::MissingRequiredFields($has_bits$)) {
if (_Internal::MissingRequiredFields(this_.$has_bits$)) {
return false;
}
)cc");
@ -4668,14 +4722,27 @@ void MessageGenerator::GenerateIsInitialized(io::Printer* p) {
{"test_ordinary_fields",
[&] {
for (const auto* field : optimized_order_) {
field_generators_.get(field).GenerateIsInitialized(p);
auto& f = field_generators_.get(field);
// XXX REMOVE? XXX
const auto needs_verifier =
!f.NeedsIsInitialized()
? absl::make_optional(p->WithSubstitutionListener(
[&](auto label, auto loc) {
ABSL_LOG(FATAL)
<< "Field generated output but is marked as "
"!NeedsIsInitialized"
<< field->full_name();
}))
: absl::nullopt;
f.GenerateIsInitialized(p);
}
}},
{"test_weak_fields",
[&] {
if (num_weak_fields_ == 0) return;
p->Emit(R"cc(
if (!$weak_field_map$.IsInitialized()) return false;
if (!this_.$weak_field_map$.IsInitialized())
return false;
)cc");
}},
{"test_oneof_fields",
@ -4703,7 +4770,7 @@ void MessageGenerator::GenerateIsInitialized(io::Printer* p) {
}
}}},
R"cc(
switch ($name$_case()) {
switch (this_.$name$_case()) {
$cases$;
case $NAME$_NOT_SET: {
break;
@ -4714,8 +4781,9 @@ void MessageGenerator::GenerateIsInitialized(io::Printer* p) {
}},
},
R"cc(
PROTOBUF_NOINLINE bool $classname$::IsInitialized() const {
$WeakDescriptorSelfPin$;
PROTOBUF_NOINLINE bool $classname$::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const $classname$&>(msg);
$test_extensions$;
$test_required_fields$;
$test_ordinary_fields$;

@ -131,6 +131,7 @@ class MessageGenerator {
void GenerateCopyFrom(io::Printer* p);
void GenerateSwap(io::Printer* p);
void GenerateIsInitialized(io::Printer* p);
bool NeedsIsInitialized();
// Helpers for GenerateSerializeWithCachedSizes().
//

@ -189,6 +189,7 @@ JavaFeatures::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
nullptr, // IsInitialized
PROTOBUF_FIELD_OFFSET(JavaFeatures, _impl_._cached_size_),
false,
},
@ -344,9 +345,6 @@ void JavaFeatures::CopyFrom(const JavaFeatures& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool JavaFeatures::IsInitialized() const {
return true;
}
void JavaFeatures::InternalSwap(JavaFeatures* PROTOBUF_RESTRICT other) {
using std::swap;

@ -189,9 +189,10 @@ class PROTOC_EXPORT JavaFeatures final : public ::google::protobuf::Message
const ::google::protobuf::MessageLite& from_msg);
public:
bool IsInitialized() const {
return true;
}
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,

@ -365,6 +365,7 @@ Version::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
nullptr, // IsInitialized
PROTOBUF_FIELD_OFFSET(Version, _impl_._cached_size_),
false,
},
@ -572,9 +573,6 @@ void Version::CopyFrom(const Version& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool Version::IsInitialized() const {
return true;
}
void Version::InternalSwap(Version* PROTOBUF_RESTRICT other) {
using std::swap;
@ -674,6 +672,7 @@ CodeGeneratorRequest::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
CodeGeneratorRequest::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(CodeGeneratorRequest, _impl_._cached_size_),
false,
},
@ -920,9 +919,13 @@ void CodeGeneratorRequest::CopyFrom(const CodeGeneratorRequest& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool CodeGeneratorRequest::IsInitialized() const {
if (!::google::protobuf::internal::AllAreInitialized(_internal_proto_file())) return false;
if (!::google::protobuf::internal::AllAreInitialized(_internal_source_file_descriptors())) return false;
PROTOBUF_NOINLINE bool CodeGeneratorRequest::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const CodeGeneratorRequest&>(msg);
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_proto_file()))
return false;
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_source_file_descriptors()))
return false;
return true;
}
@ -1019,6 +1022,7 @@ CodeGeneratorResponse_File::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
nullptr, // IsInitialized
PROTOBUF_FIELD_OFFSET(CodeGeneratorResponse_File, _impl_._cached_size_),
false,
},
@ -1243,9 +1247,6 @@ void CodeGeneratorResponse_File::CopyFrom(const CodeGeneratorResponse_File& from
MergeFrom(from);
}
PROTOBUF_NOINLINE bool CodeGeneratorResponse_File::IsInitialized() const {
return true;
}
void CodeGeneratorResponse_File::InternalSwap(CodeGeneratorResponse_File* PROTOBUF_RESTRICT other) {
using std::swap;
@ -1337,6 +1338,7 @@ CodeGeneratorResponse::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
nullptr, // IsInitialized
PROTOBUF_FIELD_OFFSET(CodeGeneratorResponse, _impl_._cached_size_),
false,
},
@ -1572,9 +1574,6 @@ void CodeGeneratorResponse::CopyFrom(const CodeGeneratorResponse& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool CodeGeneratorResponse::IsInitialized() const {
return true;
}
void CodeGeneratorResponse::InternalSwap(CodeGeneratorResponse* PROTOBUF_RESTRICT other) {
using std::swap;

@ -206,9 +206,10 @@ class PROTOC_EXPORT Version final : public ::google::protobuf::Message
const ::google::protobuf::MessageLite& from_msg);
public:
bool IsInitialized() const {
return true;
}
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -423,9 +424,10 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final : public ::google::protobuf
const ::google::protobuf::MessageLite& from_msg);
public:
bool IsInitialized() const {
return true;
}
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -656,9 +658,10 @@ class PROTOC_EXPORT CodeGeneratorResponse final : public ::google::protobuf::Mes
const ::google::protobuf::MessageLite& from_msg);
public:
bool IsInitialized() const {
return true;
}
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -913,9 +916,15 @@ class PROTOC_EXPORT CodeGeneratorRequest final : public ::google::protobuf::Mess
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,

@ -184,6 +184,7 @@ CppFeatures::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
nullptr, // IsInitialized
PROTOBUF_FIELD_OFFSET(CppFeatures, _impl_._cached_size_),
false,
},
@ -339,9 +340,6 @@ void CppFeatures::CopyFrom(const CppFeatures& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool CppFeatures::IsInitialized() const {
return true;
}
void CppFeatures::InternalSwap(CppFeatures* PROTOBUF_RESTRICT other) {
using std::swap;

@ -190,9 +190,10 @@ class PROTOBUF_EXPORT CppFeatures final : public ::google::protobuf::Message
const ::google::protobuf::MessageLite& from_msg);
public:
bool IsInitialized() const {
return true;
}
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,

@ -2454,6 +2454,7 @@ FileDescriptorSet::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
FileDescriptorSet::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(FileDescriptorSet, _impl_._cached_size_),
false,
},
@ -2575,8 +2576,11 @@ void FileDescriptorSet::CopyFrom(const FileDescriptorSet& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool FileDescriptorSet::IsInitialized() const {
if (!::google::protobuf::internal::AllAreInitialized(_internal_file())) return false;
PROTOBUF_NOINLINE bool FileDescriptorSet::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const FileDescriptorSet&>(msg);
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_file()))
return false;
return true;
}
@ -2685,6 +2689,7 @@ FileDescriptorProto::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
FileDescriptorProto::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(FileDescriptorProto, _impl_._cached_size_),
false,
},
@ -3144,13 +3149,19 @@ void FileDescriptorProto::CopyFrom(const FileDescriptorProto& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool FileDescriptorProto::IsInitialized() const {
if (!::google::protobuf::internal::AllAreInitialized(_internal_message_type())) return false;
if (!::google::protobuf::internal::AllAreInitialized(_internal_enum_type())) return false;
if (!::google::protobuf::internal::AllAreInitialized(_internal_service())) return false;
if (!::google::protobuf::internal::AllAreInitialized(_internal_extension())) return false;
if ((_impl_._has_bits_[0] & 0x00000008u) != 0) {
if (!_impl_.options_->IsInitialized()) return false;
PROTOBUF_NOINLINE bool FileDescriptorProto::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const FileDescriptorProto&>(msg);
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_message_type()))
return false;
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_enum_type()))
return false;
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_service()))
return false;
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_extension()))
return false;
if ((this_._impl_._has_bits_[0] & 0x00000008u) != 0) {
if (!this_._impl_.options_->IsInitialized()) return false;
}
return true;
}
@ -3257,6 +3268,7 @@ DescriptorProto_ExtensionRange::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
DescriptorProto_ExtensionRange::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(DescriptorProto_ExtensionRange, _impl_._cached_size_),
false,
},
@ -3445,9 +3457,11 @@ void DescriptorProto_ExtensionRange::CopyFrom(const DescriptorProto_ExtensionRan
MergeFrom(from);
}
PROTOBUF_NOINLINE bool DescriptorProto_ExtensionRange::IsInitialized() const {
if ((_impl_._has_bits_[0] & 0x00000001u) != 0) {
if (!_impl_.options_->IsInitialized()) return false;
PROTOBUF_NOINLINE bool DescriptorProto_ExtensionRange::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const DescriptorProto_ExtensionRange&>(msg);
if ((this_._impl_._has_bits_[0] & 0x00000001u) != 0) {
if (!this_._impl_.options_->IsInitialized()) return false;
}
return true;
}
@ -3517,6 +3531,7 @@ DescriptorProto_ReservedRange::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
nullptr, // IsInitialized
PROTOBUF_FIELD_OFFSET(DescriptorProto_ReservedRange, _impl_._cached_size_),
false,
},
@ -3672,9 +3687,6 @@ void DescriptorProto_ReservedRange::CopyFrom(const DescriptorProto_ReservedRange
MergeFrom(from);
}
PROTOBUF_NOINLINE bool DescriptorProto_ReservedRange::IsInitialized() const {
return true;
}
void DescriptorProto_ReservedRange::InternalSwap(DescriptorProto_ReservedRange* PROTOBUF_RESTRICT other) {
using std::swap;
@ -3773,6 +3785,7 @@ DescriptorProto::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
DescriptorProto::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(DescriptorProto, _impl_._cached_size_),
false,
},
@ -4153,15 +4166,23 @@ void DescriptorProto::CopyFrom(const DescriptorProto& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool DescriptorProto::IsInitialized() const {
if (!::google::protobuf::internal::AllAreInitialized(_internal_field())) return false;
if (!::google::protobuf::internal::AllAreInitialized(_internal_nested_type())) return false;
if (!::google::protobuf::internal::AllAreInitialized(_internal_enum_type())) return false;
if (!::google::protobuf::internal::AllAreInitialized(_internal_extension_range())) return false;
if (!::google::protobuf::internal::AllAreInitialized(_internal_extension())) return false;
if (!::google::protobuf::internal::AllAreInitialized(_internal_oneof_decl())) return false;
if ((_impl_._has_bits_[0] & 0x00000002u) != 0) {
if (!_impl_.options_->IsInitialized()) return false;
PROTOBUF_NOINLINE bool DescriptorProto::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const DescriptorProto&>(msg);
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_field()))
return false;
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_nested_type()))
return false;
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_enum_type()))
return false;
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_extension_range()))
return false;
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_extension()))
return false;
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_oneof_decl()))
return false;
if ((this_._impl_._has_bits_[0] & 0x00000002u) != 0) {
if (!this_._impl_.options_->IsInitialized()) return false;
}
return true;
}
@ -4263,6 +4284,7 @@ ExtensionRangeOptions_Declaration::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
nullptr, // IsInitialized
PROTOBUF_FIELD_OFFSET(ExtensionRangeOptions_Declaration, _impl_._cached_size_),
false,
},
@ -4499,9 +4521,6 @@ void ExtensionRangeOptions_Declaration::CopyFrom(const ExtensionRangeOptions_Dec
MergeFrom(from);
}
PROTOBUF_NOINLINE bool ExtensionRangeOptions_Declaration::IsInitialized() const {
return true;
}
void ExtensionRangeOptions_Declaration::InternalSwap(ExtensionRangeOptions_Declaration* PROTOBUF_RESTRICT other) {
using std::swap;
@ -4594,6 +4613,7 @@ ExtensionRangeOptions::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
ExtensionRangeOptions::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(ExtensionRangeOptions, _impl_._cached_size_),
false,
},
@ -4822,13 +4842,17 @@ void ExtensionRangeOptions::CopyFrom(const ExtensionRangeOptions& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool ExtensionRangeOptions::IsInitialized() const {
if (!_impl_._extensions_.IsInitialized(internal_default_instance())) {
PROTOBUF_NOINLINE bool ExtensionRangeOptions::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const ExtensionRangeOptions&>(msg);
if (!this_._impl_._extensions_.IsInitialized(
internal_default_instance())) {
return false;
}
if (!::google::protobuf::internal::AllAreInitialized(_internal_uninterpreted_option())) return false;
if ((_impl_._has_bits_[0] & 0x00000001u) != 0) {
if (!_impl_.features_->IsInitialized()) return false;
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_uninterpreted_option()))
return false;
if ((this_._impl_._has_bits_[0] & 0x00000001u) != 0) {
if (!this_._impl_.features_->IsInitialized()) return false;
}
return true;
}
@ -4943,6 +4967,7 @@ FieldDescriptorProto::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
FieldDescriptorProto::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(FieldDescriptorProto, _impl_._cached_size_),
false,
},
@ -5348,9 +5373,11 @@ void FieldDescriptorProto::CopyFrom(const FieldDescriptorProto& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool FieldDescriptorProto::IsInitialized() const {
if ((_impl_._has_bits_[0] & 0x00000020u) != 0) {
if (!_impl_.options_->IsInitialized()) return false;
PROTOBUF_NOINLINE bool FieldDescriptorProto::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const FieldDescriptorProto&>(msg);
if ((this_._impl_._has_bits_[0] & 0x00000020u) != 0) {
if (!this_._impl_.options_->IsInitialized()) return false;
}
return true;
}
@ -5443,6 +5470,7 @@ OneofDescriptorProto::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
OneofDescriptorProto::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(OneofDescriptorProto, _impl_._cached_size_),
false,
},
@ -5612,9 +5640,11 @@ void OneofDescriptorProto::CopyFrom(const OneofDescriptorProto& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool OneofDescriptorProto::IsInitialized() const {
if ((_impl_._has_bits_[0] & 0x00000002u) != 0) {
if (!_impl_.options_->IsInitialized()) return false;
PROTOBUF_NOINLINE bool OneofDescriptorProto::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const OneofDescriptorProto&>(msg);
if ((this_._impl_._has_bits_[0] & 0x00000002u) != 0) {
if (!this_._impl_.options_->IsInitialized()) return false;
}
return true;
}
@ -5682,6 +5712,7 @@ EnumDescriptorProto_EnumReservedRange::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
nullptr, // IsInitialized
PROTOBUF_FIELD_OFFSET(EnumDescriptorProto_EnumReservedRange, _impl_._cached_size_),
false,
},
@ -5837,9 +5868,6 @@ void EnumDescriptorProto_EnumReservedRange::CopyFrom(const EnumDescriptorProto_E
MergeFrom(from);
}
PROTOBUF_NOINLINE bool EnumDescriptorProto_EnumReservedRange::IsInitialized() const {
return true;
}
void EnumDescriptorProto_EnumReservedRange::InternalSwap(EnumDescriptorProto_EnumReservedRange* PROTOBUF_RESTRICT other) {
using std::swap;
@ -5928,6 +5956,7 @@ EnumDescriptorProto::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
EnumDescriptorProto::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(EnumDescriptorProto, _impl_._cached_size_),
false,
},
@ -6175,10 +6204,13 @@ void EnumDescriptorProto::CopyFrom(const EnumDescriptorProto& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool EnumDescriptorProto::IsInitialized() const {
if (!::google::protobuf::internal::AllAreInitialized(_internal_value())) return false;
if ((_impl_._has_bits_[0] & 0x00000002u) != 0) {
if (!_impl_.options_->IsInitialized()) return false;
PROTOBUF_NOINLINE bool EnumDescriptorProto::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const EnumDescriptorProto&>(msg);
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_value()))
return false;
if ((this_._impl_._has_bits_[0] & 0x00000002u) != 0) {
if (!this_._impl_.options_->IsInitialized()) return false;
}
return true;
}
@ -6271,6 +6303,7 @@ EnumValueDescriptorProto::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
EnumValueDescriptorProto::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(EnumValueDescriptorProto, _impl_._cached_size_),
false,
},
@ -6464,9 +6497,11 @@ void EnumValueDescriptorProto::CopyFrom(const EnumValueDescriptorProto& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool EnumValueDescriptorProto::IsInitialized() const {
if ((_impl_._has_bits_[0] & 0x00000002u) != 0) {
if (!_impl_.options_->IsInitialized()) return false;
PROTOBUF_NOINLINE bool EnumValueDescriptorProto::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const EnumValueDescriptorProto&>(msg);
if ((this_._impl_._has_bits_[0] & 0x00000002u) != 0) {
if (!this_._impl_.options_->IsInitialized()) return false;
}
return true;
}
@ -6557,6 +6592,7 @@ ServiceDescriptorProto::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
ServiceDescriptorProto::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(ServiceDescriptorProto, _impl_._cached_size_),
false,
},
@ -6753,10 +6789,13 @@ void ServiceDescriptorProto::CopyFrom(const ServiceDescriptorProto& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool ServiceDescriptorProto::IsInitialized() const {
if (!::google::protobuf::internal::AllAreInitialized(_internal_method())) return false;
if ((_impl_._has_bits_[0] & 0x00000002u) != 0) {
if (!_impl_.options_->IsInitialized()) return false;
PROTOBUF_NOINLINE bool ServiceDescriptorProto::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const ServiceDescriptorProto&>(msg);
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_method()))
return false;
if ((this_._impl_._has_bits_[0] & 0x00000002u) != 0) {
if (!this_._impl_.options_->IsInitialized()) return false;
}
return true;
}
@ -6859,6 +6898,7 @@ MethodDescriptorProto::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
MethodDescriptorProto::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(MethodDescriptorProto, _impl_._cached_size_),
false,
},
@ -7129,9 +7169,11 @@ void MethodDescriptorProto::CopyFrom(const MethodDescriptorProto& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool MethodDescriptorProto::IsInitialized() const {
if ((_impl_._has_bits_[0] & 0x00000008u) != 0) {
if (!_impl_.options_->IsInitialized()) return false;
PROTOBUF_NOINLINE bool MethodDescriptorProto::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const MethodDescriptorProto&>(msg);
if ((this_._impl_._has_bits_[0] & 0x00000008u) != 0) {
if (!this_._impl_.options_->IsInitialized()) return false;
}
return true;
}
@ -7268,6 +7310,7 @@ FileOptions::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
FileOptions::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(FileOptions, _impl_._cached_size_),
false,
},
@ -7932,13 +7975,17 @@ void FileOptions::CopyFrom(const FileOptions& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool FileOptions::IsInitialized() const {
if (!_impl_._extensions_.IsInitialized(internal_default_instance())) {
PROTOBUF_NOINLINE bool FileOptions::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const FileOptions&>(msg);
if (!this_._impl_._extensions_.IsInitialized(
internal_default_instance())) {
return false;
}
if (!::google::protobuf::internal::AllAreInitialized(_internal_uninterpreted_option())) return false;
if ((_impl_._has_bits_[0] & 0x00000400u) != 0) {
if (!_impl_.features_->IsInitialized()) return false;
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_uninterpreted_option()))
return false;
if ((this_._impl_._has_bits_[0] & 0x00000400u) != 0) {
if (!this_._impl_.features_->IsInitialized()) return false;
}
return true;
}
@ -8052,6 +8099,7 @@ MessageOptions::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
MessageOptions::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(MessageOptions, _impl_._cached_size_),
false,
},
@ -8332,13 +8380,17 @@ void MessageOptions::CopyFrom(const MessageOptions& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool MessageOptions::IsInitialized() const {
if (!_impl_._extensions_.IsInitialized(internal_default_instance())) {
PROTOBUF_NOINLINE bool MessageOptions::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const MessageOptions&>(msg);
if (!this_._impl_._extensions_.IsInitialized(
internal_default_instance())) {
return false;
}
if (!::google::protobuf::internal::AllAreInitialized(_internal_uninterpreted_option())) return false;
if ((_impl_._has_bits_[0] & 0x00000001u) != 0) {
if (!_impl_.features_->IsInitialized()) return false;
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_uninterpreted_option()))
return false;
if ((this_._impl_._has_bits_[0] & 0x00000001u) != 0) {
if (!this_._impl_.features_->IsInitialized()) return false;
}
return true;
}
@ -8422,6 +8474,7 @@ FieldOptions_EditionDefault::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
nullptr, // IsInitialized
PROTOBUF_FIELD_OFFSET(FieldOptions_EditionDefault, _impl_._cached_size_),
false,
},
@ -8580,9 +8633,6 @@ void FieldOptions_EditionDefault::CopyFrom(const FieldOptions_EditionDefault& fr
MergeFrom(from);
}
PROTOBUF_NOINLINE bool FieldOptions_EditionDefault::IsInitialized() const {
return true;
}
void FieldOptions_EditionDefault::InternalSwap(FieldOptions_EditionDefault* PROTOBUF_RESTRICT other) {
using std::swap;
@ -8670,6 +8720,7 @@ FieldOptions_FeatureSupport::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
nullptr, // IsInitialized
PROTOBUF_FIELD_OFFSET(FieldOptions_FeatureSupport, _impl_._cached_size_),
false,
},
@ -8878,9 +8929,6 @@ void FieldOptions_FeatureSupport::CopyFrom(const FieldOptions_FeatureSupport& fr
MergeFrom(from);
}
PROTOBUF_NOINLINE bool FieldOptions_FeatureSupport::IsInitialized() const {
return true;
}
void FieldOptions_FeatureSupport::InternalSwap(FieldOptions_FeatureSupport* PROTOBUF_RESTRICT other) {
using std::swap;
@ -8988,6 +9036,7 @@ FieldOptions::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
FieldOptions::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(FieldOptions, _impl_._cached_size_),
false,
},
@ -9453,13 +9502,17 @@ void FieldOptions::CopyFrom(const FieldOptions& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool FieldOptions::IsInitialized() const {
if (!_impl_._extensions_.IsInitialized(internal_default_instance())) {
PROTOBUF_NOINLINE bool FieldOptions::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const FieldOptions&>(msg);
if (!this_._impl_._extensions_.IsInitialized(
internal_default_instance())) {
return false;
}
if (!::google::protobuf::internal::AllAreInitialized(_internal_uninterpreted_option())) return false;
if ((_impl_._has_bits_[0] & 0x00000001u) != 0) {
if (!_impl_.features_->IsInitialized()) return false;
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_uninterpreted_option()))
return false;
if ((this_._impl_._has_bits_[0] & 0x00000001u) != 0) {
if (!this_._impl_.features_->IsInitialized()) return false;
}
return true;
}
@ -9551,6 +9604,7 @@ OneofOptions::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
OneofOptions::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(OneofOptions, _impl_._cached_size_),
false,
},
@ -9722,13 +9776,17 @@ void OneofOptions::CopyFrom(const OneofOptions& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool OneofOptions::IsInitialized() const {
if (!_impl_._extensions_.IsInitialized(internal_default_instance())) {
PROTOBUF_NOINLINE bool OneofOptions::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const OneofOptions&>(msg);
if (!this_._impl_._extensions_.IsInitialized(
internal_default_instance())) {
return false;
}
if (!::google::protobuf::internal::AllAreInitialized(_internal_uninterpreted_option())) return false;
if ((_impl_._has_bits_[0] & 0x00000001u) != 0) {
if (!_impl_.features_->IsInitialized()) return false;
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_uninterpreted_option()))
return false;
if ((this_._impl_._has_bits_[0] & 0x00000001u) != 0) {
if (!this_._impl_.features_->IsInitialized()) return false;
}
return true;
}
@ -9825,6 +9883,7 @@ EnumOptions::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
EnumOptions::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(EnumOptions, _impl_._cached_size_),
false,
},
@ -10065,13 +10124,17 @@ void EnumOptions::CopyFrom(const EnumOptions& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool EnumOptions::IsInitialized() const {
if (!_impl_._extensions_.IsInitialized(internal_default_instance())) {
PROTOBUF_NOINLINE bool EnumOptions::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const EnumOptions&>(msg);
if (!this_._impl_._extensions_.IsInitialized(
internal_default_instance())) {
return false;
}
if (!::google::protobuf::internal::AllAreInitialized(_internal_uninterpreted_option())) return false;
if ((_impl_._has_bits_[0] & 0x00000001u) != 0) {
if (!_impl_.features_->IsInitialized()) return false;
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_uninterpreted_option()))
return false;
if ((this_._impl_._has_bits_[0] & 0x00000001u) != 0) {
if (!this_._impl_.features_->IsInitialized()) return false;
}
return true;
}
@ -10173,6 +10236,7 @@ EnumValueOptions::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
EnumValueOptions::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(EnumValueOptions, _impl_._cached_size_),
false,
},
@ -10395,13 +10459,17 @@ void EnumValueOptions::CopyFrom(const EnumValueOptions& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool EnumValueOptions::IsInitialized() const {
if (!_impl_._extensions_.IsInitialized(internal_default_instance())) {
PROTOBUF_NOINLINE bool EnumValueOptions::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const EnumValueOptions&>(msg);
if (!this_._impl_._extensions_.IsInitialized(
internal_default_instance())) {
return false;
}
if (!::google::protobuf::internal::AllAreInitialized(_internal_uninterpreted_option())) return false;
if ((_impl_._has_bits_[0] & 0x00000001u) != 0) {
if (!_impl_.features_->IsInitialized()) return false;
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_uninterpreted_option()))
return false;
if ((this_._impl_._has_bits_[0] & 0x00000001u) != 0) {
if (!this_._impl_.features_->IsInitialized()) return false;
}
return true;
}
@ -10497,6 +10565,7 @@ ServiceOptions::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
ServiceOptions::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(ServiceOptions, _impl_._cached_size_),
false,
},
@ -10694,13 +10763,17 @@ void ServiceOptions::CopyFrom(const ServiceOptions& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool ServiceOptions::IsInitialized() const {
if (!_impl_._extensions_.IsInitialized(internal_default_instance())) {
PROTOBUF_NOINLINE bool ServiceOptions::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const ServiceOptions&>(msg);
if (!this_._impl_._extensions_.IsInitialized(
internal_default_instance())) {
return false;
}
if (!::google::protobuf::internal::AllAreInitialized(_internal_uninterpreted_option())) return false;
if ((_impl_._has_bits_[0] & 0x00000001u) != 0) {
if (!_impl_.features_->IsInitialized()) return false;
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_uninterpreted_option()))
return false;
if ((this_._impl_._has_bits_[0] & 0x00000001u) != 0) {
if (!this_._impl_.features_->IsInitialized()) return false;
}
return true;
}
@ -10802,6 +10875,7 @@ MethodOptions::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
MethodOptions::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(MethodOptions, _impl_._cached_size_),
false,
},
@ -11029,13 +11103,17 @@ void MethodOptions::CopyFrom(const MethodOptions& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool MethodOptions::IsInitialized() const {
if (!_impl_._extensions_.IsInitialized(internal_default_instance())) {
PROTOBUF_NOINLINE bool MethodOptions::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const MethodOptions&>(msg);
if (!this_._impl_._extensions_.IsInitialized(
internal_default_instance())) {
return false;
}
if (!::google::protobuf::internal::AllAreInitialized(_internal_uninterpreted_option())) return false;
if ((_impl_._has_bits_[0] & 0x00000001u) != 0) {
if (!_impl_.features_->IsInitialized()) return false;
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_uninterpreted_option()))
return false;
if ((this_._impl_._has_bits_[0] & 0x00000001u) != 0) {
if (!this_._impl_.features_->IsInitialized()) return false;
}
return true;
}
@ -11122,6 +11200,7 @@ UninterpretedOption_NamePart::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
UninterpretedOption_NamePart::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(UninterpretedOption_NamePart, _impl_._cached_size_),
false,
},
@ -11279,8 +11358,10 @@ void UninterpretedOption_NamePart::CopyFrom(const UninterpretedOption_NamePart&
MergeFrom(from);
}
PROTOBUF_NOINLINE bool UninterpretedOption_NamePart::IsInitialized() const {
if (_Internal::MissingRequiredFields(_impl_._has_bits_)) {
PROTOBUF_NOINLINE bool UninterpretedOption_NamePart::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const UninterpretedOption_NamePart&>(msg);
if (_Internal::MissingRequiredFields(this_._impl_._has_bits_)) {
return false;
}
return true;
@ -11380,6 +11461,7 @@ UninterpretedOption::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
UninterpretedOption::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(UninterpretedOption, _impl_._cached_size_),
false,
},
@ -11664,8 +11746,11 @@ void UninterpretedOption::CopyFrom(const UninterpretedOption& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool UninterpretedOption::IsInitialized() const {
if (!::google::protobuf::internal::AllAreInitialized(_internal_name())) return false;
PROTOBUF_NOINLINE bool UninterpretedOption::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const UninterpretedOption&>(msg);
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_name()))
return false;
return true;
}
@ -11763,6 +11848,7 @@ FeatureSet::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
FeatureSet::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(FeatureSet, _impl_._cached_size_),
false,
},
@ -12020,8 +12106,11 @@ void FeatureSet::CopyFrom(const FeatureSet& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool FeatureSet::IsInitialized() const {
if (!_impl_._extensions_.IsInitialized(internal_default_instance())) {
PROTOBUF_NOINLINE bool FeatureSet::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const FeatureSet&>(msg);
if (!this_._impl_._extensions_.IsInitialized(
internal_default_instance())) {
return false;
}
return true;
@ -12120,6 +12209,7 @@ FeatureSetDefaults_FeatureSetEditionDefault::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
FeatureSetDefaults_FeatureSetEditionDefault::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(FeatureSetDefaults_FeatureSetEditionDefault, _impl_._cached_size_),
false,
},
@ -12348,15 +12438,17 @@ void FeatureSetDefaults_FeatureSetEditionDefault::CopyFrom(const FeatureSetDefau
MergeFrom(from);
}
PROTOBUF_NOINLINE bool FeatureSetDefaults_FeatureSetEditionDefault::IsInitialized() const {
if ((_impl_._has_bits_[0] & 0x00000001u) != 0) {
if (!_impl_.features_->IsInitialized()) return false;
PROTOBUF_NOINLINE bool FeatureSetDefaults_FeatureSetEditionDefault::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const FeatureSetDefaults_FeatureSetEditionDefault&>(msg);
if ((this_._impl_._has_bits_[0] & 0x00000001u) != 0) {
if (!this_._impl_.features_->IsInitialized()) return false;
}
if ((_impl_._has_bits_[0] & 0x00000002u) != 0) {
if (!_impl_.overridable_features_->IsInitialized()) return false;
if ((this_._impl_._has_bits_[0] & 0x00000002u) != 0) {
if (!this_._impl_.overridable_features_->IsInitialized()) return false;
}
if ((_impl_._has_bits_[0] & 0x00000004u) != 0) {
if (!_impl_.fixed_features_->IsInitialized()) return false;
if ((this_._impl_._has_bits_[0] & 0x00000004u) != 0) {
if (!this_._impl_.fixed_features_->IsInitialized()) return false;
}
return true;
}
@ -12448,6 +12540,7 @@ FeatureSetDefaults::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
FeatureSetDefaults::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(FeatureSetDefaults, _impl_._cached_size_),
false,
},
@ -12627,8 +12720,11 @@ void FeatureSetDefaults::CopyFrom(const FeatureSetDefaults& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool FeatureSetDefaults::IsInitialized() const {
if (!::google::protobuf::internal::AllAreInitialized(_internal_defaults())) return false;
PROTOBUF_NOINLINE bool FeatureSetDefaults::IsInitializedImpl(
const MessageLite& msg) {
auto& this_ = static_cast<const FeatureSetDefaults&>(msg);
if (!::google::protobuf::internal::AllAreInitialized(this_._internal_defaults()))
return false;
return true;
}
@ -12721,6 +12817,7 @@ SourceCodeInfo_Location::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
nullptr, // IsInitialized
PROTOBUF_FIELD_OFFSET(SourceCodeInfo_Location, _impl_._cached_size_),
false,
},
@ -12971,9 +13068,6 @@ void SourceCodeInfo_Location::CopyFrom(const SourceCodeInfo_Location& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool SourceCodeInfo_Location::IsInitialized() const {
return true;
}
void SourceCodeInfo_Location::InternalSwap(SourceCodeInfo_Location* PROTOBUF_RESTRICT other) {
using std::swap;
@ -13046,6 +13140,7 @@ SourceCodeInfo::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
nullptr, // IsInitialized
PROTOBUF_FIELD_OFFSET(SourceCodeInfo, _impl_._cached_size_),
false,
},
@ -13167,9 +13262,6 @@ void SourceCodeInfo::CopyFrom(const SourceCodeInfo& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool SourceCodeInfo::IsInitialized() const {
return true;
}
void SourceCodeInfo::InternalSwap(SourceCodeInfo* PROTOBUF_RESTRICT other) {
using std::swap;
@ -13257,6 +13349,7 @@ GeneratedCodeInfo_Annotation::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
nullptr, // IsInitialized
PROTOBUF_FIELD_OFFSET(GeneratedCodeInfo_Annotation, _impl_._cached_size_),
false,
},
@ -13496,9 +13589,6 @@ void GeneratedCodeInfo_Annotation::CopyFrom(const GeneratedCodeInfo_Annotation&
MergeFrom(from);
}
PROTOBUF_NOINLINE bool GeneratedCodeInfo_Annotation::IsInitialized() const {
return true;
}
void GeneratedCodeInfo_Annotation::InternalSwap(GeneratedCodeInfo_Annotation* PROTOBUF_RESTRICT other) {
using std::swap;
@ -13574,6 +13664,7 @@ GeneratedCodeInfo::GetClassData() const {
{
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
nullptr, // IsInitialized
PROTOBUF_FIELD_OFFSET(GeneratedCodeInfo, _impl_._cached_size_),
false,
},
@ -13695,9 +13786,6 @@ void GeneratedCodeInfo::CopyFrom(const GeneratedCodeInfo& from) {
MergeFrom(from);
}
PROTOBUF_NOINLINE bool GeneratedCodeInfo::IsInitialized() const {
return true;
}
void GeneratedCodeInfo::InternalSwap(GeneratedCodeInfo* PROTOBUF_RESTRICT other) {
using std::swap;

@ -792,9 +792,15 @@ class PROTOBUF_EXPORT UninterpretedOption_NamePart final : public ::google::prot
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -983,9 +989,10 @@ class PROTOBUF_EXPORT SourceCodeInfo_Location final : public ::google::protobuf:
const ::google::protobuf::MessageLite& from_msg);
public:
bool IsInitialized() const {
return true;
}
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -1252,9 +1259,10 @@ class PROTOBUF_EXPORT GeneratedCodeInfo_Annotation final : public ::google::prot
const ::google::protobuf::MessageLite& from_msg);
public:
bool IsInitialized() const {
return true;
}
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -1510,9 +1518,10 @@ class PROTOBUF_EXPORT FieldOptions_FeatureSupport final : public ::google::proto
const ::google::protobuf::MessageLite& from_msg);
public:
bool IsInitialized() const {
return true;
}
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -1727,9 +1736,10 @@ class PROTOBUF_EXPORT FieldOptions_EditionDefault final : public ::google::proto
const ::google::protobuf::MessageLite& from_msg);
public:
bool IsInitialized() const {
return true;
}
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -1918,9 +1928,15 @@ class PROTOBUF_EXPORT FeatureSet final : public ::google::protobuf::Message
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -2456,9 +2472,10 @@ class PROTOBUF_EXPORT ExtensionRangeOptions_Declaration final : public ::google:
const ::google::protobuf::MessageLite& from_msg);
public:
bool IsInitialized() const {
return true;
}
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -2692,9 +2709,10 @@ class PROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange final : public ::goo
const ::google::protobuf::MessageLite& from_msg);
public:
bool IsInitialized() const {
return true;
}
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -2877,9 +2895,10 @@ class PROTOBUF_EXPORT DescriptorProto_ReservedRange final : public ::google::pro
const ::google::protobuf::MessageLite& from_msg);
public:
bool IsInitialized() const {
return true;
}
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -3062,9 +3081,15 @@ class PROTOBUF_EXPORT UninterpretedOption final : public ::google::protobuf::Mes
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -3337,9 +3362,10 @@ class PROTOBUF_EXPORT SourceCodeInfo final : public ::google::protobuf::Message
const ::google::protobuf::MessageLite& from_msg);
public:
bool IsInitialized() const {
return true;
}
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -3515,9 +3541,10 @@ class PROTOBUF_EXPORT GeneratedCodeInfo final : public ::google::protobuf::Messa
const ::google::protobuf::MessageLite& from_msg);
public:
bool IsInitialized() const {
return true;
}
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -3693,9 +3720,15 @@ class PROTOBUF_EXPORT FeatureSetDefaults_FeatureSetEditionDefault final : public
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -3916,9 +3949,15 @@ class PROTOBUF_EXPORT ServiceOptions final : public ::google::protobuf::Message
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -4304,9 +4343,15 @@ class PROTOBUF_EXPORT OneofOptions final : public ::google::protobuf::Message
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -4679,9 +4724,15 @@ class PROTOBUF_EXPORT MethodOptions final : public ::google::protobuf::Message
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -5100,9 +5151,15 @@ class PROTOBUF_EXPORT MessageOptions final : public ::google::protobuf::Message
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -5540,9 +5597,15 @@ class PROTOBUF_EXPORT FileOptions final : public ::google::protobuf::Message
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -6242,9 +6305,15 @@ class PROTOBUF_EXPORT FieldOptions final : public ::google::protobuf::Message
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -6880,9 +6949,15 @@ class PROTOBUF_EXPORT FeatureSetDefaults final : public ::google::protobuf::Mess
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -7085,9 +7160,15 @@ class PROTOBUF_EXPORT ExtensionRangeOptions final : public ::google::protobuf::M
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -7512,9 +7593,15 @@ class PROTOBUF_EXPORT EnumValueOptions final : public ::google::protobuf::Messag
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -7913,9 +8000,15 @@ class PROTOBUF_EXPORT EnumOptions final : public ::google::protobuf::Message
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -8327,9 +8420,15 @@ class PROTOBUF_EXPORT OneofDescriptorProto final : public ::google::protobuf::Me
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -8522,9 +8621,15 @@ class PROTOBUF_EXPORT MethodDescriptorProto final : public ::google::protobuf::M
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -8781,9 +8886,15 @@ class PROTOBUF_EXPORT FieldDescriptorProto final : public ::google::protobuf::Me
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -9172,9 +9283,15 @@ class PROTOBUF_EXPORT EnumValueDescriptorProto final : public ::google::protobuf
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -9380,9 +9497,15 @@ class PROTOBUF_EXPORT DescriptorProto_ExtensionRange final : public ::google::pr
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -9582,9 +9705,15 @@ class PROTOBUF_EXPORT ServiceDescriptorProto final : public ::google::protobuf::
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -9796,9 +9925,15 @@ class PROTOBUF_EXPORT EnumDescriptorProto final : public ::google::protobuf::Mes
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -10060,9 +10195,15 @@ class PROTOBUF_EXPORT DescriptorProto final : public ::google::protobuf::Message
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -10420,9 +10561,15 @@ class PROTOBUF_EXPORT FileDescriptorProto final : public ::google::protobuf::Mes
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,
@ -10829,9 +10976,15 @@ class PROTOBUF_EXPORT FileDescriptorSet final : public ::google::protobuf::Messa
const ::google::protobuf::MessageLite& from_msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
bool IsInitialized() const {
return IsInitializedImpl(*this);
}
private:
static bool IsInitializedImpl(const MessageLite& msg);
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
::size_t ByteSizeLong() const final;
::uint8_t* _InternalSerialize(
::uint8_t* target,

@ -272,6 +272,7 @@ struct DynamicMessageFactory::TypeInfo {
{
nullptr, // tc_table
nullptr, // on_demand_register_arena_dtor
DynamicMessage::IsInitializedImpl,
PROTOBUF_FIELD_OFFSET(DynamicMessage, cached_byte_size_),
false,
},

@ -30,7 +30,6 @@ namespace internal {
class PROTOBUF_EXPORT ZeroFieldsBase : public Message {
public:
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final { return true; }
size_t ByteSizeLong() const final;
int GetCachedSize() const { return _impl_._cached_size_.Get(); }
::uint8_t* _InternalSerialize(::uint8_t* target,

@ -54,6 +54,7 @@ const MessageLite::ClassData* ImplicitWeakMessage::GetClassData() const {
{
&table.header,
nullptr, // on_demand_register_arena_dtor
nullptr, // is_initialized (always true)
PROTOBUF_FIELD_OFFSET(ImplicitWeakMessage, cached_size_),
true,
},

@ -64,8 +64,6 @@ class PROTOBUF_EXPORT ImplicitWeakMessage : public MessageLite {
void Clear() override { data_->clear(); }
bool IsInitialized() const override { return true; }
void CheckTypeAndMergeFrom(const MessageLite& other) override {
const std::string* other_data =
static_cast<const ImplicitWeakMessage&>(other).data_;

@ -112,8 +112,8 @@ void Message::CopyFrom(const Message& from) {
void Message::Clear() { ReflectionOps::Clear(this); }
bool Message::IsInitialized() const {
return ReflectionOps::IsInitialized(*this);
bool Message::IsInitializedImpl(const MessageLite& msg) {
return ReflectionOps::IsInitialized(DownCast<const Message&>(msg));
}
void Message::FindInitializationErrors(std::vector<std::string>* errors) const {

@ -345,10 +345,6 @@ class PROTOBUF_EXPORT Message : public MessageLite {
void Clear() override;
// Returns whether all required fields have been set. Note that required
// fields no longer exist starting in proto3.
bool IsInitialized() const override;
void CheckTypeAndMergeFrom(const MessageLite& other) override;
size_t ByteSizeLong() const override;
uint8_t* _InternalSerialize(uint8_t* target,
@ -374,6 +370,9 @@ class PROTOBUF_EXPORT Message : public MessageLite {
Metadata GetMetadata() const;
static Metadata GetMetadataImpl(const ClassDataFull& data);
// For CODE_SIZE types
static bool IsInitializedImpl(const MessageLite&);
inline explicit Message(Arena* arena) : MessageLite(arena) {}
size_t ComputeUnknownFieldsSize(size_t total_size,
internal::CachedSize* cached_size) const;

@ -46,6 +46,11 @@
namespace google {
namespace protobuf {
bool MessageLite::IsInitialized() const {
auto* data = GetClassData();
return data->is_initialized != nullptr ? data->is_initialized(*this) : true;
}
const char* MessageLite::_InternalParse(const char* ptr,
internal::ParseContext* ctx) {
return internal::TcParser::ParseLoop(this, ptr, ctx, GetTcParseTable());

@ -240,7 +240,7 @@ class PROTOBUF_EXPORT MessageLite {
virtual void Clear() = 0;
// Quickly check if all required fields have values set.
virtual bool IsInitialized() const = 0;
bool IsInitialized() const;
// This is not implemented for Lite messages -- it just returns "(cannot
// determine missing fields for lite message)". However, it is implemented
@ -551,6 +551,7 @@ class PROTOBUF_EXPORT MessageLite {
struct ClassData {
const internal::TcParseTableBase* tc_table;
void (*on_demand_register_arena_dtor)(MessageLite& msg, Arena& arena);
bool (*is_initialized)(const MessageLite&);
// Offset of the CachedSize member.
uint32_t cached_size_offset;
@ -558,22 +559,25 @@ class PROTOBUF_EXPORT MessageLite {
// char[] just beyond the ClassData.
bool is_lite;
// Temporary constructor while we migrate existing classes to populate the
// `tc_table` field.
constexpr ClassData(void (*on_demand_register_arena_dtor)(MessageLite&,
// XXX REMOVE XXX
constexpr ClassData(const internal::TcParseTableBase* tc_table,
void (*on_demand_register_arena_dtor)(MessageLite&,
Arena&),
uint32_t cached_size_offset, bool is_lite)
: tc_table(),
: tc_table(tc_table),
on_demand_register_arena_dtor(on_demand_register_arena_dtor),
is_initialized(nullptr),
cached_size_offset(cached_size_offset),
is_lite(is_lite) {}
constexpr ClassData(const internal::TcParseTableBase* tc_table,
void (*on_demand_register_arena_dtor)(MessageLite&,
Arena&),
bool (*is_initialized)(const MessageLite&),
uint32_t cached_size_offset, bool is_lite)
: tc_table(tc_table),
on_demand_register_arena_dtor(on_demand_register_arena_dtor),
is_initialized(is_initialized),
cached_size_offset(cached_size_offset),
is_lite(is_lite) {}

Loading…
Cancel
Save