|
|
@ -185,13 +185,7 @@ size_t Message::MaybeComputeUnknownFieldsSize( |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
size_t Message::SpaceUsedLong() const { |
|
|
|
size_t Message::SpaceUsedLong() const { |
|
|
|
auto* reflection = GetReflection(); |
|
|
|
return GetClassData()->full().descriptor_methods->space_used_long(*this); |
|
|
|
if (PROTOBUF_PREDICT_TRUE(reflection != nullptr)) { |
|
|
|
|
|
|
|
return reflection->SpaceUsedLong(*this); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// The only case that does not have reflection is RawMessage.
|
|
|
|
|
|
|
|
return internal::DownCast<const internal::RawMessageBase&>(*this) |
|
|
|
|
|
|
|
.SpaceUsedLong(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static std::string GetTypeNameImpl(const MessageLite& msg) { |
|
|
|
static std::string GetTypeNameImpl(const MessageLite& msg) { |
|
|
@ -207,11 +201,17 @@ const internal::TcParseTableBase* Message::GetTcParseTableImpl( |
|
|
|
return DownCast<const Message&>(msg).GetReflection()->GetTcParseTable(); |
|
|
|
return DownCast<const Message&>(msg).GetReflection()->GetTcParseTable(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
size_t Message::SpaceUsedLongImpl(const MessageLite& msg_lite) { |
|
|
|
|
|
|
|
auto& msg = DownCast<const Message&>(msg_lite); |
|
|
|
|
|
|
|
return msg.GetReflection()->SpaceUsedLong(msg); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
PROTOBUF_CONSTINIT const MessageLite::DescriptorMethods |
|
|
|
PROTOBUF_CONSTINIT const MessageLite::DescriptorMethods |
|
|
|
Message::kDescriptorMethods = { |
|
|
|
Message::kDescriptorMethods = { |
|
|
|
GetTypeNameImpl, |
|
|
|
GetTypeNameImpl, |
|
|
|
InitializationErrorStringImpl, |
|
|
|
InitializationErrorStringImpl, |
|
|
|
GetTcParseTableImpl, |
|
|
|
GetTcParseTableImpl, |
|
|
|
|
|
|
|
SpaceUsedLongImpl, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
namespace internal { |
|
|
|
namespace internal { |
|
|
|