Go to the documentation of this file.
54 #include <google/protobuf/port_def.inc>
104 std::vector<const FieldDescriptor*>*
output)
const {
108 has = ext.GetSize() > 0;
110 has = !ext.is_cleared;
120 output->push_back(pool->FindExtensionByNumber(containing_type, number));
122 output->push_back(ext.descriptor);
143 #define GOOGLE_DCHECK_TYPE(EXTENSION, LABEL, CPPTYPE) \
144 GOOGLE_DCHECK_EQ((EXTENSION).is_repeated ? FieldDescriptor::LABEL_REPEATED \
145 : FieldDescriptor::LABEL_OPTIONAL, \
146 FieldDescriptor::LABEL_##LABEL); \
147 GOOGLE_DCHECK_EQ(cpp_type((EXTENSION).type), FieldDescriptor::CPPTYPE_##CPPTYPE)
159 return extension->lazymessage_value->GetMessage(
185 return extension->lazymessage_value->MutableMessage(
203 ret =
extension->lazymessage_value->ReleaseMessage(
231 ret =
extension->lazymessage_value->UnsafeArenaReleaseMessage(
252 Arena::CreateMessage<RepeatedPtrField<MessageLite> >(
arena_);
269 if (result ==
NULL) {
271 if (
extension->repeated_message_value->size() == 0) {
275 prototype = &
extension->repeated_message_value->Get(0);
278 extension->repeated_message_value->AddAllocated(result);
287 extension->repeated_message_value->AddAllocated(new_entry);
291 return reinterpret_cast<const EnumDescriptor*
>(arg)->FindValueByNumber(
306 output->message_info.prototype =
309 <<
"Extension factory's GetPrototype() returned NULL for extension: "
321 #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
322 bool ExtensionSet::FindExtension(
int wire_type,
uint32 field,
323 const Message* containing_type,
326 bool* was_packed_on_wire) {
330 was_packed_on_wire)) {
337 was_packed_on_wire)) {
345 uint64 tag,
const char* ptr,
const Message* containing_type,
346 internal::InternalMetadataWithArena*
metadata,
347 internal::ParseContext* ctx) {
349 bool was_packed_on_wire;
352 &was_packed_on_wire)) {
360 uint64 tag,
const char* ptr,
const Message* containing_type,
361 internal::InternalMetadataWithArena*
metadata,
362 internal::ParseContext* ctx) {
367 const char* ptr,
const Message* containing_type,
368 internal::InternalMetadataWithArena*
metadata,
369 internal::ParseContext* ctx) {
370 return ParseMessageSetItemTmpl(ptr, containing_type,
metadata, ctx);
373 #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
376 const Message* containing_type,
384 input->GetExtensionFactory(),
391 const Message* containing_type,
399 input->GetExtensionFactory(),
423 size_t total_size = 0;
426 #define HANDLE_TYPE(UPPERCASE, LOWERCASE) \
427 case FieldDescriptor::CPPTYPE_##UPPERCASE: \
428 total_size += sizeof(*repeated_##LOWERCASE##_value) + \
429 repeated_##LOWERCASE##_value->SpaceUsedExcludingSelfLong(); \
448 total_size +=
sizeof(*repeated_message_value) +
457 total_size +=
sizeof(*string_value) +
464 total_size += down_cast<Message*>(
message_value)->SpaceUsedLong();
478 int end_field_number,
481 end_field_number,
target);
490 int start_field_number,
int end_field_number,
uint8*
target)
const {
491 if (PROTOBUF_PREDICT_FALSE(
is_large())) {
493 for (
auto it =
map_.
large->lower_bound(start_field_number);
494 it !=
end &&
it->first < end_field_number; ++
it) {
495 target =
it->second.InternalSerializeFieldWithCachedSizesToArray(
503 it !=
end &&
it->first < end_field_number; ++
it) {
504 target =
it->second.InternalSerializeFieldWithCachedSizesToArray(
it->first,
523 if (cached_size == 0)
return target;
530 #define HANDLE_TYPE(UPPERCASE, CAMELCASE, LOWERCASE) \
531 case FieldDescriptor::TYPE_##UPPERCASE: \
532 for (int i = 0; i < repeated_##LOWERCASE##_value->size(); i++) { \
533 target = WireFormatLite::Write##CAMELCASE##NoTagToArray( \
534 repeated_##LOWERCASE##_value->Get(i), target); \
563 #define HANDLE_TYPE(UPPERCASE, CAMELCASE, LOWERCASE) \
564 case FieldDescriptor::TYPE_##UPPERCASE: \
565 for (int i = 0; i < repeated_##LOWERCASE##_value->size(); i++) { \
566 target = WireFormatLite::Write##CAMELCASE##ToArray( \
567 number, repeated_##LOWERCASE##_value->Get(i), target); \
588 #define HANDLE_TYPE(UPPERCASE, CAMELCASE, LOWERCASE) \
589 case FieldDescriptor::TYPE_##UPPERCASE: \
590 for (int i = 0; i < repeated_##LOWERCASE##_value->size(); i++) { \
591 target = WireFormatLite::InternalWrite##CAMELCASE##ToArray( \
592 number, repeated_##LOWERCASE##_value->Get(i), target); \
601 }
else if (!is_cleared) {
603 #define HANDLE_TYPE(UPPERCASE, CAMELCASE, VALUE) \
604 case FieldDescriptor::TYPE_##UPPERCASE: \
605 target = WireFormatLite::Write##CAMELCASE##ToArray(number, VALUE, target); \
645 return InternalSerializeFieldWithCachedSizesToArray(
number,
target);
648 if (is_cleared)
return target;
658 target = lazymessage_value->WriteMessageToArray(
676 input, extension_finder, field_skipper);
706 return me->ParseFieldMaybeLazily(
708 extension_finder, field_skipper);
721 MSFull{
this, extension_finder, field_skipper});
uint8 * InternalSerializeMessageSetWithCachedSizesToArray(uint8 *target) const
unsigned long long int UInt64
bool Find(int number, ExtensionInfo *output) override
bool MaybeNewExtension(int number, const FieldDescriptor *descriptor, Extension **result)
const EnumDescriptor * type() const
const EnumValueOptions & options() const
MessageFactory * factory_
const Descriptor::ReservedRange const EnumValueDescriptor const MethodDescriptor extension
MessageLite * message_value
size_t SpaceUsedExcludingSelfLong() const
GLenum GLuint GLenum GLsizei length
FieldDescriptor::Type real_type(FieldType type)
const Extension * FindOrNull(int key) const
virtual const Message * GetPrototype(const Descriptor *type)=0
size_t FromIntSize(int size)
PHP_PROTO_OBJECT_FREE_END PHP_PROTO_OBJECT_DTOR_END if(!upb_strtable_init(&intern->table, UPB_CTYPE_UINT64))
MessageLite * ReleaseMessage(int number, const MessageLite &prototype)
HANDLE_TYPE(int32, FieldDescriptor::CPPTYPE_INT32, -1)
TypeWithSize< 4 >::Int Int32
virtual bool SkipMessageSetField(io::CodedInputStream *input, int field_number)
int SpaceUsedExcludingSelf() const
LazyMessageExtension * lazymessage_value
UnknownFieldSet * unknown_fields_
FloatingPoint< double > Double
TypeWithSize< 4 >::UInt UInt32
static bool ValidateEnumUsingDescriptor(const void *arg, int number)
zend_class_entry * message_type
uint8 * SerializeMessageSetWithCachedSizesToArray(uint8 *target) const
uint8 * InternalSerializeFieldWithCachedSizesToArray(int number, uint8 *target) const
void AppendToList(const Descriptor *containing_type, const DescriptorPool *pool, std::vector< const FieldDescriptor * > *output) const
RepeatedPtrField< MessageLite > * repeated_message_value
WireFormatLite::FieldType field_type(FieldType type)
uint8 * InternalSerializeMessageSetItemWithCachedSizesToArray(int number, uint8 *target) const
MessageLite * MutableMessage(int number, FieldType type, const MessageLite &prototype, desc)
FloatingPoint< float > Float
static KeyValueFunctor ForEach(Iterator begin, Iterator end, KeyValueFunctor func)
const DescriptorPool * pool
const DescriptorPool * pool_
bool ParseMessageSetItemImpl(io::CodedInputStream *input, MS ms)
size_t StringSpaceUsedExcludingSelfLong(const std::string &str)
bool SkipField(io::CodedInputStream *input, uint32 tag) override
const char * UnknownFieldParse(uint32 tag, std::string *unknown, const char *ptr, ParseContext *ctx)
#define GOOGLE_LOG(LEVEL)
virtual ~MessageSetFieldSkipper()
static const LogLevel WARNING
#define GOOGLE_DCHECK_TYPE(EXTENSION, LABEL, CPPTYPE)
const FieldDescriptor * descriptor
uint8 * InternalSerializeWithCachedSizesToArray(int start_field_number, int end_field_number, uint8 *target) const
const FieldDescriptor * field
MessageSetFieldSkipper(UnknownFieldSet *unknown_fields)
void AddAllocatedMessage(const FieldDescriptor *descriptor, MessageLite *new_entry)
#define GOOGLE_CHECK(EXPRESSION)
InternalDescriptorPool * pool
void AddLengthDelimited(int number, const std::string &value)
static size_t RepeatedMessage_SpaceUsedExcludingSelfLong(RepeatedPtrFieldBase *field)
virtual size_t SpaceUsedLong() const =0
const FieldDescriptor * FindExtensionByNumber(const Descriptor *extendee, int number) const
std::string * string_value
const Descriptor * GetDescriptor() const
const Descriptor * containing_type_
union google::protobuf::internal::ExtensionSet::AllocatedData map_
bool ParseFieldWithExtensionInfo(int field_number, bool was_packed_on_wire, const ExtensionInfo &extension, io::CodedInputStream *input, FieldSkipper *field_skipper)
size_t SpaceUsedExcludingSelfLong() const
bool ParseFieldMaybeLazily(int wire_type, int field_number, io::CodedInputStream *input, ExtensionFinder *extension_finder, MessageSetFieldSkipper *field_skipper)
const MessageLite & GetMessage(int number, const MessageLite &default_value) const
DescriptorPoolExtensionFinder(const DescriptorPool *pool, MessageFactory *factory, const Descriptor *containing_type)
static PROTOBUF_ALWAYS_INLINE uint8 * WriteTagToArray(uint32 value, uint8 *target)
bool ParseMessageSet(io::CodedInputStream *input, ExtensionFinder *extension_finder, MessageSetFieldSkipper *field_skipper)
const std::string & full_name() const
MessageLite * UnsafeArenaReleaseMessage(int number, const MessageLite &prototype)
Extension * MaybeNewRepeatedExtension(const FieldDescriptor *descriptor)
ROSCPP_DECL bool has(const std::string &key)
bool FindExtensionInfoFromFieldNumber(int wire_type, int field_number, ExtensionFinder *extension_finder, ExtensionInfo *extension, bool *was_packed_on_wire)
MessageLite * AddMessage(int number, FieldType type, const MessageLite &prototype, desc)
uint8 * SerializeWithCachedSizesToArray(int start_field_number, int end_field_number, uint8 *target) const
const upb_json_parsermethod const upb_symtab upb_sink * output
static CppType TypeToCppType(Type type)
virtual void CheckTypeAndMergeFrom(const MessageLite &other)=0
GLenum GLuint GLenum GLsizei const GLchar * message
bool ParseMessageSetItem(io::CodedInputStream *input, ExtensionFinder *extension_finder, MessageSetFieldSkipper *field_skipper)
bool ParseField(uint32 tag, io::CodedInputStream *input, ExtensionFinder *extension_finder, FieldSkipper *field_skipper)
FieldDescriptor::CppType cpp_type(FieldType type)
~DescriptorPoolExtensionFinder() override
virtual MessageLite * New() const =0
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:51