extension_set.h
Go to the documentation of this file.
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above
12 // copyright notice, this list of conditions and the following disclaimer
13 // in the documentation and/or other materials provided with the
14 // distribution.
15 // * Neither the name of Google Inc. nor the names of its
16 // contributors may be used to endorse or promote products derived from
17 // this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 // Author: kenton@google.com (Kenton Varda)
32 // Based on original Protocol Buffers design by
33 // Sanjay Ghemawat, Jeff Dean, and others.
34 //
35 // This header is logically internal, but is made public because it is used
36 // from protocol-compiler-generated code, which may reside in other components.
37 
38 #ifndef GOOGLE_PROTOBUF_EXTENSION_SET_H__
39 #define GOOGLE_PROTOBUF_EXTENSION_SET_H__
40 
41 #include <algorithm>
42 #include <cassert>
43 #include <map>
44 #include <string>
45 #include <utility>
46 #include <vector>
47 
52 #include <google/protobuf/port.h>
55 
56 #include <google/protobuf/port_def.inc>
57 
58 #ifdef SWIG
59 #error "You cannot SWIG proto headers"
60 #endif
61 
62 namespace google {
63 namespace protobuf {
64 class Arena;
65 class Descriptor; // descriptor.h
66 class FieldDescriptor; // descriptor.h
67 class DescriptorPool; // descriptor.h
68 class MessageLite; // message_lite.h
69 class Message; // message.h
70 class MessageFactory; // message.h
71 class UnknownFieldSet; // unknown_field_set.h
72 namespace io {
73 class CodedInputStream; // coded_stream.h
74 class CodedOutputStream; // coded_stream.h
75 } // namespace io
76 namespace internal {
77 class FieldSkipper; // wire_format_lite.h
78 }
79 } // namespace protobuf
80 } // namespace google
81 
82 namespace google {
83 namespace protobuf {
84 namespace internal {
85 
86 class InternalMetadataWithArenaLite;
88 
89 // Used to store values of type WireFormatLite::FieldType without having to
90 // #include wire_format_lite.h. Also, ensures that we use only one byte to
91 // store these values, which is important to keep the layout of
92 // ExtensionSet::Extension small.
93 typedef uint8 FieldType;
94 
95 // A function which, given an integer value, returns true if the number
96 // matches one of the defined values for the corresponding enum type. This
97 // is used with RegisterEnumExtension, below.
98 typedef bool EnumValidityFunc(int number);
99 
100 // Version of the above which takes an argument. This is needed to deal with
101 // extensions that are not compiled in.
102 typedef bool EnumValidityFuncWithArg(const void* arg, int number);
103 
104 // Information about a registered extension.
106  inline ExtensionInfo() {}
107  inline ExtensionInfo(FieldType type_param, bool isrepeated, bool ispacked)
108  : type(type_param),
109  is_repeated(isrepeated),
110  is_packed(ispacked),
111  descriptor(NULL) {}
112 
115  bool is_packed;
116 
119  const void* arg;
120  };
121 
122  struct MessageInfo {
124  };
125 
126  union {
129  };
130 
131  // The descriptor for this extension, if one exists and is known. May be
132  // NULL. Must not be NULL if the descriptor for the extension does not
133  // live in the same pool as the descriptor for the containing type.
135 };
136 
137 // Abstract interface for an object which looks up extension definitions. Used
138 // when parsing.
139 class PROTOBUF_EXPORT ExtensionFinder {
140  public:
141  virtual ~ExtensionFinder();
142 
143  // Find the extension with the given containing type and number.
144  virtual bool Find(int number, ExtensionInfo* output) = 0;
145 };
146 
147 // Implementation of ExtensionFinder which finds extensions defined in .proto
148 // files which have been compiled into the binary.
149 class PROTOBUF_EXPORT GeneratedExtensionFinder : public ExtensionFinder {
150  public:
151  GeneratedExtensionFinder(const MessageLite* containing_type)
152  : containing_type_(containing_type) {}
154 
155  // Returns true and fills in *output if found, otherwise returns false.
156  bool Find(int number, ExtensionInfo* output) override;
157 
158  private:
160 };
161 
162 // A FieldSkipper used for parsing MessageSet.
164 
165 // Note: extension_set_heavy.cc defines DescriptorPoolExtensionFinder for
166 // finding extensions from a DescriptorPool.
167 
168 // This is an internal helper class intended for use within the protocol buffer
169 // library and generated classes. Clients should not use it directly. Instead,
170 // use the generated accessors such as GetExtension() of the class being
171 // extended.
172 //
173 // This class manages extensions for a protocol message object. The
174 // message's HasExtension(), GetExtension(), MutableExtension(), and
175 // ClearExtension() methods are just thin wrappers around the embedded
176 // ExtensionSet. When parsing, if a tag number is encountered which is
177 // inside one of the message type's extension ranges, the tag is passed
178 // off to the ExtensionSet for parsing. Etc.
179 class PROTOBUF_EXPORT ExtensionSet {
180  public:
181  ExtensionSet();
182  explicit ExtensionSet(Arena* arena);
183  ~ExtensionSet();
184 
185  // These are called at startup by protocol-compiler-generated code to
186  // register known extensions. The registrations are used by ParseField()
187  // to look up extensions for parsed field numbers. Note that dynamic parsing
188  // does not use ParseField(); only protocol-compiler-generated parsing
189  // methods do.
190  static void RegisterExtension(const MessageLite* containing_type, int number,
191  FieldType type, bool is_repeated,
192  bool is_packed);
193  static void RegisterEnumExtension(const MessageLite* containing_type,
194  int number, FieldType type,
195  bool is_repeated, bool is_packed,
196  EnumValidityFunc* is_valid);
197  static void RegisterMessageExtension(const MessageLite* containing_type,
198  int number, FieldType type,
199  bool is_repeated, bool is_packed,
200  const MessageLite* prototype);
201 
202  // =================================================================
203 
204  // Add all fields which are currently present to the given vector. This
205  // is useful to implement Reflection::ListFields().
206  void AppendToList(const Descriptor* containing_type,
207  const DescriptorPool* pool,
208  std::vector<const FieldDescriptor*>* output) const;
209 
210  // =================================================================
211  // Accessors
212  //
213  // Generated message classes include type-safe templated wrappers around
214  // these methods. Generally you should use those rather than call these
215  // directly, unless you are doing low-level memory management.
216  //
217  // When calling any of these accessors, the extension number requested
218  // MUST exist in the DescriptorPool provided to the constructor. Otherwise,
219  // the method will fail an assert. Normally, though, you would not call
220  // these directly; you would either call the generated accessors of your
221  // message class (e.g. GetExtension()) or you would call the accessors
222  // of the reflection interface. In both cases, it is impossible to
223  // trigger this assert failure: the generated accessors only accept
224  // linked-in extension types as parameters, while the Reflection interface
225  // requires you to provide the FieldDescriptor describing the extension.
226  //
227  // When calling any of these accessors, a protocol-compiler-generated
228  // implementation of the extension corresponding to the number MUST
229  // be linked in, and the FieldDescriptor used to refer to it MUST be
230  // the one generated by that linked-in code. Otherwise, the method will
231  // die on an assert failure. The message objects returned by the message
232  // accessors are guaranteed to be of the correct linked-in type.
233  //
234  // These methods pretty much match Reflection except that:
235  // - They're not virtual.
236  // - They identify fields by number rather than FieldDescriptors.
237  // - They identify enum values using integers rather than descriptors.
238  // - Strings provide Mutable() in addition to Set() accessors.
239 
240  bool Has(int number) const;
241  int ExtensionSize(int number) const; // Size of a repeated extension.
242  int NumExtensions() const; // The number of extensions
243  FieldType ExtensionType(int number) const;
244  void ClearExtension(int number);
245 
246  // singular fields -------------------------------------------------
247 
248  int32 GetInt32(int number, int32 default_value) const;
249  int64 GetInt64(int number, int64 default_value) const;
250  uint32 GetUInt32(int number, uint32 default_value) const;
251  uint64 GetUInt64(int number, uint64 default_value) const;
252  float GetFloat(int number, float default_value) const;
253  double GetDouble(int number, double default_value) const;
254  bool GetBool(int number, bool default_value) const;
255  int GetEnum(int number, int default_value) const;
256  const std::string& GetString(int number,
257  const std::string& default_value) const;
258  const MessageLite& GetMessage(int number,
259  const MessageLite& default_value) const;
260  const MessageLite& GetMessage(int number, const Descriptor* message_type,
261  MessageFactory* factory) const;
262 
263  // |descriptor| may be NULL so long as it is known that the descriptor for
264  // the extension lives in the same pool as the descriptor for the containing
265  // type.
266 #define desc const FieldDescriptor* descriptor // avoid line wrapping
267  void SetInt32(int number, FieldType type, int32 value, desc);
268  void SetInt64(int number, FieldType type, int64 value, desc);
269  void SetUInt32(int number, FieldType type, uint32 value, desc);
270  void SetUInt64(int number, FieldType type, uint64 value, desc);
271  void SetFloat(int number, FieldType type, float value, desc);
272  void SetDouble(int number, FieldType type, double value, desc);
273  void SetBool(int number, FieldType type, bool value, desc);
274  void SetEnum(int number, FieldType type, int value, desc);
275  void SetString(int number, FieldType type, const std::string& value, desc);
276  std::string* MutableString(int number, FieldType type, desc);
277  MessageLite* MutableMessage(int number, FieldType type,
278  const MessageLite& prototype, desc);
279  MessageLite* MutableMessage(const FieldDescriptor* decsriptor,
280  MessageFactory* factory);
281  // Adds the given message to the ExtensionSet, taking ownership of the
282  // message object. Existing message with the same number will be deleted.
283  // If "message" is NULL, this is equivalent to "ClearExtension(number)".
284  void SetAllocatedMessage(int number, FieldType type,
287  void UnsafeArenaSetAllocatedMessage(int number, FieldType type,
290  MessageLite* ReleaseMessage(int number, const MessageLite& prototype);
291  MessageLite* UnsafeArenaReleaseMessage(int number,
292  const MessageLite& prototype);
293 
294  MessageLite* ReleaseMessage(const FieldDescriptor* descriptor,
295  MessageFactory* factory);
296  MessageLite* UnsafeArenaReleaseMessage(const FieldDescriptor* descriptor,
297  MessageFactory* factory);
298 #undef desc
299  Arena* GetArenaNoVirtual() const { return arena_; }
300 
301  // repeated fields -------------------------------------------------
302 
303  // Fetches a RepeatedField extension by number; returns |default_value|
304  // if no such extension exists. User should not touch this directly; it is
305  // used by the GetRepeatedExtension() method.
306  const void* GetRawRepeatedField(int number, const void* default_value) const;
307  // Fetches a mutable version of a RepeatedField extension by number,
308  // instantiating one if none exists. Similar to above, user should not use
309  // this directly; it underlies MutableRepeatedExtension().
310  void* MutableRawRepeatedField(int number, FieldType field_type, bool packed,
311  const FieldDescriptor* desc);
312 
313  // This is an overload of MutableRawRepeatedField to maintain compatibility
314  // with old code using a previous API. This version of
315  // MutableRawRepeatedField() will GOOGLE_CHECK-fail on a missing extension.
316  // (E.g.: borg/clients/internal/proto1/proto2_reflection.cc.)
317  void* MutableRawRepeatedField(int number);
318 
319  int32 GetRepeatedInt32(int number, int index) const;
320  int64 GetRepeatedInt64(int number, int index) const;
321  uint32 GetRepeatedUInt32(int number, int index) const;
322  uint64 GetRepeatedUInt64(int number, int index) const;
323  float GetRepeatedFloat(int number, int index) const;
324  double GetRepeatedDouble(int number, int index) const;
325  bool GetRepeatedBool(int number, int index) const;
326  int GetRepeatedEnum(int number, int index) const;
327  const std::string& GetRepeatedString(int number, int index) const;
328  const MessageLite& GetRepeatedMessage(int number, int index) const;
329 
330  void SetRepeatedInt32(int number, int index, int32 value);
331  void SetRepeatedInt64(int number, int index, int64 value);
332  void SetRepeatedUInt32(int number, int index, uint32 value);
333  void SetRepeatedUInt64(int number, int index, uint64 value);
334  void SetRepeatedFloat(int number, int index, float value);
335  void SetRepeatedDouble(int number, int index, double value);
336  void SetRepeatedBool(int number, int index, bool value);
337  void SetRepeatedEnum(int number, int index, int value);
338  void SetRepeatedString(int number, int index, const std::string& value);
339  std::string* MutableRepeatedString(int number, int index);
340  MessageLite* MutableRepeatedMessage(int number, int index);
341 
342 #define desc const FieldDescriptor* descriptor // avoid line wrapping
343  void AddInt32(int number, FieldType type, bool packed, int32 value, desc);
344  void AddInt64(int number, FieldType type, bool packed, int64 value, desc);
345  void AddUInt32(int number, FieldType type, bool packed, uint32 value, desc);
346  void AddUInt64(int number, FieldType type, bool packed, uint64 value, desc);
347  void AddFloat(int number, FieldType type, bool packed, float value, desc);
348  void AddDouble(int number, FieldType type, bool packed, double value, desc);
349  void AddBool(int number, FieldType type, bool packed, bool value, desc);
350  void AddEnum(int number, FieldType type, bool packed, int value, desc);
351  void AddString(int number, FieldType type, const std::string& value, desc);
352  std::string* AddString(int number, FieldType type, desc);
353  MessageLite* AddMessage(int number, FieldType type,
354  const MessageLite& prototype, desc);
355  MessageLite* AddMessage(const FieldDescriptor* descriptor,
356  MessageFactory* factory);
357  void AddAllocatedMessage(const FieldDescriptor* descriptor,
358  MessageLite* new_entry);
359 #undef desc
360 
361  void RemoveLast(int number);
362  MessageLite* ReleaseLast(int number);
363  void SwapElements(int number, int index1, int index2);
364 
365  // -----------------------------------------------------------------
366  // TODO(kenton): Hardcore memory management accessors
367 
368  // =================================================================
369  // convenience methods for implementing methods of Message
370  //
371  // These could all be implemented in terms of the other methods of this
372  // class, but providing them here helps keep the generated code size down.
373 
374  void Clear();
375  void MergeFrom(const ExtensionSet& other);
376  void Swap(ExtensionSet* other);
377  void SwapExtension(ExtensionSet* other, int number);
378  bool IsInitialized() const;
379 
380  // Parses a single extension from the input. The input should start out
381  // positioned immediately after the tag.
382  bool ParseField(uint32 tag, io::CodedInputStream* input,
383  ExtensionFinder* extension_finder,
384  FieldSkipper* field_skipper);
385 
386  // Specific versions for lite or full messages (constructs the appropriate
387  // FieldSkipper automatically). |containing_type| is the default
388  // instance for the containing message; it is used only to look up the
389  // extension by number. See RegisterExtension(), above. Unlike the other
390  // methods of ExtensionSet, this only works for generated message types --
391  // it looks up extensions registered using RegisterExtension().
392  bool ParseField(uint32 tag, io::CodedInputStream* input,
393  const MessageLite* containing_type);
394  bool ParseField(uint32 tag, io::CodedInputStream* input,
395  const Message* containing_type,
396  UnknownFieldSet* unknown_fields);
397  bool ParseField(uint32 tag, io::CodedInputStream* input,
398  const MessageLite* containing_type,
399  io::CodedOutputStream* unknown_fields);
400 
401 #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
402  // Lite parser
403  const char* ParseField(uint64 tag, const char* ptr,
404  const MessageLite* containing_type,
405  internal::InternalMetadataWithArenaLite* metadata,
406  internal::ParseContext* ctx);
407  // Full parser
408  const char* ParseField(uint64 tag, const char* ptr,
409  const Message* containing_type,
410  internal::InternalMetadataWithArena* metadata,
411  internal::ParseContext* ctx);
412  template <typename Msg, typename Metadata>
413  const char* ParseMessageSet(const char* ptr, const Msg* containing_type,
414  Metadata* metadata, internal::ParseContext* ctx) {
415  struct MessageSetItem {
416  const char* _InternalParse(const char* ptr, ParseContext* ctx) {
417  return me->ParseMessageSetItem(ptr, containing_type, metadata, ctx);
418  }
419  ExtensionSet* me;
420  const Msg* containing_type;
421  Metadata* metadata;
422  } item{this, containing_type, metadata};
423  while (!ctx->Done(&ptr)) {
424  uint32 tag;
425  ptr = ReadTag(ptr, &tag);
428  ptr = ctx->ParseGroup(&item, ptr, tag);
430  } else {
431  if (tag == 0 || (tag & 7) == 4) {
432  ctx->SetLastTag(tag);
433  return ptr;
434  }
435  ptr = ParseField(tag, ptr, containing_type, metadata, ctx);
437  }
438  }
439  return ptr;
440  }
441 #endif
442 
443  // Parse an entire message in MessageSet format. Such messages have no
444  // fields, only extensions.
445  bool ParseMessageSetLite(io::CodedInputStream* input,
446  ExtensionFinder* extension_finder,
447  FieldSkipper* field_skipper);
448  bool ParseMessageSet(io::CodedInputStream* input,
449  ExtensionFinder* extension_finder,
450  MessageSetFieldSkipper* field_skipper);
451 
452  // Specific versions for lite or full messages (constructs the appropriate
453  // FieldSkipper automatically).
454  bool ParseMessageSet(io::CodedInputStream* input,
455  const MessageLite* containing_type,
456  std::string* unknown_fields);
457  bool ParseMessageSet(io::CodedInputStream* input,
458  const Message* containing_type,
459  UnknownFieldSet* unknown_fields);
460 
461  // Write all extension fields with field numbers in the range
462  // [start_field_number, end_field_number)
463  // to the output stream, using the cached sizes computed when ByteSize() was
464  // last called. Note that the range bounds are inclusive-exclusive.
465  void SerializeWithCachedSizes(int start_field_number, int end_field_number,
466  io::CodedOutputStream* output) const;
467 
468  // Same as SerializeWithCachedSizes, but without any bounds checking.
469  // The caller must ensure that target has sufficient capacity for the
470  // serialized extensions.
471  //
472  // Returns a pointer past the last written byte.
473  uint8* InternalSerializeWithCachedSizesToArray(int start_field_number,
474  int end_field_number,
475  uint8* target) const;
476 
477  // Like above but serializes in MessageSet format.
478  void SerializeMessageSetWithCachedSizes(io::CodedOutputStream* output) const;
479  uint8* InternalSerializeMessageSetWithCachedSizesToArray(uint8* target) const;
480 
481  // For backward-compatibility, versions of two of the above methods that
482  // serialize deterministically iff SetDefaultSerializationDeterministic()
483  // has been called.
484  uint8* SerializeWithCachedSizesToArray(int start_field_number,
485  int end_field_number,
486  uint8* target) const;
487  uint8* SerializeMessageSetWithCachedSizesToArray(uint8* target) const;
488 
489  // Returns the total serialized size of all the extensions.
490  size_t ByteSize() const;
491 
492  // Like ByteSize() but uses MessageSet format.
493  size_t MessageSetByteSize() const;
494 
495  // Returns (an estimate of) the total number of bytes used for storing the
496  // extensions in memory, excluding sizeof(*this). If the ExtensionSet is
497  // for a lite message (and thus possibly contains lite messages), the results
498  // are undefined (might work, might crash, might corrupt data, might not even
499  // be linked in). It's up to the protocol compiler to avoid calling this on
500  // such ExtensionSets (easy enough since lite messages don't implement
501  // SpaceUsed()).
502  size_t SpaceUsedExcludingSelfLong() const;
503 
504  // This method just calls SpaceUsedExcludingSelfLong() but it can not be
505  // inlined because the definition of SpaceUsedExcludingSelfLong() is not
506  // included in lite runtime and when an inline method refers to it MSVC
507  // will complain about unresolved symbols when building the lite runtime
508  // as .dll.
509  int SpaceUsedExcludingSelf() const;
510 
511  private:
512  // Interface of a lazily parsed singular message extension.
513  class PROTOBUF_EXPORT LazyMessageExtension {
514  public:
517 
518  virtual LazyMessageExtension* New(Arena* arena) const = 0;
519  virtual const MessageLite& GetMessage(
520  const MessageLite& prototype) const = 0;
521  virtual MessageLite* MutableMessage(const MessageLite& prototype) = 0;
522  virtual void SetAllocatedMessage(MessageLite* message) = 0;
523  virtual void UnsafeArenaSetAllocatedMessage(MessageLite* message) = 0;
524  virtual MessageLite* ReleaseMessage(const MessageLite& prototype) = 0;
525  virtual MessageLite* UnsafeArenaReleaseMessage(
526  const MessageLite& prototype) = 0;
527 
528  virtual bool IsInitialized() const = 0;
529 
530  PROTOBUF_DEPRECATED_MSG("Please use ByteSizeLong() instead")
531  virtual int ByteSize() const { return internal::ToIntSize(ByteSizeLong()); }
532  virtual size_t ByteSizeLong() const = 0;
533  virtual size_t SpaceUsedLong() const = 0;
534 
535  virtual void MergeFrom(const LazyMessageExtension& other) = 0;
536  virtual void Clear() = 0;
537 
538  virtual bool ReadMessage(const MessageLite& prototype,
540 #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
541  virtual const char* _InternalParse(const char* ptr, ParseContext* ctx) = 0;
542 #endif
543  virtual void WriteMessage(int number,
544  io::CodedOutputStream* output) const = 0;
545  virtual uint8* WriteMessageToArray(int number, uint8* target) const = 0;
546 
547  private:
548  virtual void UnusedKeyMethod(); // Dummy key method to avoid weak vtable.
549 
551  };
552  struct Extension {
553  // The order of these fields packs Extension into 24 bytes when using 8
554  // byte alignment. Consider this when adding or removing fields here.
555  union {
560  float float_value;
561  double double_value;
567 
578  };
579 
582 
583  // For singular types, indicates if the extension is "cleared". This
584  // happens when an extension is set and then later cleared by the caller.
585  // We want to keep the Extension object around for reuse, so instead of
586  // removing it from the map, we just set is_cleared = true. This has no
587  // meaning for repeated types; for those, the size of the RepeatedField
588  // simply becomes zero when cleared.
589  bool is_cleared : 4;
590 
591  // For singular message types, indicates whether lazy parsing is enabled
592  // for this extension. This field is only valid when type == TYPE_MESSAGE
593  // and !is_repeated because we only support lazy parsing for singular
594  // message types currently. If is_lazy = true, the extension is stored in
595  // lazymessage_value. Otherwise, the extension will be message_value.
596  bool is_lazy : 4;
597 
598  // For repeated types, this indicates if the [packed=true] option is set.
599  bool is_packed;
600 
601  // For packed fields, the size of the packed data is recorded here when
602  // ByteSize() is called then used during serialization.
603  // TODO(kenton): Use atomic<int> when C++ supports it.
604  mutable int cached_size;
605 
606  // The descriptor for this extension, if one exists and is known. May be
607  // NULL. Must not be NULL if the descriptor for the extension does not
608  // live in the same pool as the descriptor for the containing type.
610 
611  // Some helper methods for operations on a single Extension.
612  void SerializeFieldWithCachedSizes(int number,
614  uint8* InternalSerializeFieldWithCachedSizesToArray(int number,
615  uint8* target) const;
616  void SerializeMessageSetItemWithCachedSizes(
617  int number, io::CodedOutputStream* output) const;
618  uint8* InternalSerializeMessageSetItemWithCachedSizesToArray(
619  int number, uint8* target) const;
620  size_t ByteSize(int number) const;
621  size_t MessageSetItemByteSize(int number) const;
622  void Clear();
623  int GetSize() const;
624  void Free();
625  size_t SpaceUsedExcludingSelfLong() const;
626  bool IsInitialized() const;
627  };
628 
629  // The Extension struct is small enough to be passed by value, so we use it
630  // directly as the value type in mappings rather than use pointers. We use
631  // sorted maps rather than hash-maps because we expect most ExtensionSets will
632  // only contain a small number of extension. Also, we want AppendToList and
633  // deterministic serialization to order fields by field number.
634 
635  struct KeyValue {
636  int first;
638 
640  bool operator()(const KeyValue& lhs, const KeyValue& rhs) const {
641  return lhs.first < rhs.first;
642  }
643  bool operator()(const KeyValue& lhs, int key) const {
644  return lhs.first < key;
645  }
646  bool operator()(int key, const KeyValue& rhs) const {
647  return key < rhs.first;
648  }
649  };
650  };
651 
652  typedef std::map<int, Extension> LargeMap;
653 
654  // Wrapper API that switches between flat-map and LargeMap.
655 
656  // Finds a key (if present) in the ExtensionSet.
657  const Extension* FindOrNull(int key) const;
658  Extension* FindOrNull(int key);
659 
660  // Helper-functions that only inspect the LargeMap.
661  const Extension* FindOrNullInLargeMap(int key) const;
662  Extension* FindOrNullInLargeMap(int key);
663 
664  // Inserts a new (key, Extension) into the ExtensionSet (and returns true), or
665  // finds the already-existing Extension for that key (returns false).
666  // The Extension* will point to the new-or-found Extension.
667  std::pair<Extension*, bool> Insert(int key);
668 
669  // Grows the flat_capacity_.
670  // If flat_capacity_ > kMaximumFlatCapacity, converts to LargeMap.
671  void GrowCapacity(size_t minimum_new_capacity);
672  static constexpr uint16 kMaximumFlatCapacity = 256;
673  bool is_large() const { return flat_capacity_ > kMaximumFlatCapacity; }
674 
675  // Removes a key from the ExtensionSet.
676  void Erase(int key);
677 
678  size_t Size() const {
679  return PROTOBUF_PREDICT_FALSE(is_large()) ? map_.large->size() : flat_size_;
680  }
681 
682  // Similar to std::for_each.
683  // Each Iterator is decomposed into ->first and ->second fields, so
684  // that the KeyValueFunctor can be agnostic vis-a-vis KeyValue-vs-std::pair.
685  template <typename Iterator, typename KeyValueFunctor>
686  static KeyValueFunctor ForEach(Iterator begin, Iterator end,
687  KeyValueFunctor func) {
688  for (Iterator it = begin; it != end; ++it) func(it->first, it->second);
689  return std::move(func);
690  }
691 
692  // Applies a functor to the <int, Extension&> pairs in sorted order.
693  template <typename KeyValueFunctor>
694  KeyValueFunctor ForEach(KeyValueFunctor func) {
695  if (PROTOBUF_PREDICT_FALSE(is_large())) {
696  return ForEach(map_.large->begin(), map_.large->end(), std::move(func));
697  }
698  return ForEach(flat_begin(), flat_end(), std::move(func));
699  }
700 
701  // Applies a functor to the <int, const Extension&> pairs in sorted order.
702  template <typename KeyValueFunctor>
703  KeyValueFunctor ForEach(KeyValueFunctor func) const {
704  if (PROTOBUF_PREDICT_FALSE(is_large())) {
705  return ForEach(map_.large->begin(), map_.large->end(), std::move(func));
706  }
707  return ForEach(flat_begin(), flat_end(), std::move(func));
708  }
709 
710  // Merges existing Extension from other_extension
711  void InternalExtensionMergeFrom(int number, const Extension& other_extension);
712 
713  // Returns true and fills field_number and extension if extension is found.
714  // Note to support packed repeated field compatibility, it also fills whether
715  // the tag on wire is packed, which can be different from
716  // extension->is_packed (whether packed=true is specified).
717  bool FindExtensionInfoFromTag(uint32 tag, ExtensionFinder* extension_finder,
718  int* field_number, ExtensionInfo* extension,
719  bool* was_packed_on_wire);
720 
721  // Returns true and fills extension if extension is found.
722  // Note to support packed repeated field compatibility, it also fills whether
723  // the tag on wire is packed, which can be different from
724  // extension->is_packed (whether packed=true is specified).
725  bool FindExtensionInfoFromFieldNumber(int wire_type, int field_number,
726  ExtensionFinder* extension_finder,
728  bool* was_packed_on_wire);
729 
730  // Parses a single extension from the input. The input should start out
731  // positioned immediately after the wire tag. This method is called in
732  // ParseField() after field number and was_packed_on_wire is extracted from
733  // the wire tag and ExtensionInfo is found by the field number.
734  bool ParseFieldWithExtensionInfo(int field_number, bool was_packed_on_wire,
735  const ExtensionInfo& extension,
737  FieldSkipper* field_skipper);
738 
739  // Like ParseField(), but this method may parse singular message extensions
740  // lazily depending on the value of FLAGS_eagerly_parse_message_sets.
741  bool ParseFieldMaybeLazily(int wire_type, int field_number,
743  ExtensionFinder* extension_finder,
744  MessageSetFieldSkipper* field_skipper);
745 
746  // Gets the extension with the given number, creating it if it does not
747  // already exist. Returns true if the extension did not already exist.
748  bool MaybeNewExtension(int number, const FieldDescriptor* descriptor,
749  Extension** result);
750 
751  // Gets the repeated extension for the given descriptor, creating it if
752  // it does not exist.
753  Extension* MaybeNewRepeatedExtension(const FieldDescriptor* descriptor);
754 
755  // Parse a single MessageSet item -- called just after the item group start
756  // tag has been read.
757  bool ParseMessageSetItemLite(io::CodedInputStream* input,
758  ExtensionFinder* extension_finder,
759  FieldSkipper* field_skipper);
760  // Parse a single MessageSet item -- called just after the item group start
761  // tag has been read.
762  bool ParseMessageSetItem(io::CodedInputStream* input,
763  ExtensionFinder* extension_finder,
764  MessageSetFieldSkipper* field_skipper);
765 
766 #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
767  bool FindExtension(int wire_type, uint32 field,
768  const MessageLite* containing_type,
769  const internal::ParseContext* ctx,
770  ExtensionInfo* extension, bool* was_packed_on_wire) {
771  GeneratedExtensionFinder finder(containing_type);
772  return FindExtensionInfoFromFieldNumber(wire_type, field, &finder,
773  extension, was_packed_on_wire);
774  }
775  inline bool FindExtension(int wire_type, uint32 field,
776  const Message* containing_type,
777  const internal::ParseContext* ctx,
778  ExtensionInfo* extension, bool* was_packed_on_wire);
779  // Used for MessageSet only
780  const char* ParseFieldMaybeLazily(
781  uint64 tag, const char* ptr, const MessageLite* containing_type,
783  internal::ParseContext* ctx) {
784  // Lite MessageSet doesn't implement lazy.
785  return ParseField(tag, ptr, containing_type, metadata, ctx);
786  }
787  const char* ParseFieldMaybeLazily(
788  uint64 tag, const char* ptr, const Message* containing_type,
789  internal::InternalMetadataWithArena* metadata,
790  internal::ParseContext* ctx);
791  const char* ParseMessageSetItem(
792  const char* ptr, const MessageLite* containing_type,
793  internal::InternalMetadataWithArenaLite* metadata,
794  internal::ParseContext* ctx);
795  const char* ParseMessageSetItem(const char* ptr,
796  const Message* containing_type,
797  internal::InternalMetadataWithArena* metadata,
798  internal::ParseContext* ctx);
799 
800  // Implemented in extension_set_inl.h to keep code out of the header file.
801  template <typename T>
802  const char* ParseFieldWithExtensionInfo(int number, bool was_packed_on_wire,
803  const ExtensionInfo& info,
804  T* metadata, const char* ptr,
805  internal::ParseContext* ctx);
806  template <typename Msg, typename Metadata>
807  const char* ParseMessageSetItemTmpl(const char* ptr,
808  const Msg* containing_type,
809  Metadata* metadata,
810  internal::ParseContext* ctx);
811 #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
812 
813  // Hack: RepeatedPtrFieldBase declares ExtensionSet as a friend. This
814  // friendship should automatically extend to ExtensionSet::Extension, but
815  // unfortunately some older compilers (e.g. GCC 3.4.4) do not implement this
816  // correctly. So, we must provide helpers for calling methods of that
817  // class.
818 
819  // Defined in extension_set_heavy.cc.
820  static inline size_t RepeatedMessage_SpaceUsedExcludingSelfLong(
821  RepeatedPtrFieldBase* field);
822 
824  assert(!is_large());
825  return map_.flat;
826  }
827  const KeyValue* flat_begin() const {
828  assert(!is_large());
829  return map_.flat;
830  }
832  assert(!is_large());
833  return map_.flat + flat_size_;
834  }
835  const KeyValue* flat_end() const {
836  assert(!is_large());
837  return map_.flat + flat_size_;
838  }
839 
840  Arena* arena_;
841 
842  // Manual memory-management:
843  // map_.flat is an allocated array of flat_capacity_ elements.
844  // [map_.flat, map_.flat + flat_size_) is the currently-in-use prefix.
849 
850  // If flat_capacity_ > kMaximumFlatCapacity, switch to LargeMap,
851  // which guarantees O(n lg n) CPU but larger constant factors.
853  } map_;
854 
855  static void DeleteFlatMap(const KeyValue* flat, uint16 flat_capacity);
856 
858 };
859 
860 // These are just for convenience...
862  const std::string& value,
863  const FieldDescriptor* descriptor) {
865 }
867  const std::string& value) {
869 }
871  const std::string& value,
872  const FieldDescriptor* descriptor) {
873  AddString(number, type, descriptor)->assign(value);
874 }
875 
876 // ===================================================================
877 // Glue for generated extension accessors
878 
879 // -------------------------------------------------------------------
880 // Template magic
881 
882 // First we have a set of classes representing "type traits" for different
883 // field types. A type traits class knows how to implement basic accessors
884 // for extensions of a particular type given an ExtensionSet. The signature
885 // for a type traits class looks like this:
886 //
887 // class TypeTraits {
888 // public:
889 // typedef ? ConstType;
890 // typedef ? MutableType;
891 // // TypeTraits for singular fields and repeated fields will define the
892 // // symbol "Singular" or "Repeated" respectively. These two symbols will
893 // // be used in extension accessors to distinguish between singular
894 // // extensions and repeated extensions. If the TypeTraits for the passed
895 // // in extension doesn't have the expected symbol defined, it means the
896 // // user is passing a repeated extension to a singular accessor, or the
897 // // opposite. In that case the C++ compiler will generate an error
898 // // message "no matching member function" to inform the user.
899 // typedef ? Singular
900 // typedef ? Repeated
901 //
902 // static inline ConstType Get(int number, const ExtensionSet& set);
903 // static inline void Set(int number, ConstType value, ExtensionSet* set);
904 // static inline MutableType Mutable(int number, ExtensionSet* set);
905 //
906 // // Variants for repeated fields.
907 // static inline ConstType Get(int number, const ExtensionSet& set,
908 // int index);
909 // static inline void Set(int number, int index,
910 // ConstType value, ExtensionSet* set);
911 // static inline MutableType Mutable(int number, int index,
912 // ExtensionSet* set);
913 // static inline void Add(int number, ConstType value, ExtensionSet* set);
914 // static inline MutableType Add(int number, ExtensionSet* set);
915 // This is used by the ExtensionIdentifier constructor to register
916 // the extension at dynamic initialization.
917 // template <typename ExtendeeT>
918 // static void Register(int number, FieldType type, bool is_packed);
919 // };
920 //
921 // Not all of these methods make sense for all field types. For example, the
922 // "Mutable" methods only make sense for strings and messages, and the
923 // repeated methods only make sense for repeated types. So, each type
924 // traits class implements only the set of methods from this signature that it
925 // actually supports. This will cause a compiler error if the user tries to
926 // access an extension using a method that doesn't make sense for its type.
927 // For example, if "foo" is an extension of type "optional int32", then if you
928 // try to write code like:
929 // my_message.MutableExtension(foo)
930 // you will get a compile error because PrimitiveTypeTraits<int32> does not
931 // have a "Mutable()" method.
932 
933 // -------------------------------------------------------------------
934 // PrimitiveTypeTraits
935 
936 // Since the ExtensionSet has different methods for each primitive type,
937 // we must explicitly define the methods of the type traits class for each
938 // known type.
939 template <typename Type>
941  public:
942  typedef Type ConstType;
943  typedef Type MutableType;
945 
946  static inline ConstType Get(int number, const ExtensionSet& set,
947  ConstType default_value);
948  static inline void Set(int number, FieldType field_type, ConstType value,
949  ExtensionSet* set);
950  template <typename ExtendeeT>
951  static void Register(int number, FieldType type, bool is_packed) {
952  ExtensionSet::RegisterExtension(&ExtendeeT::default_instance(), number,
953  type, false, is_packed);
954  }
955 };
956 
957 template <typename Type>
959  public:
960  typedef Type ConstType;
961  typedef Type MutableType;
963 
965 
966  static inline Type Get(int number, const ExtensionSet& set, int index);
967  static inline void Set(int number, int index, Type value, ExtensionSet* set);
968  static inline void Add(int number, FieldType field_type, bool is_packed,
970 
971  static inline const RepeatedField<ConstType>& GetRepeated(
972  int number, const ExtensionSet& set);
973  static inline RepeatedField<Type>* MutableRepeated(int number,
975  bool is_packed,
976  ExtensionSet* set);
977 
979  template <typename ExtendeeT>
980  static void Register(int number, FieldType type, bool is_packed) {
981  ExtensionSet::RegisterExtension(&ExtendeeT::default_instance(), number,
982  type, true, is_packed);
983  }
984 };
985 
986 class PROTOBUF_EXPORT RepeatedPrimitiveDefaults {
987  private:
988  template <typename Type>
990  static const RepeatedPrimitiveDefaults* default_instance();
998 };
999 
1000 #define PROTOBUF_DEFINE_PRIMITIVE_TYPE(TYPE, METHOD) \
1001  template <> \
1002  inline TYPE PrimitiveTypeTraits<TYPE>::Get( \
1003  int number, const ExtensionSet& set, TYPE default_value) { \
1004  return set.Get##METHOD(number, default_value); \
1005  } \
1006  template <> \
1007  inline void PrimitiveTypeTraits<TYPE>::Set(int number, FieldType field_type, \
1008  TYPE value, ExtensionSet* set) { \
1009  set->Set##METHOD(number, field_type, value, NULL); \
1010  } \
1011  \
1012  template <> \
1013  inline TYPE RepeatedPrimitiveTypeTraits<TYPE>::Get( \
1014  int number, const ExtensionSet& set, int index) { \
1015  return set.GetRepeated##METHOD(number, index); \
1016  } \
1017  template <> \
1018  inline void RepeatedPrimitiveTypeTraits<TYPE>::Set( \
1019  int number, int index, TYPE value, ExtensionSet* set) { \
1020  set->SetRepeated##METHOD(number, index, value); \
1021  } \
1022  template <> \
1023  inline void RepeatedPrimitiveTypeTraits<TYPE>::Add( \
1024  int number, FieldType field_type, bool is_packed, TYPE value, \
1025  ExtensionSet* set) { \
1026  set->Add##METHOD(number, field_type, is_packed, value, NULL); \
1027  } \
1028  template <> \
1029  inline const RepeatedField<TYPE>* \
1030  RepeatedPrimitiveTypeTraits<TYPE>::GetDefaultRepeatedField() { \
1031  return &RepeatedPrimitiveDefaults::default_instance() \
1032  ->default_repeated_field_##TYPE##_; \
1033  } \
1034  template <> \
1035  inline const RepeatedField<TYPE>& \
1036  RepeatedPrimitiveTypeTraits<TYPE>::GetRepeated(int number, \
1037  const ExtensionSet& set) { \
1038  return *reinterpret_cast<const RepeatedField<TYPE>*>( \
1039  set.GetRawRepeatedField(number, GetDefaultRepeatedField())); \
1040  } \
1041  template <> \
1042  inline RepeatedField<TYPE>* \
1043  RepeatedPrimitiveTypeTraits<TYPE>::MutableRepeated( \
1044  int number, FieldType field_type, bool is_packed, ExtensionSet* set) { \
1045  return reinterpret_cast<RepeatedField<TYPE>*>( \
1046  set->MutableRawRepeatedField(number, field_type, is_packed, NULL)); \
1047  }
1048 
1056 
1057 #undef PROTOBUF_DEFINE_PRIMITIVE_TYPE
1058 
1059 // -------------------------------------------------------------------
1060 // StringTypeTraits
1061 
1062 // Strings support both Set() and Mutable().
1063 class PROTOBUF_EXPORT StringTypeTraits {
1064  public:
1065  typedef const std::string& ConstType;
1068 
1069  static inline const std::string& Get(int number, const ExtensionSet& set,
1070  ConstType default_value) {
1071  return set.GetString(number, default_value);
1072  }
1073  static inline void Set(int number, FieldType field_type,
1074  const std::string& value, ExtensionSet* set) {
1075  set->SetString(number, field_type, value, NULL);
1076  }
1078  ExtensionSet* set) {
1079  return set->MutableString(number, field_type, NULL);
1080  }
1081  template <typename ExtendeeT>
1082  static void Register(int number, FieldType type, bool is_packed) {
1083  ExtensionSet::RegisterExtension(&ExtendeeT::default_instance(), number,
1084  type, false, is_packed);
1085  }
1086 };
1087 
1088 class PROTOBUF_EXPORT RepeatedStringTypeTraits {
1089  public:
1090  typedef const std::string& ConstType;
1093 
1095 
1096  static inline const std::string& Get(int number, const ExtensionSet& set,
1097  int index) {
1098  return set.GetRepeatedString(number, index);
1099  }
1100  static inline void Set(int number, int index, const std::string& value,
1101  ExtensionSet* set) {
1102  set->SetRepeatedString(number, index, value);
1103  }
1104  static inline std::string* Mutable(int number, int index, ExtensionSet* set) {
1105  return set->MutableRepeatedString(number, index);
1106  }
1107  static inline void Add(int number, FieldType field_type, bool /*is_packed*/,
1108  const std::string& value, ExtensionSet* set) {
1109  set->AddString(number, field_type, value, NULL);
1110  }
1112  ExtensionSet* set) {
1113  return set->AddString(number, field_type, NULL);
1114  }
1116  int number, const ExtensionSet& set) {
1117  return *reinterpret_cast<const RepeatedPtrField<std::string>*>(
1118  set.GetRawRepeatedField(number, GetDefaultRepeatedField()));
1119  }
1120 
1122  int number, FieldType field_type, bool is_packed, ExtensionSet* set) {
1123  return reinterpret_cast<RepeatedPtrField<std::string>*>(
1124  set->MutableRawRepeatedField(number, field_type, is_packed, NULL));
1125  }
1126 
1127  static const RepeatedFieldType* GetDefaultRepeatedField();
1128 
1129  template <typename ExtendeeT>
1130  static void Register(int number, FieldType type, bool is_packed) {
1131  ExtensionSet::RegisterExtension(&ExtendeeT::default_instance(), number,
1132  type, true, is_packed);
1133  }
1134 
1135  private:
1136  static void InitializeDefaultRepeatedFields();
1137  static void DestroyDefaultRepeatedFields();
1138 };
1139 
1140 // -------------------------------------------------------------------
1141 // EnumTypeTraits
1142 
1143 // ExtensionSet represents enums using integers internally, so we have to
1144 // static_cast around.
1145 template <typename Type, bool IsValid(int)>
1147  public:
1148  typedef Type ConstType;
1151 
1152  static inline ConstType Get(int number, const ExtensionSet& set,
1153  ConstType default_value) {
1154  return static_cast<Type>(set.GetEnum(number, default_value));
1155  }
1156  static inline void Set(int number, FieldType field_type, ConstType value,
1157  ExtensionSet* set) {
1158  GOOGLE_DCHECK(IsValid(value));
1159  set->SetEnum(number, field_type, value, NULL);
1160  }
1161  template <typename ExtendeeT>
1162  static void Register(int number, FieldType type, bool is_packed) {
1163  ExtensionSet::RegisterEnumExtension(&ExtendeeT::default_instance(), number,
1164  type, false, is_packed, IsValid);
1165  }
1166 };
1167 
1168 template <typename Type, bool IsValid(int)>
1170  public:
1171  typedef Type ConstType;
1174 
1176 
1177  static inline ConstType Get(int number, const ExtensionSet& set, int index) {
1178  return static_cast<Type>(set.GetRepeatedEnum(number, index));
1179  }
1180  static inline void Set(int number, int index, ConstType value,
1181  ExtensionSet* set) {
1182  GOOGLE_DCHECK(IsValid(value));
1183  set->SetRepeatedEnum(number, index, value);
1184  }
1185  static inline void Add(int number, FieldType field_type, bool is_packed,
1187  GOOGLE_DCHECK(IsValid(value));
1188  set->AddEnum(number, field_type, is_packed, value, NULL);
1189  }
1190  static inline const RepeatedField<Type>& GetRepeated(
1191  int number, const ExtensionSet& set) {
1192  // Hack: the `Extension` struct stores a RepeatedField<int> for enums.
1193  // RepeatedField<int> cannot implicitly convert to RepeatedField<EnumType>
1194  // so we need to do some casting magic. See message.h for similar
1195  // contortions for non-extension fields.
1196  return *reinterpret_cast<const RepeatedField<Type>*>(
1197  set.GetRawRepeatedField(number, GetDefaultRepeatedField()));
1198  }
1199 
1202  bool is_packed,
1203  ExtensionSet* set) {
1204  return reinterpret_cast<RepeatedField<Type>*>(
1205  set->MutableRawRepeatedField(number, field_type, is_packed, NULL));
1206  }
1207 
1209  // Hack: as noted above, repeated enum fields are internally stored as a
1210  // RepeatedField<int>. We need to be able to instantiate global static
1211  // objects to return as default (empty) repeated fields on non-existent
1212  // extensions. We would not be able to know a-priori all of the enum types
1213  // (values of |Type|) to instantiate all of these, so we just re-use int32's
1214  // default repeated field object.
1215  return reinterpret_cast<const RepeatedField<Type>*>(
1217  }
1218  template <typename ExtendeeT>
1219  static void Register(int number, FieldType type, bool is_packed) {
1220  ExtensionSet::RegisterEnumExtension(&ExtendeeT::default_instance(), number,
1221  type, true, is_packed, IsValid);
1222  }
1223 };
1224 
1225 // -------------------------------------------------------------------
1226 // MessageTypeTraits
1227 
1228 // ExtensionSet guarantees that when manipulating extensions with message
1229 // types, the implementation used will be the compiled-in class representing
1230 // that type. So, we can static_cast down to the exact type we expect.
1231 template <typename Type>
1233  public:
1234  typedef const Type& ConstType;
1235  typedef Type* MutableType;
1237 
1238  static inline ConstType Get(int number, const ExtensionSet& set,
1239  ConstType default_value) {
1240  return static_cast<const Type&>(set.GetMessage(number, default_value));
1241  }
1243  ExtensionSet* set) {
1244  return static_cast<Type*>(set->MutableMessage(
1246  }
1247  static inline void SetAllocated(int number, FieldType field_type,
1249  set->SetAllocatedMessage(number, field_type, NULL, message);
1250  }
1253  ExtensionSet* set) {
1254  set->UnsafeArenaSetAllocatedMessage(number, field_type, NULL, message);
1255  }
1256  static inline MutableType Release(int number, FieldType /* field_type */,
1257  ExtensionSet* set) {
1258  return static_cast<Type*>(
1259  set->ReleaseMessage(number, Type::default_instance()));
1260  }
1262  FieldType /* field_type */,
1263  ExtensionSet* set) {
1264  return static_cast<Type*>(
1265  set->UnsafeArenaReleaseMessage(number, Type::default_instance()));
1266  }
1267  template <typename ExtendeeT>
1268  static void Register(int number, FieldType type, bool is_packed) {
1269  ExtensionSet::RegisterMessageExtension(&ExtendeeT::default_instance(),
1270  number, type, false, is_packed,
1272  }
1273 };
1274 
1275 // forward declaration
1276 class RepeatedMessageGenericTypeTraits;
1277 
1278 template <typename Type>
1280  public:
1281  typedef const Type& ConstType;
1282  typedef Type* MutableType;
1284 
1286 
1287  static inline ConstType Get(int number, const ExtensionSet& set, int index) {
1288  return static_cast<const Type&>(set.GetRepeatedMessage(number, index));
1289  }
1290  static inline MutableType Mutable(int number, int index, ExtensionSet* set) {
1291  return static_cast<Type*>(set->MutableRepeatedMessage(number, index));
1292  }
1294  ExtensionSet* set) {
1295  return static_cast<Type*>(
1296  set->AddMessage(number, field_type, Type::default_instance(), NULL));
1297  }
1298  static inline const RepeatedPtrField<Type>& GetRepeated(
1299  int number, const ExtensionSet& set) {
1300  // See notes above in RepeatedEnumTypeTraits::GetRepeated(): same
1301  // casting hack applies here, because a RepeatedPtrField<MessageLite>
1302  // cannot naturally become a RepeatedPtrType<Type> even though Type is
1303  // presumably a message. google::protobuf::Message goes through similar contortions
1304  // with a reinterpret_cast<>.
1305  return *reinterpret_cast<const RepeatedPtrField<Type>*>(
1306  set.GetRawRepeatedField(number, GetDefaultRepeatedField()));
1307  }
1310  bool is_packed,
1311  ExtensionSet* set) {
1312  return reinterpret_cast<RepeatedPtrField<Type>*>(
1313  set->MutableRawRepeatedField(number, field_type, is_packed, NULL));
1314  }
1315 
1317  template <typename ExtendeeT>
1318  static void Register(int number, FieldType type, bool is_packed) {
1319  ExtensionSet::RegisterMessageExtension(&ExtendeeT::default_instance(),
1320  number, type, true, is_packed,
1322  }
1323 };
1324 
1325 template <typename Type>
1328  static auto instance = OnShutdownDelete(new RepeatedFieldType);
1329  return instance;
1330 }
1331 
1332 // -------------------------------------------------------------------
1333 // ExtensionIdentifier
1334 
1335 // This is the type of actual extension objects. E.g. if you have:
1336 // extends Foo with optional int32 bar = 1234;
1337 // then "bar" will be defined in C++ as:
1338 // ExtensionIdentifier<Foo, PrimitiveTypeTraits<int32>, 1, false> bar(1234);
1339 //
1340 // Note that we could, in theory, supply the field number as a template
1341 // parameter, and thus make an instance of ExtensionIdentifier have no
1342 // actual contents. However, if we did that, then using an extension
1343 // identifier would not necessarily cause the compiler to output any sort
1344 // of reference to any symbol defined in the extension's .pb.o file. Some
1345 // linkers will actually drop object files that are not explicitly referenced,
1346 // but that would be bad because it would cause this extension to not be
1347 // registered at static initialization, and therefore using it would crash.
1348 
1349 template <typename ExtendeeType, typename TypeTraitsType, FieldType field_type,
1350  bool is_packed>
1352  public:
1353  typedef TypeTraitsType TypeTraits;
1354  typedef ExtendeeType Extendee;
1355 
1356  ExtensionIdentifier(int number, typename TypeTraits::ConstType default_value)
1358  Register(number);
1359  }
1360  inline int number() const { return number_; }
1361  typename TypeTraits::ConstType default_value() const {
1362  return default_value_;
1363  }
1364 
1365  static void Register(int number) {
1366  TypeTraits::template Register<ExtendeeType>(number, field_type, is_packed);
1367  }
1368 
1369  private:
1370  const int number_;
1371  typename TypeTraits::ConstType default_value_;
1372 };
1373 
1374 // -------------------------------------------------------------------
1375 // Generated accessors
1376 
1377 // This macro should be expanded in the context of a generated type which
1378 // has extensions.
1379 //
1380 // We use "_proto_TypeTraits" as a type name below because "TypeTraits"
1381 // causes problems if the class has a nested message or enum type with that
1382 // name and "_TypeTraits" is technically reserved for the C++ library since
1383 // it starts with an underscore followed by a capital letter.
1384 //
1385 // For similar reason, we use "_field_type" and "_is_packed" as parameter names
1386 // below, so that "field_type" and "is_packed" can be used as field names.
1387 #define GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(CLASSNAME) \
1388  /* Has, Size, Clear */ \
1389  template <typename _proto_TypeTraits, \
1390  ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type, \
1391  bool _is_packed> \
1392  inline bool HasExtension( \
1393  const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< \
1394  CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) const { \
1395  return _extensions_.Has(id.number()); \
1396  } \
1397  \
1398  template <typename _proto_TypeTraits, \
1399  ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type, \
1400  bool _is_packed> \
1401  inline void ClearExtension( \
1402  const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< \
1403  CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) { \
1404  _extensions_.ClearExtension(id.number()); \
1405  } \
1406  \
1407  template <typename _proto_TypeTraits, \
1408  ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type, \
1409  bool _is_packed> \
1410  inline int ExtensionSize( \
1411  const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< \
1412  CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) const { \
1413  return _extensions_.ExtensionSize(id.number()); \
1414  } \
1415  \
1416  /* Singular accessors */ \
1417  template <typename _proto_TypeTraits, \
1418  ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type, \
1419  bool _is_packed> \
1420  inline typename _proto_TypeTraits::Singular::ConstType GetExtension( \
1421  const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< \
1422  CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) const { \
1423  return _proto_TypeTraits::Get(id.number(), _extensions_, \
1424  id.default_value()); \
1425  } \
1426  \
1427  template <typename _proto_TypeTraits, \
1428  ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type, \
1429  bool _is_packed> \
1430  inline typename _proto_TypeTraits::Singular::MutableType MutableExtension( \
1431  const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< \
1432  CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) { \
1433  return _proto_TypeTraits::Mutable(id.number(), _field_type, \
1434  &_extensions_); \
1435  } \
1436  \
1437  template <typename _proto_TypeTraits, \
1438  ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type, \
1439  bool _is_packed> \
1440  inline void SetExtension( \
1441  const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< \
1442  CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id, \
1443  typename _proto_TypeTraits::Singular::ConstType value) { \
1444  _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_); \
1445  } \
1446  \
1447  template <typename _proto_TypeTraits, \
1448  ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type, \
1449  bool _is_packed> \
1450  inline void SetAllocatedExtension( \
1451  const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< \
1452  CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id, \
1453  typename _proto_TypeTraits::Singular::MutableType value) { \
1454  _proto_TypeTraits::SetAllocated(id.number(), _field_type, value, \
1455  &_extensions_); \
1456  } \
1457  template <typename _proto_TypeTraits, \
1458  ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type, \
1459  bool _is_packed> \
1460  inline void UnsafeArenaSetAllocatedExtension( \
1461  const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< \
1462  CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id, \
1463  typename _proto_TypeTraits::Singular::MutableType value) { \
1464  _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type, \
1465  value, &_extensions_); \
1466  } \
1467  template <typename _proto_TypeTraits, \
1468  ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type, \
1469  bool _is_packed> \
1470  inline typename _proto_TypeTraits::Singular::MutableType ReleaseExtension( \
1471  const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< \
1472  CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) { \
1473  return _proto_TypeTraits::Release(id.number(), _field_type, \
1474  &_extensions_); \
1475  } \
1476  template <typename _proto_TypeTraits, \
1477  ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type, \
1478  bool _is_packed> \
1479  inline typename _proto_TypeTraits::Singular::MutableType \
1480  UnsafeArenaReleaseExtension( \
1481  const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< \
1482  CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) { \
1483  return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type, \
1484  &_extensions_); \
1485  } \
1486  \
1487  /* Repeated accessors */ \
1488  template <typename _proto_TypeTraits, \
1489  ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type, \
1490  bool _is_packed> \
1491  inline typename _proto_TypeTraits::Repeated::ConstType GetExtension( \
1492  const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< \
1493  CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id, \
1494  int index) const { \
1495  return _proto_TypeTraits::Get(id.number(), _extensions_, index); \
1496  } \
1497  \
1498  template <typename _proto_TypeTraits, \
1499  ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type, \
1500  bool _is_packed> \
1501  inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension( \
1502  const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< \
1503  CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id, \
1504  int index) { \
1505  return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_); \
1506  } \
1507  \
1508  template <typename _proto_TypeTraits, \
1509  ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type, \
1510  bool _is_packed> \
1511  inline void SetExtension( \
1512  const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< \
1513  CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id, \
1514  int index, typename _proto_TypeTraits::Repeated::ConstType value) { \
1515  _proto_TypeTraits::Set(id.number(), index, value, &_extensions_); \
1516  } \
1517  \
1518  template <typename _proto_TypeTraits, \
1519  ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type, \
1520  bool _is_packed> \
1521  inline typename _proto_TypeTraits::Repeated::MutableType AddExtension( \
1522  const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< \
1523  CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) { \
1524  return _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_); \
1525  } \
1526  \
1527  template <typename _proto_TypeTraits, \
1528  ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type, \
1529  bool _is_packed> \
1530  inline void AddExtension( \
1531  const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< \
1532  CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id, \
1533  typename _proto_TypeTraits::Repeated::ConstType value) { \
1534  _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value, \
1535  &_extensions_); \
1536  } \
1537  \
1538  template <typename _proto_TypeTraits, \
1539  ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type, \
1540  bool _is_packed> \
1541  inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType& \
1542  GetRepeatedExtension( \
1543  const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< \
1544  CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) const { \
1545  return _proto_TypeTraits::GetRepeated(id.number(), _extensions_); \
1546  } \
1547  \
1548  template <typename _proto_TypeTraits, \
1549  ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type, \
1550  bool _is_packed> \
1551  inline typename _proto_TypeTraits::Repeated::RepeatedFieldType* \
1552  MutableRepeatedExtension( \
1553  const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< \
1554  CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) { \
1555  return _proto_TypeTraits::MutableRepeated(id.number(), _field_type, \
1556  _is_packed, &_extensions_); \
1557  }
1558 
1559 } // namespace internal
1560 
1561 // Call this function to ensure that this extensions's reflection is linked into
1562 // the binary:
1563 //
1564 // google::protobuf::LinkExtensionReflection(Foo::my_extension);
1565 //
1566 // This will ensure that the following lookup will succeed:
1567 //
1568 // DescriptorPool::generated_pool()->FindExtensionByName("Foo.my_extension");
1569 //
1570 // This is often relevant for parsing extensions in text mode.
1571 //
1572 // As a side-effect, it will also guarantee that anything else from the same
1573 // .proto file will also be available for lookup in the generated pool.
1574 //
1575 // This function does not actually register the extension, so it does not need
1576 // to be called before the lookup. However it does need to occur in a function
1577 // that cannot be stripped from the binary (ie. it must be reachable from main).
1578 //
1579 // Best practice is to call this function as close as possible to where the
1580 // reflection is actually needed. This function is very cheap to call, so you
1581 // should not need to worry about its runtime overhead except in tight loops (on
1582 // x86-64 it compiles into two "mov" instructions).
1583 template <typename ExtendeeType, typename TypeTraitsType,
1584  internal::FieldType field_type, bool is_packed>
1587  ExtendeeType, TypeTraitsType, field_type, is_packed>& extension) {
1588  const void* volatile unused = &extension;
1589  (void)&unused; // Use address to avoid an extra load of volatile variable.
1590 }
1591 
1592 } // namespace protobuf
1593 } // namespace google
1594 
1595 #include <google/protobuf/port_undef.inc>
1596 
1597 #endif // GOOGLE_PROTOBUF_EXTENSION_SET_H__
google::protobuf.internal::ExtensionInfo::message_info
MessageInfo message_info
Definition: extension_set.h:128
google::protobuf.internal::RepeatedPrimitiveTypeTraits::ConstType
Type ConstType
Definition: extension_set.h:960
google::protobuf.internal::EnumTypeTraits::Set
static void Set(int number, FieldType field_type, ConstType value, ExtensionSet *set)
Definition: extension_set.h:1156
google::protobuf.internal::ExtensionSet::Extension::is_repeated
bool is_repeated
Definition: extension_set.h:581
google::protobuf.internal::RepeatedMessageTypeTraits::Mutable
static MutableType Mutable(int number, int index, ExtensionSet *set)
Definition: extension_set.h:1290
google::protobuf.internal::ExtensionSet::Extension::repeated_uint64_value
RepeatedField< uint64 > * repeated_uint64_value
Definition: extension_set.h:571
google::protobuf.internal.wire_format.MessageSetItemByteSize
def MessageSetItemByteSize(field_number, msg)
Definition: wire_format.py:204
Json::UInt64
unsigned long long int UInt64
Definition: json.h:241
google::protobuf.internal::ExtensionSet
Definition: extension_set.h:179
google::protobuf.internal::StringTypeTraits::Set
static void Set(int number, FieldType field_type, const std::string &value, ExtensionSet *set)
Definition: extension_set.h:1073
google::protobuf::RepeatedPtrField< std::string >
google::protobuf.internal::EnumTypeTraits::Get
static ConstType Get(int number, const ExtensionSet &set, ConstType default_value)
Definition: extension_set.h:1152
google::protobuf.internal::EnumValidityFuncWithArg
bool EnumValidityFuncWithArg(const void *arg, int number)
Definition: extension_set.h:102
google::protobuf::python::descriptor::Find
int Find(PyContainer *self, PyObject *item)
Definition: descriptor_containers.cc:633
google::protobuf.internal::RepeatedEnumTypeTraits::MutableType
Type MutableType
Definition: extension_set.h:1172
google::protobuf.internal::ExtensionInfo::is_repeated
bool is_repeated
Definition: extension_set.h:114
google::protobuf.internal::PrimitiveTypeTraits
Definition: extension_set.h:940
google::protobuf::FieldDescriptor
Definition: src/google/protobuf/descriptor.h:515
google::protobuf.internal::ExtensionSet::MutableString
std::string * MutableString(int number, FieldType type, desc)
Definition: extension_set.cc:523
google::protobuf.internal::InternalMetadataWithArenaLite
Definition: metadata_lite.h:175
google::protobuf.internal::ExtensionSet::ForEach
KeyValueFunctor ForEach(KeyValueFunctor func) const
Definition: extension_set.h:703
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
#define GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeName)
Definition: macros.h:40
google::protobuf.internal::ExtensionIdentifier::ExtensionIdentifier
ExtensionIdentifier(int number, typename TypeTraits::ConstType default_value)
Definition: extension_set.h:1356
google::protobuf.internal::RepeatedStringTypeTraits::GetRepeated
static const RepeatedPtrField< std::string > & GetRepeated(int number, const ExtensionSet &set)
Definition: extension_set.h:1115
wire_format_lite.h
google::protobuf.internal::InternalMetadataWithArena
Definition: metadata.h:52
google::protobuf.internal::MessageTypeTraits::Register
static void Register(int number, FieldType type, bool is_packed)
Definition: extension_set.h:1268
google::protobuf::extension
const Descriptor::ReservedRange const EnumValueDescriptor const MethodDescriptor extension
Definition: src/google/protobuf/descriptor.h:2001
end
GLuint GLuint end
Definition: glcorearb.h:2858
google::protobuf.internal::ExtensionSet::Extension::message_value
MessageLite * message_value
Definition: extension_set.h:565
google::protobuf.internal::RepeatedPrimitiveDefaults::default_repeated_field_uint32_
RepeatedField< uint32 > default_repeated_field_uint32_
Definition: extension_set.h:993
NULL
NULL
Definition: test_security_zap.cpp:405
google::protobuf.internal::RepeatedStringTypeTraits::Register
static void Register(int number, FieldType type, bool is_packed)
Definition: extension_set.h:1130
google::protobuf.internal::ExtensionSet::Extension::is_packed
bool is_packed
Definition: extension_set.h:599
Bool
Definition: gtest_pred_impl_unittest.cc:56
google::protobuf::int64
int64_t int64
Definition: protobuf/src/google/protobuf/stubs/port.h:151
field_type
zend_class_entry * field_type
Definition: php/ext/google/protobuf/message.c:2028
google::protobuf.internal::PrimitiveTypeTraits::Register
static void Register(int number, FieldType type, bool is_packed)
Definition: extension_set.h:951
google::protobuf.internal.python_message.MergeFrom
MergeFrom
Definition: python_message.py:1340
google::protobuf.internal::RepeatedPrimitiveDefaults
Definition: extension_set.h:986
google::protobuf.internal::ExtensionInfo::enum_validity_check
EnumValidityCheck enum_validity_check
Definition: extension_set.h:127
google::protobuf.internal::EnumTypeTraits::MutableType
Type MutableType
Definition: extension_set.h:1149
item
cJSON * item
Definition: cJSON.h:236
google::protobuf.internal::ExtensionInfo::EnumValidityCheck::arg
const void * arg
Definition: extension_set.h:119
google::protobuf.internal::EnumTypeTraits::Register
static void Register(int number, FieldType type, bool is_packed)
Definition: extension_set.h:1162
input
std::string input
Definition: tokenizer_unittest.cc:197
google::protobuf::uint8
uint8_t uint8
Definition: protobuf/src/google/protobuf/stubs/port.h:153
google::protobuf.internal::RepeatedEnumTypeTraits::GetDefaultRepeatedField
static const RepeatedFieldType * GetDefaultRepeatedField()
Definition: extension_set.h:1208
google::protobuf.internal::ExtensionSet::Extension::uint64_value
uint64 uint64_value
Definition: extension_set.h:559
GOOGLE_DCHECK
#define GOOGLE_DCHECK
Definition: logging.h:194
arena_
std::unique_ptr< Arena > arena_
Definition: lite_arena_unittest.cc:51
benchmarks.util.result_uploader.metadata
def metadata
Definition: result_uploader.py:97
google::protobuf.internal::ExtensionSet::Size
size_t Size() const
Definition: extension_set.h:678
google::protobuf.internal::ExtensionInfo::ExtensionInfo
ExtensionInfo(FieldType type_param, bool isrepeated, bool ispacked)
Definition: extension_set.h:107
google::protobuf::uint32
uint32_t uint32
Definition: protobuf/src/google/protobuf/stubs/port.h:155
google::protobuf.internal::StringTypeTraits::MutableType
std::string * MutableType
Definition: extension_set.h:1066
google::protobuf.internal::ExtensionSet::Extension::repeated_uint32_value
RepeatedField< uint32 > * repeated_uint32_value
Definition: extension_set.h:570
google::protobuf.internal::ParseContext
Definition: parse_context.h:322
google::protobuf.internal::ExtensionSet::Extension::cached_size
int cached_size
Definition: extension_set.h:604
google::protobuf.internal::ExtensionInfo::MessageInfo
Definition: extension_set.h:122
desc
#define desc
Definition: extension_set.h:342
google::protobuf.internal::RepeatedPrimitiveTypeTraits::Repeated
RepeatedPrimitiveTypeTraits< Type > Repeated
Definition: extension_set.h:962
google::protobuf.internal::FieldSkipper
Definition: wire_format_lite.h:726
google::protobuf.internal::ExtensionSet::Extension::bool_value
bool bool_value
Definition: extension_set.h:562
google::protobuf.internal::RepeatedEnumTypeTraits::Set
static void Set(int number, int index, ConstType value, ExtensionSet *set)
Definition: extension_set.h:1180
google::protobuf.internal::GeneratedExtensionFinder::GeneratedExtensionFinder
GeneratedExtensionFinder(const MessageLite *containing_type)
Definition: extension_set.h:151
PROTOBUF_DEFINE_PRIMITIVE_TYPE
#define PROTOBUF_DEFINE_PRIMITIVE_TYPE(TYPE, METHOD)
Definition: extension_set.h:1000
google::protobuf.internal::ExtensionSet::Extension::repeated_bool_value
RepeatedField< bool > * repeated_bool_value
Definition: extension_set.h:574
google::protobuf.internal::MessageTypeTraits::UnsafeArenaSetAllocated
static void UnsafeArenaSetAllocated(int number, FieldType field_type, MutableType message, ExtensionSet *set)
Definition: extension_set.h:1251
google::protobuf.internal::MessageTypeTraits::UnsafeArenaRelease
static MutableType UnsafeArenaRelease(int number, FieldType, ExtensionSet *set)
Definition: extension_set.h:1261
string
GLsizei const GLchar *const * string
Definition: glcorearb.h:3083
google::protobuf::RepeatedField< int32 >
google::protobuf.internal::RepeatedMessageTypeTraits::Repeated
RepeatedMessageTypeTraits< Type > Repeated
Definition: extension_set.h:1283
google::protobuf.internal::RepeatedMessageTypeTraits::MutableType
Type * MutableType
Definition: extension_set.h:1282
google::protobuf.internal::RepeatedEnumTypeTraits::Register
static void Register(int number, FieldType type, bool is_packed)
Definition: extension_set.h:1219
Type::default_instance
static const Type & default_instance()
Definition: type.pb.cc:455
google::protobuf.internal::MessageTypeTraits::Release
static MutableType Release(int number, FieldType, ExtensionSet *set)
Definition: extension_set.h:1256
google::protobuf::MessageLite
Definition: message_lite.h:183
target
GLenum target
Definition: glcorearb.h:3739
descriptor
Descriptor * descriptor
Definition: php/ext/google/protobuf/protobuf.h:936
google::protobuf.internal.python_message._InternalParse
_InternalParse
Definition: python_message.py:1197
google::protobuf.internal::PrimitiveTypeTraits::ConstType
Type ConstType
Definition: extension_set.h:942
google::protobuf.internal::PrimitiveTypeTraits::Set
static void Set(int number, FieldType field_type, ConstType value, ExtensionSet *set)
port.h
google::protobuf::python::cmessage::UnknownFieldSet
static PyObject * UnknownFieldSet(CMessage *self)
Definition: python/google/protobuf/pyext/message.cc:2501
testing::internal::Int32
TypeWithSize< 4 >::Int Int32
Definition: gtest-port.h:2241
google::protobuf.internal::ExtensionSet::KeyValue::first
int first
Definition: extension_set.h:636
google::protobuf::MessageFactory
Definition: src/google/protobuf/message.h:1069
T
#define T(upbtypeconst, upbtype, ctype, default_value)
google::protobuf.internal::ExtensionInfo::ExtensionInfo
ExtensionInfo()
Definition: extension_set.h:106
google::protobuf.internal::StringTypeTraits::Register
static void Register(int number, FieldType type, bool is_packed)
Definition: extension_set.h:1082
Descriptor
Definition: ruby/ext/google/protobuf_c/protobuf.h:113
google::protobuf.internal::RepeatedMessageTypeTraits::Register
static void Register(int number, FieldType type, bool is_packed)
Definition: extension_set.h:1318
google::protobuf.internal::RepeatedPrimitiveTypeTraits::GetDefaultRepeatedField
static const RepeatedFieldType * GetDefaultRepeatedField()
google::protobuf.internal::RepeatedMessageTypeTraits::MutableRepeated
static RepeatedPtrField< Type > * MutableRepeated(int number, FieldType field_type, bool is_packed, ExtensionSet *set)
Definition: extension_set.h:1308
google::protobuf.internal::ExtensionInfo::descriptor
const FieldDescriptor * descriptor
Definition: extension_set.h:134
google::protobuf.internal::MessageTypeTraits::Singular
MessageTypeTraits< Type > Singular
Definition: extension_set.h:1236
google::protobuf.internal::MessageTypeTraits::MutableType
Type * MutableType
Definition: extension_set.h:1235
google::protobuf.internal::RepeatedStringTypeTraits::MutableRepeated
static RepeatedPtrField< std::string > * MutableRepeated(int number, FieldType field_type, bool is_packed, ExtensionSet *set)
Definition: extension_set.h:1121
google::protobuf.internal::StringTypeTraits::ConstType
const typedef std::string & ConstType
Definition: extension_set.h:1065
google::protobuf.internal::ExtensionSet::Extension::lazymessage_value
LazyMessageExtension * lazymessage_value
Definition: extension_set.h:566
google::protobuf.internal::RepeatedEnumTypeTraits::RepeatedFieldType
RepeatedField< Type > RepeatedFieldType
Definition: extension_set.h:1175
google::protobuf.internal::ExtensionSet::Extension::int32_value
int32 int32_value
Definition: extension_set.h:556
testing::internal::Double
FloatingPoint< double > Double
Definition: gtest-internal.h:429
google::protobuf.internal::ExtensionSet::Extension::repeated_string_value
RepeatedPtrField< std::string > * repeated_string_value
Definition: extension_set.h:576
google::protobuf.internal::ExtensionSet::LazyMessageExtension::~LazyMessageExtension
virtual ~LazyMessageExtension()
Definition: extension_set.h:516
testing::internal::UInt32
TypeWithSize< 4 >::UInt UInt32
Definition: gtest-port.h:2242
parse_context.h
FieldDescriptor
Definition: ruby/ext/google/protobuf_c/protobuf.h:129
google::protobuf.internal::OnShutdownDelete
T * OnShutdownDelete(T *p)
Definition: common.h:185
message_type
zend_class_entry * message_type
Definition: php/ext/google/protobuf/message.c:45
google::protobuf.internal::RepeatedPrimitiveDefaults::default_repeated_field_int32_
RepeatedField< int32 > default_repeated_field_int32_
Definition: extension_set.h:991
google::protobuf::python::repeated_composite_container::AddMessage
static PyObject * AddMessage(RepeatedCompositeContainer *self, PyObject *value)
Definition: repeated_composite_container.cc:109
begin
static size_t begin(const upb_table *t)
Definition: php/ext/google/protobuf/upb.c:4898
google::protobuf.internal::RepeatedPrimitiveDefaults::default_repeated_field_double_
RepeatedField< double > default_repeated_field_double_
Definition: extension_set.h:995
google::protobuf::int32
int32_t int32
Definition: protobuf/src/google/protobuf/stubs/port.h:150
google::protobuf.internal::RepeatedMessageTypeTraits::RepeatedFieldType
RepeatedPtrField< Type > RepeatedFieldType
Definition: extension_set.h:1285
google::protobuf.internal::ExtensionSet::Extension::is_lazy
bool is_lazy
Definition: extension_set.h:596
google::protobuf.internal::RepeatedEnumTypeTraits::Add
static void Add(int number, FieldType field_type, bool is_packed, ConstType value, ExtensionSet *set)
Definition: extension_set.h:1185
google::protobuf.internal::ExtensionSet::Extension::float_value
float float_value
Definition: extension_set.h:560
google::protobuf::FindOrNull
const Collection::value_type::second_type * FindOrNull(const Collection &collection, const typename Collection::value_type::first_type &key)
Definition: map_util.h:137
google::protobuf.internal::GeneratedExtensionFinder
Definition: extension_set.h:149
google::protobuf.internal::ExtensionSet::Extension::repeated_int32_value
RepeatedField< int32 > * repeated_int32_value
Definition: extension_set.h:568
google::protobuf.internal::RepeatedEnumTypeTraits::ConstType
Type ConstType
Definition: extension_set.h:1171
google::protobuf.internal.python_message.ClearExtension
ClearExtension
Definition: python_message.py:914
google::protobuf.internal::ExtensionSet::Extension::repeated_double_value
RepeatedField< double > * repeated_double_value
Definition: extension_set.h:573
google::protobuf.internal::StringTypeTraits::Get
static const std::string & Get(int number, const ExtensionSet &set, ConstType default_value)
Definition: extension_set.h:1069
google::protobuf.internal::ExtensionSet::SetRepeatedString
void SetRepeatedString(int number, int index, const std::string &value)
Definition: extension_set.h:866
google::protobuf.internal::RepeatedPrimitiveTypeTraits::Add
static void Add(int number, FieldType field_type, bool is_packed, Type value, ExtensionSet *set)
Type
Definition: type.pb.h:182
google::protobuf.internal::ExtensionSet::Extension::repeated_message_value
RepeatedPtrField< MessageLite > * repeated_message_value
Definition: extension_set.h:577
google::protobuf.internal::ExtensionSet::RegisterEnumExtension
static void RegisterEnumExtension(const MessageLite *containing_type, int number, FieldType type, bool is_repeated, bool is_packed, EnumValidityFunc *is_valid)
Definition: extension_set.cc:160
google::protobuf.internal::field_type
WireFormatLite::FieldType field_type(FieldType type)
Definition: extension_set_heavy.cc:138
google::protobuf.internal::RepeatedPrimitiveDefaults::default_repeated_field_bool_
RepeatedField< bool > default_repeated_field_bool_
Definition: extension_set.h:997
google::protobuf.internal::ExtensionSet::Extension::repeated_float_value
RepeatedField< float > * repeated_float_value
Definition: extension_set.h:572
google::protobuf.internal::RepeatedStringTypeTraits::Get
static const std::string & Get(int number, const ExtensionSet &set, int index)
Definition: extension_set.h:1096
google::protobuf.internal::ExtensionSet::MutableRepeatedString
std::string * MutableRepeatedString(int number, int index)
Definition: extension_set.cc:546
google::protobuf.internal::ExtensionSet::Extension::type
FieldType type
Definition: extension_set.h:580
google::protobuf.internal::RepeatedPrimitiveTypeTraits::GetRepeated
static const RepeatedField< ConstType > & GetRepeated(int number, const ExtensionSet &set)
google::protobuf.internal::ToIntSize
int ToIntSize(size_t size)
Definition: message_lite.h:104
testing::internal::Float
FloatingPoint< float > Float
Definition: gtest-internal.h:428
coded_stream.h
google::protobuf.internal::RepeatedPrimitiveDefaults::default_repeated_field_uint64_
RepeatedField< uint64 > default_repeated_field_uint64_
Definition: extension_set.h:994
google::protobuf.internal::ExtensionSet::ForEach
static KeyValueFunctor ForEach(Iterator begin, Iterator end, KeyValueFunctor func)
Definition: extension_set.h:686
google::protobuf.internal::StringTypeTraits::Singular
StringTypeTraits Singular
Definition: extension_set.h:1067
google::protobuf.internal::ExtensionSet::KeyValue
Definition: extension_set.h:635
google::protobuf.internal::ExtensionSet::LazyMessageExtension::LazyMessageExtension
LazyMessageExtension()
Definition: extension_set.h:515
google::protobuf::uint16
uint16_t uint16
Definition: protobuf/src/google/protobuf/stubs/port.h:154
google::protobuf.internal::RepeatedMessageTypeTraits::ConstType
const typedef Type & ConstType
Definition: extension_set.h:1281
google::protobuf::python::cdescriptor_pool::New
static PyObject * New(PyTypeObject *type, PyObject *args, PyObject *kwargs)
Definition: descriptor_pool.cc:177
google::protobuf.internal::EnumTypeTraits
Definition: extension_set.h:1146
google::protobuf.internal::ExtensionInfo
Definition: extension_set.h:105
google::protobuf::DescriptorPool
Definition: src/google/protobuf/descriptor.h:1539
google::protobuf.internal::ExtensionSet::SetString
void SetString(int number, FieldType type, const std::string &value, desc)
Definition: extension_set.h:861
google::protobuf.internal::ExtensionSet::AddString
void AddString(int number, FieldType type, const std::string &value, desc)
google::protobuf.internal::ExtensionSet::LazyMessageExtension
Definition: extension_set.h:513
google::protobuf.internal::RepeatedStringTypeTraits::Repeated
RepeatedStringTypeTraits Repeated
Definition: extension_set.h:1092
google::protobuf.internal::MessageTypeTraits::ConstType
const typedef Type & ConstType
Definition: extension_set.h:1234
google::protobuf.internal::ExtensionSet::KeyValue::FirstComparator
Definition: extension_set.h:639
google::protobuf.internal::ExtensionInfo::MessageInfo::prototype
const MessageLite * prototype
Definition: extension_set.h:123
google::protobuf.internal::StringTypeTraits::Mutable
static std::string * Mutable(int number, FieldType field_type, ExtensionSet *set)
Definition: extension_set.h:1077
google::protobuf.internal::RepeatedEnumTypeTraits
Definition: extension_set.h:1169
google::protobuf.internal::ExtensionSet::GetArenaNoVirtual
Arena * GetArenaNoVirtual() const
Definition: extension_set.h:299
google::protobuf::uint64
uint64_t uint64
Definition: protobuf/src/google/protobuf/stubs/port.h:156
google::protobuf::LinkExtensionReflection
void LinkExtensionReflection(const google::protobuf::internal::ExtensionIdentifier< ExtendeeType, TypeTraitsType, field_type, is_packed > &extension)
Definition: extension_set.h:1585
google::protobuf.internal::ExtensionSet::KeyValue::FirstComparator::operator()
bool operator()(int key, const KeyValue &rhs) const
Definition: extension_set.h:646
repeated_field.h
google::protobuf.internal::ExtensionSet::RegisterExtension
static void RegisterExtension(const MessageLite *containing_type, int number, FieldType type, bool is_repeated, bool is_packed)
Definition: extension_set.cc:137
google::protobuf.internal::RepeatedMessageTypeTraits::GetDefaultRepeatedField
static const RepeatedFieldType * GetDefaultRepeatedField()
Definition: extension_set.h:1327
google::protobuf.internal::EnumTypeTraits::Singular
EnumTypeTraits< Type, IsValid > Singular
Definition: extension_set.h:1150
google::protobuf.internal::ExtensionSet::Extension::descriptor
const FieldDescriptor * descriptor
Definition: extension_set.h:609
google::protobuf.internal::RepeatedMessageTypeTraits::Get
static ConstType Get(int number, const ExtensionSet &set, int index)
Definition: extension_set.h:1287
google::protobuf.internal.python_message.ByteSize
ByteSize
Definition: python_message.py:1067
google::protobuf.internal::RepeatedStringTypeTraits::MutableType
std::string * MutableType
Definition: extension_set.h:1091
google::protobuf.internal::ExtensionIdentifier::default_value
TypeTraits::ConstType default_value() const
Definition: extension_set.h:1361
field
const FieldDescriptor * field
Definition: parser_unittest.cc:2694
google::uint64
uint64_t uint64
Definition: sdk/include/aditof/log.h:60
google::protobuf.internal::PrimitiveTypeTraits::Get
static ConstType Get(int number, const ExtensionSet &set, ConstType default_value)
key
const SETUP_TEARDOWN_TESTCONTEXT char * key
Definition: test_wss_transport.cpp:10
google::protobuf.internal::ExtensionSet::arena_
Arena * arena_
Definition: extension_set.h:840
google::protobuf.internal::ExtensionSet::Extension::int64_value
int64 int64_value
Definition: extension_set.h:557
google::protobuf.internal::ExtensionSet::AllocatedData
Definition: extension_set.h:847
google::protobuf.internal::ExtensionSet::is_large
bool is_large() const
Definition: extension_set.h:673
google::protobuf.internal::ExtensionFinder
Definition: extension_set.h:139
google::protobuf.internal::EnumTypeTraits::ConstType
Type ConstType
Definition: extension_set.h:1148
google::protobuf.internal::RepeatedStringTypeTraits::ConstType
const typedef std::string & ConstType
Definition: extension_set.h:1090
google::protobuf.internal::ExtensionIdentifier::number
int number() const
Definition: extension_set.h:1360
pool
InternalDescriptorPool * pool
Definition: php/ext/google/protobuf/protobuf.h:798
void
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
google::protobuf::io::CodedOutputStream
Definition: coded_stream.h:693
google::protobuf.internal::ExtensionSet::LargeMap
std::map< int, Extension > LargeMap
Definition: extension_set.h:652
google::protobuf.internal::RepeatedEnumTypeTraits::Get
static ConstType Get(int number, const ExtensionSet &set, int index)
Definition: extension_set.h:1177
google::protobuf.internal::ExtensionIdentifier
Definition: extension_set.h:1351
google::protobuf.internal::RepeatedPrimitiveTypeTraits::MutableType
Type MutableType
Definition: extension_set.h:961
google::protobuf.internal::RepeatedStringTypeTraits::Add
static std::string * Add(int number, FieldType field_type, ExtensionSet *set)
Definition: extension_set.h:1111
type
GLenum type
Definition: glcorearb.h:2695
google::protobuf.internal::RepeatedMessageTypeTraits
Definition: extension_set.h:1279
google::protobuf.internal::RepeatedStringTypeTraits::Mutable
static std::string * Mutable(int number, int index, ExtensionSet *set)
Definition: extension_set.h:1104
google::protobuf.internal::ExtensionSet::Extension::repeated_enum_value
RepeatedField< int > * repeated_enum_value
Definition: extension_set.h:575
google::protobuf.internal::MessageTypeTraits::Get
static ConstType Get(int number, const ExtensionSet &set, ConstType default_value)
Definition: extension_set.h:1238
google::protobuf.internal::RepeatedPrimitiveTypeTraits
Definition: extension_set.h:958
google::protobuf::Message
Definition: src/google/protobuf/message.h:205
google::protobuf.internal::RepeatedMessageTypeTraits::Add
static MutableType Add(int number, FieldType field_type, ExtensionSet *set)
Definition: extension_set.h:1293
google::protobuf.internal::ExtensionSet::Extension::string_value
std::string * string_value
Definition: extension_set.h:564
google::protobuf.internal::ExtensionIdentifier::Extendee
ExtendeeType Extendee
Definition: extension_set.h:1354
google::protobuf.internal::ExtensionSet::Extension::uint32_value
uint32 uint32_value
Definition: extension_set.h:558
google::protobuf.internal::ExtensionSet::flat_capacity_
uint16 flat_capacity_
Definition: extension_set.h:845
google::protobuf.internal.python_message.Clear
Clear
Definition: python_message.py:1431
google::protobuf.internal::RepeatedStringTypeTraits::Add
static void Add(int number, FieldType field_type, bool, const std::string &value, ExtensionSet *set)
Definition: extension_set.h:1107
google::protobuf::descriptor_unittest::AddEnum
EnumDescriptorProto * AddEnum(FileDescriptorProto *file, const std::string &name)
Definition: descriptor_unittest.cc:88
common.h
google::protobuf.internal::GeneratedExtensionFinder::~GeneratedExtensionFinder
virtual ~GeneratedExtensionFinder()
Definition: extension_set.h:153
google::protobuf.internal::MessageTypeTraits::Mutable
static MutableType Mutable(int number, FieldType field_type, ExtensionSet *set)
Definition: extension_set.h:1242
google::protobuf.internal::ExtensionInfo::EnumValidityCheck
Definition: extension_set.h:117
google::protobuf.internal::RepeatedStringTypeTraits
Definition: extension_set.h:1088
google::protobuf.internal::RepeatedPrimitiveDefaults::default_repeated_field_float_
RepeatedField< float > default_repeated_field_float_
Definition: extension_set.h:996
google::protobuf.internal::RepeatedPrimitiveTypeTraits::Get
static Type Get(int number, const ExtensionSet &set, int index)
google::protobuf.internal::RepeatedPrimitiveTypeTraits::Register
static void Register(int number, FieldType type, bool is_packed)
Definition: extension_set.h:980
google::protobuf.internal::ExtensionInfo::is_packed
bool is_packed
Definition: extension_set.h:115
google::protobuf.internal::ExtensionSet::Extension::enum_value
int enum_value
Definition: extension_set.h:563
google::protobuf.internal::ExtensionSet::Extension::repeated_int64_value
RepeatedField< int64 > * repeated_int64_value
Definition: extension_set.h:569
google::protobuf.internal.python_message.RegisterExtension
RegisterExtension
Definition: python_message.py:790
google::protobuf.internal::ExtensionSet::KeyValue::FirstComparator::operator()
bool operator()(const KeyValue &lhs, const KeyValue &rhs) const
Definition: extension_set.h:640
google::protobuf.internal::RepeatedPrimitiveTypeTraits::MutableRepeated
static RepeatedField< Type > * MutableRepeated(int number, FieldType field_type, bool is_packed, ExtensionSet *set)
google::protobuf.internal::RepeatedEnumTypeTraits::Repeated
RepeatedEnumTypeTraits< Type, IsValid > Repeated
Definition: extension_set.h:1173
func
GLenum func
Definition: glcorearb.h:3052
google::protobuf::io::CodedInputStream
Definition: coded_stream.h:173
google::protobuf.internal::RepeatedPrimitiveTypeTraits::Set
static void Set(int number, int index, Type value, ExtensionSet *set)
google::protobuf.internal::ExtensionSet::KeyValue::second
Extension second
Definition: extension_set.h:637
logging.h
cpp.gmock_class.set
set
Definition: gmock_class.py:44
google::protobuf.internal::ExtensionSet::Extension::is_cleared
bool is_cleared
Definition: extension_set.h:589
google::protobuf.internal::PrimitiveTypeTraits::MutableType
Type MutableType
Definition: extension_set.h:943
google::protobuf::Descriptor
Definition: src/google/protobuf/descriptor.h:231
google::protobuf.internal::ExtensionSet::RegisterMessageExtension
static void RegisterMessageExtension(const MessageLite *containing_type, int number, FieldType type, bool is_repeated, bool is_packed, const MessageLite *prototype)
Definition: extension_set.cc:172
default_value
def default_value(type_)
google::protobuf.internal::RepeatedStringTypeTraits::RepeatedFieldType
RepeatedPtrField< std::string > RepeatedFieldType
Definition: extension_set.h:1094
google::protobuf.internal::GeneratedExtensionFinder::containing_type_
const MessageLite * containing_type_
Definition: extension_set.h:159
google::protobuf.internal::ExtensionSet::flat_begin
const KeyValue * flat_begin() const
Definition: extension_set.h:827
google::protobuf.internal::ExtensionIdentifier::Register
static void Register(int number)
Definition: extension_set.h:1365
google::protobuf.internal::ExtensionIdentifier::number_
const int number_
Definition: extension_set.h:1370
google::protobuf.internal::MessageTypeTraits
Definition: extension_set.h:1232
google::protobuf.internal.python_message.IsInitialized
IsInitialized
Definition: python_message.py:1246
google::protobuf.internal::ExtensionIdentifier::TypeTraits
TypeTraitsType TypeTraits
Definition: extension_set.h:1353
google::protobuf.internal::RepeatedMessageTypeTraits::GetRepeated
static const RepeatedPtrField< Type > & GetRepeated(int number, const ExtensionSet &set)
Definition: extension_set.h:1298
google::protobuf.internal::ExtensionSet::AllocatedData::large
LargeMap * large
Definition: extension_set.h:852
google::protobuf.internal::ExtensionIdentifier::default_value_
TypeTraits::ConstType default_value_
Definition: extension_set.h:1371
google::protobuf.internal::RepeatedPrimitiveDefaults::default_repeated_field_int64_
RepeatedField< int64 > default_repeated_field_int64_
Definition: extension_set.h:992
internal
Definition: any.pb.h:40
google::protobuf.internal::ReadTag
const char * ReadTag(const char *p, uint32 *out)
Definition: parse_context.h:433
google::protobuf.internal::ExtensionSet::flat_begin
KeyValue * flat_begin()
Definition: extension_set.h:823
google::protobuf::python::repeated_composite_container::Insert
static PyObject * Insert(PyObject *pself, PyObject *args)
Definition: repeated_composite_container.cc:139
google::protobuf.internal::RepeatedEnumTypeTraits::GetRepeated
static const RepeatedField< Type > & GetRepeated(int number, const ExtensionSet &set)
Definition: extension_set.h:1190
google::protobuf.internal::EnumValidityFunc
bool EnumValidityFunc(int number)
Definition: extension_set.h:98
value
GLsizei const GLfloat * value
Definition: glcorearb.h:3093
google::protobuf.internal::ExtensionSet::KeyValue::FirstComparator::operator()
bool operator()(const KeyValue &lhs, int key) const
Definition: extension_set.h:643
google::protobuf.internal::ExtensionInfo::type
FieldType type
Definition: extension_set.h:113
google::protobuf.internal::ExtensionSet::Extension
Definition: extension_set.h:552
output
const upb_json_parsermethod const upb_symtab upb_sink * output
Definition: ruby/ext/google/protobuf_c/upb.h:10503
google::protobuf.internal::PrimitiveTypeTraits::Singular
PrimitiveTypeTraits< Type > Singular
Definition: extension_set.h:944
google::protobuf.internal::ExtensionSet::flat_size_
uint16 flat_size_
Definition: extension_set.h:846
DescriptorPool
Definition: ruby/ext/google/protobuf_c/protobuf.h:109
google::protobuf.internal::RepeatedStringTypeTraits::Set
static void Set(int number, int index, const std::string &value, ExtensionSet *set)
Definition: extension_set.h:1100
google::protobuf.internal::FieldType
uint8 FieldType
Definition: extension_set.h:87
index
GLuint index
Definition: glcorearb.h:3055
google::protobuf.internal::MessageTypeTraits::SetAllocated
static void SetAllocated(int number, FieldType field_type, MutableType message, ExtensionSet *set)
Definition: extension_set.h:1247
google::protobuf.internal::ExtensionSet::ForEach
KeyValueFunctor ForEach(KeyValueFunctor func)
Definition: extension_set.h:694
google::protobuf.internal::MessageSetFieldSkipper
Definition: extension_set_heavy.cc:61
google::protobuf.internal::WireFormatLite::kMessageSetItemStartTag
static const int kMessageSetItemStartTag
Definition: wire_format_lite.h:215
Json::Int64
long long int Int64
Definition: json.h:240
number
double number
Definition: cJSON.h:326
google::protobuf.internal::RepeatedPrimitiveTypeTraits::RepeatedFieldType
RepeatedField< Type > RepeatedFieldType
Definition: extension_set.h:964
it
MapIter it
Definition: php/ext/google/protobuf/map.c:205
google
Definition: data_proto2_to_proto3_util.h:11
message
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glcorearb.h:2695
google::protobuf.internal::RepeatedEnumTypeTraits::MutableRepeated
static RepeatedField< Type > * MutableRepeated(int number, FieldType field_type, bool is_packed, ExtensionSet *set)
Definition: extension_set.h:1200
GOOGLE_PROTOBUF_PARSER_ASSERT
#define GOOGLE_PROTOBUF_PARSER_ASSERT(predicate)
Definition: parse_context.h:633
google::protobuf.internal::ExtensionSet::flat_end
const KeyValue * flat_end() const
Definition: extension_set.h:835
google::protobuf.internal::StringTypeTraits
Definition: extension_set.h:1063
google::protobuf.internal::ExtensionSet::flat_end
KeyValue * flat_end()
Definition: extension_set.h:831
google::protobuf.internal::ExtensionSet::Extension::double_value
double double_value
Definition: extension_set.h:561
google::protobuf.internal::ExtensionInfo::EnumValidityCheck::func
EnumValidityFuncWithArg * func
Definition: extension_set.h:118
google::protobuf.internal::ExtensionSet::AllocatedData::flat
KeyValue * flat
Definition: extension_set.h:848


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:51