map_entry_lite.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 #ifndef GOOGLE_PROTOBUF_MAP_ENTRY_LITE_H__
32 #define GOOGLE_PROTOBUF_MAP_ENTRY_LITE_H__
33 
34 #include <assert.h>
35 #include <string>
36 
40 #include <google/protobuf/arena.h>
43 #include <google/protobuf/map.h>
45 #include <google/protobuf/port.h>
47 
48 #include <google/protobuf/port_def.inc>
49 #ifdef SWIG
50 #error "You cannot SWIG proto headers"
51 #endif
52 
53 namespace google {
54 namespace protobuf {
55 namespace internal {
56 template <typename Derived, typename Key, typename Value,
57  WireFormatLite::FieldType kKeyFieldType,
58  WireFormatLite::FieldType kValueFieldType, int default_enum_value>
59 class MapEntry;
60 template <typename Derived, typename Key, typename Value,
61  WireFormatLite::FieldType kKeyFieldType,
62  WireFormatLite::FieldType kValueFieldType, int default_enum_value>
63 class MapFieldLite;
64 } // namespace internal
65 } // namespace protobuf
66 } // namespace google
67 
68 namespace google {
69 namespace protobuf {
70 namespace internal {
71 
72 // MoveHelper::Move is used to set *dest. It copies *src, or moves it (in
73 // the C++11 sense), or swaps it. *src is left in a sane state for
74 // subsequent destruction, but shouldn't be used for anything.
75 template <bool is_enum, bool is_message, bool is_stringlike, typename T>
76 struct MoveHelper { // primitives
77  static void Move(T* src, T* dest) { *dest = *src; }
78 };
79 
80 template <bool is_message, bool is_stringlike, typename T>
81 struct MoveHelper<true, is_message, is_stringlike, T> { // enums
82  static void Move(T* src, T* dest) { *dest = *src; }
83  // T is an enum here, so allow conversions to and from int.
84  static void Move(T* src, int* dest) { *dest = static_cast<int>(*src); }
85  static void Move(int* src, T* dest) { *dest = static_cast<T>(*src); }
86 };
87 
88 template <bool is_stringlike, typename T>
89 struct MoveHelper<false, true, is_stringlike, T> { // messages
90  static void Move(T* src, T* dest) { dest->Swap(src); }
91 };
92 
93 template <typename T>
94 struct MoveHelper<false, false, true, T> { // strings and similar
95  static void Move(T* src, T* dest) {
96 #if __cplusplus >= 201103L
97  *dest = std::move(*src);
98 #else
99  dest->swap(*src);
100 #endif
101  }
102 };
103 
104 // Functions for operating on a map entry. Does not contain any representation
105 // (this class is not intended to be instantiated).
106 template <typename Key, typename Value, WireFormatLite::FieldType kKeyFieldType,
107  WireFormatLite::FieldType kValueFieldType>
111  static const int kKeyFieldNumber = 1;
112  static const int kValueFieldNumber = 2;
113 
114  static void SerializeToCodedStream(int field_number, const Key& key,
115  const Value& value,
117  WireFormatLite::WriteTag(field_number,
119  output->WriteVarint32(GetCachedSize(key, value));
122  }
123 
129  static_cast<uint32>(GetCachedSize(key, value)), output);
130  output = KeyTypeHandler::WriteToArray(kKeyFieldNumber, key, output);
131  output = ValueTypeHandler::WriteToArray(kValueFieldNumber, value, output);
132  return output;
133  }
134 
135  static size_t ByteSizeLong(const Key& key, const Value& value) {
136  // Tags for key and value will both be one byte (field numbers 1 and 2).
137  size_t inner_length =
139  return inner_length + io::CodedOutputStream::VarintSize32(inner_length);
140  }
141 
142  static int GetCachedSize(const Key& key, const Value& value) {
143  // Tags for key and value will both be one byte (field numbers 1 and 2).
144  return 2 + KeyTypeHandler::GetCachedSize(key) +
145  ValueTypeHandler::GetCachedSize(value);
146  }
147 };
148 
149 // MapEntryImpl is used to implement parsing and serialization of map entries.
150 // It uses Curious Recursive Template Pattern (CRTP) to provide the type of
151 // the eventual code to the template code.
152 template <typename Derived, typename Base, typename Key, typename Value,
153  WireFormatLite::FieldType kKeyFieldType,
154  WireFormatLite::FieldType kValueFieldType, int default_enum_value>
155 class MapEntryImpl : public Base {
156  public:
158 
159  protected:
160  // Provide utilities to parse/serialize key/value. Provide utilities to
161  // manipulate internal stored type.
164 
165  // Define internal memory layout. Strings and messages are stored as
166  // pointers, while other types are stored as values.
167  typedef typename KeyTypeHandler::TypeOnMemory KeyOnMemory;
168  typedef typename ValueTypeHandler::TypeOnMemory ValueOnMemory;
169 
170  // Enum type cannot be used for MapTypeHandler::Read. Define a type
171  // which will replace Enum with int.
172  typedef typename KeyTypeHandler::MapEntryAccessorType KeyMapEntryAccessorType;
173  typedef
174  typename ValueTypeHandler::MapEntryAccessorType ValueMapEntryAccessorType;
175 
176  // Constants for field number.
177  static const int kKeyFieldNumber = 1;
178  static const int kValueFieldNumber = 2;
179 
180  // Constants for field tag.
181  static const uint8 kKeyTag =
182  GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(kKeyFieldNumber, KeyTypeHandler::kWireType);
184  kValueFieldNumber, ValueTypeHandler::kWireType);
185  static const size_t kTagSize = 1;
186 
187  public:
188  // Work-around for a compiler bug (see repeated_field.h).
190  typedef Derived EntryType;
191  typedef Key EntryKeyType;
193  static const WireFormatLite::FieldType kEntryKeyFieldType = kKeyFieldType;
194  static const WireFormatLite::FieldType kEntryValueFieldType = kValueFieldType;
195  static const int kEntryDefaultEnumValue = default_enum_value;
196 
199  ValueTypeHandler::InitializeMaybeByDefaultEnum(&value_, default_enum_value,
200  NULL);
201  _has_bits_[0] = 0;
202  }
203 
204  explicit MapEntryImpl(Arena* arena) : arena_(arena) {
206  ValueTypeHandler::InitializeMaybeByDefaultEnum(&value_, default_enum_value,
207  arena);
208  _has_bits_[0] = 0;
209  }
210 
212  if (GetArenaNoVirtual() != NULL) return;
213  KeyTypeHandler::DeleteNoArena(key_);
214  ValueTypeHandler::DeleteNoArena(value_);
215  }
216 
217  // accessors ======================================================
218 
219  virtual inline const KeyMapEntryAccessorType& key() const {
220  return KeyTypeHandler::GetExternalReference(key_);
221  }
222  virtual inline const ValueMapEntryAccessorType& value() const {
223  return ValueTypeHandler::DefaultIfNotInitialized(
224  value_, Derived::internal_default_instance()->value_);
225  }
227  set_has_key();
228  return KeyTypeHandler::EnsureMutable(&key_, GetArenaNoVirtual());
229  }
231  set_has_value();
232  return ValueTypeHandler::EnsureMutable(&value_, GetArenaNoVirtual());
233  }
234 
235  // implements MessageLite =========================================
236 
237  // MapEntryImpl is for implementation only and this function isn't called
238  // anywhere. Just provide a fake implementation here for MessageLite.
239  std::string GetTypeName() const override { return ""; }
240 
241  void CheckTypeAndMergeFrom(const MessageLite& other) override {
242  MergeFromInternal(*::google::protobuf::internal::DownCast<const Derived*>(&other));
243  }
244 
245 #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
246  const char* _InternalParse(const char* ptr, ParseContext* ctx) final {
247  while (!ctx->Done(&ptr)) {
248  uint32 tag;
249  ptr = ReadTag(ptr, &tag);
251  if (tag == kKeyTag) {
252  set_has_key();
254  ptr = KeyTypeHandler::Read(ptr, ctx, key);
255  if (!Derived::ValidateKey(key)) return nullptr;
256  } else if (tag == kValueTag) {
257  set_has_value();
259  ptr = ValueTypeHandler::Read(ptr, ctx, value);
260  if (!Derived::ValidateValue(value)) return nullptr;
261  } else {
262  if (tag == 0 || WireFormatLite::GetTagWireType(tag) ==
264  ctx->SetLastTag(tag);
265  return ptr;
266  }
267  ptr = UnknownFieldParse(tag, static_cast<string*>(nullptr), ptr, ctx);
268  }
270  }
271  return ptr;
272  }
273 #else
275  uint32 tag;
276 
277  for (;;) {
278  // 1) corrupted data: return false;
279  // 2) unknown field: skip without putting into unknown field set;
280  // 3) unknown enum value: keep it in parsing. In proto2, caller should
281  // check the value and put this entry into containing message's unknown
282  // field set if the value is an unknown enum. In proto3, caller doesn't
283  // need to care whether the value is unknown enum;
284  // 4) missing key/value: missed key/value will have default value. caller
285  // should take this entry as if key/value is set to default value.
286  tag = input->ReadTagNoLastTag();
287  switch (tag) {
288  case kKeyTag:
290  return false;
291  }
292  set_has_key();
293  break;
294 
295  case kValueTag:
297  return false;
298  }
299  set_has_value();
300  if (input->ExpectAtEnd()) return true;
301  break;
302 
303  default:
304  if (tag == 0 || WireFormatLite::GetTagWireType(tag) ==
306  return true;
307  }
308  if (!WireFormatLite::SkipField(input, tag)) return false;
309  break;
310  }
311  }
312  }
313 #endif
314 
315  size_t ByteSizeLong() const override {
316  size_t size = 0;
317  size += has_key() ? kTagSize +
318  static_cast<size_t>(KeyTypeHandler::ByteSize(key()))
319  : 0;
320  size += has_value()
321  ? kTagSize +
322  static_cast<size_t>(ValueTypeHandler::ByteSize(value()))
323  : 0;
324  return size;
325  }
326 
330  }
331 
333  ::google::protobuf::uint8* output) const override {
334  output = KeyTypeHandler::WriteToArray(kKeyFieldNumber, key(), output);
335  output = ValueTypeHandler::WriteToArray(kValueFieldNumber, value(), output);
336  return output;
337  }
338 
339  // Don't override SerializeWithCachedSizesToArray. Use MessageLite's.
340 
341  int GetCachedSize() const override {
342  int size = 0;
343  size += has_key() ? static_cast<int>(kTagSize) +
344  KeyTypeHandler::GetCachedSize(key())
345  : 0;
346  size += has_value() ? static_cast<int>(kTagSize) +
347  ValueTypeHandler::GetCachedSize(value())
348  : 0;
349  return size;
350  }
351 
352  bool IsInitialized() const override {
354  }
355 
356  Base* New() const override {
357  Derived* entry = new Derived;
358  return entry;
359  }
360 
361  Base* New(Arena* arena) const override {
362  Derived* entry = Arena::CreateMessage<Derived>(arena);
363  return entry;
364  }
365 
366  protected:
367  // We can't declare this function directly here as it would hide the other
368  // overload (const Message&).
369  void MergeFromInternal(const MapEntryImpl& from) {
370  if (from._has_bits_[0]) {
371  if (from.has_key()) {
372  KeyTypeHandler::EnsureMutable(&key_, GetArenaNoVirtual());
374  set_has_key();
375  }
376  if (from.has_value()) {
377  ValueTypeHandler::EnsureMutable(&value_, GetArenaNoVirtual());
379  set_has_value();
380  }
381  }
382  }
383 
384  public:
385  void Clear() override {
387  ValueTypeHandler::ClearMaybeByDefaultEnum(&value_, GetArenaNoVirtual(),
388  default_enum_value);
389  clear_has_key();
390  clear_has_value();
391  }
392 
393  static void InitAsDefaultInstance() {
394  Derived* d = const_cast<Derived*>(Derived::internal_default_instance());
395  KeyTypeHandler::AssignDefaultValue(&d->key_);
396  ValueTypeHandler::AssignDefaultValue(&d->value_);
397  }
398 
399  Arena* GetArena() const override { return GetArenaNoVirtual(); }
400 
401  // Parsing using MergePartialFromCodedStream, above, is not as
402  // efficient as it could be. This helper class provides a speedier way.
403  template <typename MapField, typename Map>
404  class Parser {
405  public:
406  explicit Parser(MapField* mf) : mf_(mf), map_(mf->MutableMap()) {}
408  if (entry_ != nullptr && entry_->GetArena() == nullptr) delete entry_;
409  }
410 
411  // This does what the typical MergePartialFromCodedStream() is expected to
412  // do, with the additional side-effect that if successful (i.e., if true is
413  // going to be its return value) it inserts the key-value pair into map_.
415  // Look for the expected thing: a key and then a value. If it fails,
416  // invoke the enclosing class's MergePartialFromCodedStream, or return
417  // false if that would be pointless.
418  if (input->ExpectTag(kKeyTag)) {
419  if (!KeyTypeHandler::Read(input, &key_)) {
420  return false;
421  }
422  // Peek at the next byte to see if it is kValueTag. If not, bail out.
423  const void* data;
424  int size;
425  input->GetDirectBufferPointerInline(&data, &size);
426  // We could use memcmp here, but we don't bother. The tag is one byte.
427  static_assert(kTagSize == 1, "tag size must be 1");
428  if (size > 0 && *reinterpret_cast<const char*>(data) == kValueTag) {
429  typename Map::size_type map_size = map_->size();
430  value_ptr_ = &(*map_)[key_];
431  if (PROTOBUF_PREDICT_TRUE(map_size != map_->size())) {
432  // We created a new key-value pair. Fill in the value.
433  typedef
435  input->Skip(kTagSize); // Skip kValueTag.
437  reinterpret_cast<T>(value_ptr_))) {
438  map_->erase(key_); // Failure! Undo insertion.
439  return false;
440  }
441  if (input->ExpectAtEnd()) return true;
443  }
444  }
445  } else {
446  key_ = Key();
447  }
448 
449  NewEntry();
450  *entry_->mutable_key() = key_;
451  const bool result = entry_->MergePartialFromCodedStream(input);
452  if (result) UseKeyAndValueFromEntry();
453  return result;
454  }
455 
456  const char* _InternalParse(const char* ptr, ParseContext* ctx) {
457  if (PROTOBUF_PREDICT_TRUE(!ctx->Done(&ptr) && *ptr == kKeyTag)) {
458  ptr = KeyTypeHandler::Read(ptr + 1, ctx, &key_);
459  if (PROTOBUF_PREDICT_FALSE(!ptr || !Derived::ValidateKey(&key_))) {
460  return nullptr;
461  }
462  if (PROTOBUF_PREDICT_TRUE(!ctx->Done(&ptr) && *ptr == kValueTag)) {
463  typename Map::size_type map_size = map_->size();
464  value_ptr_ = &(*map_)[key_];
465  if (PROTOBUF_PREDICT_TRUE(map_size != map_->size())) {
466  using T =
468  ptr = ValueTypeHandler::Read(ptr + 1, ctx,
469  reinterpret_cast<T>(value_ptr_));
470  if (PROTOBUF_PREDICT_FALSE(!ptr ||
471  !Derived::ValidateValue(value_ptr_))) {
472  map_->erase(key_); // Failure! Undo insertion.
473  return nullptr;
474  }
475  if (PROTOBUF_PREDICT_TRUE(ctx->Done(&ptr))) return ptr;
476  if (!ptr) return nullptr;
477  NewEntry();
479  map_->erase(key_);
480  goto move_key;
481  }
482  } else {
483  if (!ptr) return nullptr;
484  }
485  NewEntry();
486  move_key:
488  } else {
489  if (!ptr) return nullptr;
490  NewEntry();
491  }
492  ptr = entry_->_InternalParse(ptr, ctx);
493  if (ptr) UseKeyAndValueFromEntry();
494  return ptr;
495  }
496 
497  template <typename Metadata>
498  const char* ParseWithEnumValidation(const char* ptr, ParseContext* ctx,
499  bool (*is_valid)(int), uint32 field_num,
500  Metadata* metadata) {
501  auto entry = NewEntry();
502  ptr = entry->_InternalParse(ptr, ctx);
503  if (!ptr) return nullptr;
504  if (is_valid(entry->value())) {
506  } else {
507  WriteLengthDelimited(field_num, entry->SerializeAsString(),
508  metadata->mutable_unknown_fields());
509  }
510  return ptr;
511  }
512 
514 
515  const Key& key() const { return key_; }
516  const Value& value() const { return *value_ptr_; }
517 
518  const Key& entry_key() const { return entry_->key(); }
519  const Value& entry_value() const { return entry_->value(); }
520 
521  private:
523  // Update key_ in case we need it later (because key() is called).
524  // This is potentially inefficient, especially if the key is
525  // expensive to copy (e.g., a long string), but this is a cold
526  // path, so it's not a big deal.
527  key_ = entry_->key();
528  value_ptr_ = &(*map_)[key_];
530  }
531 
532  // After reading a key and value successfully, and inserting that data
533  // into map_, we are not at the end of the input. This is unusual, but
534  // allowed by the spec.
536  NewEntry();
538  map_->erase(key_);
540  const bool result = entry_->MergePartialFromCodedStream(input);
541  if (result) UseKeyAndValueFromEntry();
542  return result;
543  }
544 
545  typedef MoveHelper<KeyTypeHandler::kIsEnum, KeyTypeHandler::kIsMessage,
546  KeyTypeHandler::kWireType ==
548  Key>
550  typedef MoveHelper<ValueTypeHandler::kIsEnum, ValueTypeHandler::kIsMessage,
551  ValueTypeHandler::kWireType ==
553  Value>
555 
556  MapField* const mf_;
557  Map* const map_;
558  Key key_;
560  MapEntryImpl* entry_ = nullptr;
561  };
562 
563  protected:
564  void set_has_key() { _has_bits_[0] |= 0x00000001u; }
565  bool has_key() const { return (_has_bits_[0] & 0x00000001u) != 0; }
566  void clear_has_key() { _has_bits_[0] &= ~0x00000001u; }
567  void set_has_value() { _has_bits_[0] |= 0x00000002u; }
568  bool has_value() const { return (_has_bits_[0] & 0x00000002u) != 0; }
569  void clear_has_value() { _has_bits_[0] &= ~0x00000002u; }
570 
571  public:
572  inline Arena* GetArenaNoVirtual() const { return arena_; }
573 
574  public: // Needed for constructing tables
577  Arena* arena_;
579 
580  private:
581  friend class ::PROTOBUF_NAMESPACE_ID::Arena;
583  typedef void DestructorSkippable_;
584  template <typename C, typename K, typename V, WireFormatLite::FieldType,
586  friend class internal::MapEntry;
587  template <typename C, typename K, typename V, WireFormatLite::FieldType,
590 
592 };
593 
594 template <typename T, typename Key, typename Value,
595  WireFormatLite::FieldType kKeyFieldType,
596  WireFormatLite::FieldType kValueFieldType, int default_enum_value>
598  : public MapEntryImpl<T, MessageLite, Key, Value, kKeyFieldType,
599  kValueFieldType, default_enum_value> {
600  public:
601  typedef MapEntryImpl<T, MessageLite, Key, Value, kKeyFieldType,
602  kValueFieldType, default_enum_value>
605  explicit MapEntryLite(Arena* arena) : SuperType(arena) {}
606  void MergeFrom(const MapEntryLite& other) { MergeFromInternal(other); }
607 
608  private:
610 };
611 // The completely unprincipled and unwieldy use of template parameters in
612 // the map code necessitates wrappers to make the code a little bit more
613 // manageable.
614 template <typename Derived>
616 
617 template <typename T, typename K, typename V, WireFormatLite::FieldType key,
618  WireFormatLite::FieldType value, int default_enum>
619 struct DeconstructMapEntry<MapEntryLite<T, K, V, key, value, default_enum> > {
620  typedef K Key;
621  typedef V Value;
622  static const WireFormatLite::FieldType kKeyFieldType = key;
623  static const WireFormatLite::FieldType kValueFieldType = value;
624  static const int default_enum_value = default_enum;
625 };
626 
627 // Helpers for deterministic serialization =============================
628 
629 // This struct can be used with any generic sorting algorithm. If the Key
630 // type is relatively small and easy to copy then copying Keys into an
631 // array of SortItems can be beneficial. Then all the data the sorting
632 // algorithm needs to touch is in that one array.
633 template <typename Key, typename PtrToKeyValuePair>
634 struct SortItem {
635  SortItem() {}
636  explicit SortItem(PtrToKeyValuePair p) : first(p->first), second(p) {}
637 
638  Key first;
639  PtrToKeyValuePair second;
640 };
641 
642 template <typename T>
644  bool operator()(const T& a, const T& b) const { return a.first < b.first; }
645 };
646 
647 template <typename T>
649  bool operator()(const T& a, const T& b) const { return a->first < b->first; }
650 };
651 
652 // Helper for table driven serialization
653 
654 template <WireFormatLite::FieldType FieldType>
655 struct FromHelper {
656  template <typename T>
657  static const T& From(const T& x) {
658  return x;
659  }
660 };
661 
662 template <>
663 struct FromHelper<WireFormatLite::TYPE_STRING> {
664  static ArenaStringPtr From(const std::string& x) {
665  ArenaStringPtr res;
667  ptr.Set(const_cast<std::string*>(&x));
668  res.UnsafeSetTaggedPointer(ptr);
669  return res;
670  }
671 };
672 template <>
673 struct FromHelper<WireFormatLite::TYPE_BYTES> {
674  static ArenaStringPtr From(const std::string& x) {
675  ArenaStringPtr res;
677  ptr.Set(const_cast<std::string*>(&x));
678  res.UnsafeSetTaggedPointer(ptr);
679  return res;
680  }
681 };
682 template <>
683 struct FromHelper<WireFormatLite::TYPE_MESSAGE> {
684  template <typename T>
685  static T* From(const T& x) {
686  return const_cast<T*>(&x);
687  }
688 };
689 
690 template <typename MapEntryType>
692 
693 template <typename T, typename Key, typename Value,
694  WireFormatLite::FieldType kKeyFieldType,
695  WireFormatLite::FieldType kValueFieldType, int default_enum_value>
696 struct MapEntryHelper<MapEntryLite<T, Key, Value, kKeyFieldType,
697  kValueFieldType, default_enum_value> > {
698  // Provide utilities to parse/serialize key/value. Provide utilities to
699  // manipulate internal stored type.
702 
703  // Define internal memory layout. Strings and messages are stored as
704  // pointers, while other types are stored as values.
705  typedef typename KeyTypeHandler::TypeOnMemory KeyOnMemory;
706  typedef typename ValueTypeHandler::TypeOnMemory ValueOnMemory;
707 
708  explicit MapEntryHelper(const MapPair<Key, Value>& map_pair)
709  : _has_bits_(3),
710  _cached_size_(2 + KeyTypeHandler::GetCachedSize(map_pair.first) +
711  ValueTypeHandler::GetCachedSize(map_pair.second)),
712  key_(FromHelper<kKeyFieldType>::From(map_pair.first)),
713  value_(FromHelper<kValueFieldType>::From(map_pair.second)) {}
714 
715  // Purposely not folowing the style guide naming. These are the names
716  // the proto compiler would generate given the map entry descriptor.
717  // The proto compiler generates the offsets in this struct as if this was
718  // a regular message. This way the table driven code barely notices it's
719  // dealing with a map field.
720  uint32 _has_bits_; // NOLINT
722  KeyOnMemory key_; // NOLINT
724 };
725 
726 } // namespace internal
727 } // namespace protobuf
728 } // namespace google
729 
730 #include <google/protobuf/port_undef.inc>
731 
732 #endif // GOOGLE_PROTOBUF_MAP_ENTRY_LITE_H__
google::protobuf.internal::MapIf
Definition: map_type_handler.h:50
google::protobuf.internal::MapEntryImpl::kEntryKeyFieldType
static const WireFormatLite::FieldType kEntryKeyFieldType
Definition: map_entry_lite.h:193
google::protobuf.internal::MapEntryFuncs::kValueFieldNumber
static const int kValueFieldNumber
Definition: map_entry_lite.h:112
google::protobuf.internal::MapEntryImpl::InternalArenaConstructable_
void InternalArenaConstructable_
Definition: map_entry_lite.h:582
google::protobuf.internal::MapEntryImpl::GetCachedSize
int GetCachedSize() const override
Definition: map_entry_lite.h:341
google::protobuf.internal::SortItem::SortItem
SortItem()
Definition: map_entry_lite.h:635
google::protobuf::value
const Descriptor::ReservedRange value
Definition: src/google/protobuf/descriptor.h:1954
google::protobuf.internal::MapEntryImpl::Parser::ParseWithEnumValidation
const char * ParseWithEnumValidation(const char *ptr, ParseContext *ctx, bool(*is_valid)(int), uint32 field_num, Metadata *metadata)
Definition: map_entry_lite.h:498
google::protobuf.internal::MapEntryImpl::kTagSize
static const size_t kTagSize
Definition: map_entry_lite.h:185
google::protobuf.internal::MapEntryImpl::mutable_value
ValueMapEntryAccessorType * mutable_value()
Definition: map_entry_lite.h:230
K
#define K(t)
Definition: sha1.c:43
google::protobuf.internal::MoveHelper
Definition: map_entry_lite.h:76
arenastring.h
google::protobuf.internal::TaggedPtr::Set
void Set(T *p)
Definition: arenastring.h:59
wire_format_lite.h
google::protobuf.internal::MapEntryImpl::Parser::entry_value
const Value & entry_value() const
Definition: map_entry_lite.h:519
google::protobuf.internal::MapEntryHelper< MapEntryLite< T, Key, Value, kKeyFieldType, kValueFieldType, default_enum_value > >::KeyTypeHandler
MapTypeHandler< kKeyFieldType, Key > KeyTypeHandler
Definition: map_entry_lite.h:700
google::protobuf.internal::MapFieldLite
Definition: map.h:73
google::protobuf.internal::MapEntryImpl::clear_has_key
void clear_has_key()
Definition: map_entry_lite.h:566
NULL
NULL
Definition: test_security_zap.cpp:405
src
GLenum src
Definition: glcorearb.h:3364
google::protobuf.internal::FromHelper::From
static const T & From(const T &x)
Definition: map_entry_lite.h:657
google::protobuf.internal::MapField::NewEntry
EntryType * NewEntry() const
Definition: map_field.h:273
google::protobuf.internal::MapEntryLite::MapEntryLite
MapEntryLite()
Definition: map_entry_lite.h:604
google::protobuf.internal::MapField
Definition: map.h:78
google::protobuf.internal::MapEntryImpl
Definition: map_entry_lite.h:155
input
std::string input
Definition: tokenizer_unittest.cc:197
google::protobuf.internal::MapEntryImpl::ValueTypeHandler
MapTypeHandler< kValueFieldType, Value > ValueTypeHandler
Definition: map_entry_lite.h:163
google::protobuf.internal::MapEntryLite::MergeFrom
void MergeFrom(const MapEntryLite &other)
Definition: map_entry_lite.h:606
google::protobuf::uint8
uint8_t uint8
Definition: protobuf/src/google/protobuf/stubs/port.h:153
google::protobuf.internal::DeconstructMapEntry< MapEntryLite< T, K, V, key, value, default_enum > >::Value
V Value
Definition: map_entry_lite.h:621
google::protobuf.internal::MapEntryImpl::has_key
bool has_key() const
Definition: map_entry_lite.h:565
google::protobuf.internal::MapEntryImpl::Parser::value
const Value & value() const
Definition: map_entry_lite.h:516
google::protobuf.internal::ArenaStringPtr::UnsafeSetTaggedPointer
void UnsafeSetTaggedPointer(TaggedPtr< ::std::string > value)
Definition: arenastring.h:359
benchmarks.util.result_uploader.metadata
def metadata
Definition: result_uploader.py:97
google::protobuf.internal::MapEntryImpl::Clear
void Clear() override
Definition: map_entry_lite.h:385
google::protobuf.internal::MapEntryImpl::set_has_value
void set_has_value()
Definition: map_entry_lite.h:567
google::protobuf.internal::MapEntryImpl::kKeyFieldNumber
static const int kKeyFieldNumber
Definition: map_entry_lite.h:177
google::protobuf.internal::MapEntryLite::GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapEntryLite)
google::protobuf::uint32
uint32_t uint32
Definition: protobuf/src/google/protobuf/stubs/port.h:155
google::protobuf.internal::FromHelper< WireFormatLite::TYPE_MESSAGE >::From
static T * From(const T &x)
Definition: map_entry_lite.h:685
google::protobuf.internal::ParseContext
Definition: parse_context.h:322
google::protobuf.internal::MapEntryImpl::kEntryValueFieldType
static const WireFormatLite::FieldType kEntryValueFieldType
Definition: map_entry_lite.h:194
map_type_handler.h
string
GLsizei const GLchar *const * string
Definition: glcorearb.h:3083
google::protobuf.internal::MapEntryImpl::GetArenaNoVirtual
Arena * GetArenaNoVirtual() const
Definition: map_entry_lite.h:572
Value
Definition: struct.pb.h:304
google::protobuf.internal::WireFormatLite::WIRETYPE_END_GROUP
@ WIRETYPE_END_GROUP
Definition: wire_format_lite.h:106
google::protobuf::MessageLite
Definition: message_lite.h:183
google::protobuf.internal.python_message._InternalParse
_InternalParse
Definition: python_message.py:1197
google::protobuf.internal::MapEntryHelper< MapEntryLite< T, Key, Value, kKeyFieldType, kValueFieldType, default_enum_value > >::_has_bits_
uint32 _has_bits_
Definition: map_entry_lite.h:720
google::protobuf.internal::MapEntryLite
Definition: map_entry_lite.h:597
x
GLint GLenum GLint x
Definition: glcorearb.h:2834
port.h
google::protobuf::io::CodedOutputStream::WriteVarint32ToArray
static uint8 * WriteVarint32ToArray(uint32 value, uint8 *target)
Definition: coded_stream.h:1149
google::protobuf.internal::MapEntryHelper< MapEntryLite< T, Key, Value, kKeyFieldType, kValueFieldType, default_enum_value > >::ValueTypeHandler
MapTypeHandler< kValueFieldType, Value > ValueTypeHandler
Definition: map_entry_lite.h:701
T
#define T(upbtypeconst, upbtype, ctype, default_value)
google::protobuf.internal::WireFormatLite::SkipField
static bool SkipField(io::CodedInputStream *input, uint32 tag)
Definition: wire_format_lite.cc:121
google::protobuf.internal::MapEntryLite::SuperType
MapEntryImpl< T, MessageLite, Key, Value, kKeyFieldType, kValueFieldType, default_enum_value > SuperType
Definition: map_entry_lite.h:603
google::protobuf.internal::MapEntryImpl::kEntryDefaultEnumValue
static const int kEntryDefaultEnumValue
Definition: map_entry_lite.h:195
google::protobuf.internal::MapEntryImpl::CheckTypeAndMergeFrom
void CheckTypeAndMergeFrom(const MessageLite &other) override
Definition: map_entry_lite.h:241
google::protobuf.internal::MapEntryImpl::ByteSizeLong
size_t ByteSizeLong() const override
Definition: map_entry_lite.h:315
b
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:3228
parse_context.h
google::protobuf.internal::MapEntryImpl::Parser::ReadBeyondKeyValuePair
bool ReadBeyondKeyValuePair(io::CodedInputStream *input) PROTOBUF_COLD
Definition: map_entry_lite.h:535
google::protobuf.internal::MapEntryImpl::GetTypeName
std::string GetTypeName() const override
Definition: map_entry_lite.h:239
google::protobuf.internal::MapEntryImpl::Parser::UseKeyAndValueFromEntry
void UseKeyAndValueFromEntry()
Definition: map_entry_lite.h:522
google::protobuf.internal::MapEntryImpl::~MapEntryImpl
~MapEntryImpl()
Definition: map_entry_lite.h:211
google::protobuf.internal::WireFormatLite::WriteTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteTagToArray(int field_number, WireType type, uint8 *target)
Definition: wire_format_lite.h:1356
google::protobuf.internal::MoveHelper< true, is_message, is_stringlike, T >::Move
static void Move(T *src, T *dest)
Definition: map_entry_lite.h:82
testing::internal::posix::Read
int Read(int fd, void *buf, unsigned int count)
Definition: gtest-port.h:2126
google::protobuf.internal::MapEntryFuncs::SerializeToCodedStream
static void SerializeToCodedStream(int field_number, const Key &key, const Value &value, io::CodedOutputStream *output)
Definition: map_entry_lite.h:114
google::protobuf.internal::MapEntryHelper< MapEntryLite< T, Key, Value, kKeyFieldType, kValueFieldType, default_enum_value > >::ValueOnMemory
ValueTypeHandler::TypeOnMemory ValueOnMemory
Definition: map_entry_lite.h:706
google::protobuf.internal::ParseContext::Done
bool Done(const char **ptr)
Definition: parse_context.h:337
google::protobuf.internal::MapEntryImpl::clear_has_value
void clear_has_value()
Definition: map_entry_lite.h:569
google::protobuf.internal::SortItem
Definition: map_entry_lite.h:634
coded_stream.h
google::protobuf.internal::MapEntryImpl::Parser::KeyMover
MoveHelper< KeyTypeHandler::kIsEnum, KeyTypeHandler::kIsMessage, KeyTypeHandler::kWireType==WireFormatLite::WIRETYPE_LENGTH_DELIMITED, Key > KeyMover
Definition: map_entry_lite.h:549
google::protobuf.internal::MapEntryImpl::MergeFromInternal
void MergeFromInternal(const MapEntryImpl &from)
Definition: map_entry_lite.h:369
google::protobuf.internal::WriteLengthDelimited
void WriteLengthDelimited(uint32 num, StringPiece val, std::string *s)
Definition: parse_context.cc:313
google::protobuf.internal::MapEntryImpl::kKeyTag
static const uint8 kKeyTag
Definition: map_entry_lite.h:181
google::protobuf.internal::MapEntryImpl::Parser::NewEntry
MapEntryImpl * NewEntry()
Definition: map_entry_lite.h:513
google::protobuf.internal::MapEntryFuncs::GetCachedSize
static int GetCachedSize(const Key &key, const Value &value)
Definition: map_entry_lite.h:142
google::protobuf.internal::MapEntryImpl::GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapEntryImpl)
google::protobuf.internal::MapTypeHandler
Definition: map_type_handler.h:144
google::protobuf::io::CodedOutputStream::VarintSize32
static size_t VarintSize32(uint32 value)
Definition: coded_stream.h:1245
google::protobuf.internal::UnknownFieldParse
const char * UnknownFieldParse(uint32 tag, std::string *unknown, const char *ptr, ParseContext *ctx)
Definition: parse_context.cc:545
p
const char * p
Definition: gmock-matchers_test.cc:3863
google::protobuf.internal::MapEntryFuncs::ValueTypeHandler
MapTypeHandler< kValueFieldType, Value > ValueTypeHandler
Definition: map_entry_lite.h:110
google::protobuf.internal::MapEntryImpl::KeyOnMemory
KeyTypeHandler::TypeOnMemory KeyOnMemory
Definition: map_entry_lite.h:167
google::protobuf.internal::MapEntryImpl::kValueTag
static const uint8 kValueTag
Definition: map_entry_lite.h:183
size
#define size
Definition: glcorearb.h:2944
google::protobuf.internal::MapEntryFuncs::SerializeToArray
::google::protobuf::uint8 * SerializeToArray(int field_number, const Key &key, const Value &value, ::google::protobuf::uint8 *output)
Definition: map_entry_lite.h:124
google::protobuf.internal::MapEntryImpl::New
Base * New() const override
Definition: map_entry_lite.h:356
google::protobuf.internal::DeconstructMapEntry< MapEntryLite< T, K, V, key, value, default_enum > >::Key
K Key
Definition: map_entry_lite.h:620
google::protobuf.internal::MapEntryImpl::Parser::entry_
MapEntryImpl * entry_
Definition: map_entry_lite.h:560
google::protobuf.internal::MapEntryImpl::has_value
bool has_value() const
Definition: map_entry_lite.h:568
google::protobuf.internal::WireFormatLite::FieldType
FieldType
Definition: wire_format_lite.h:111
google::protobuf.internal::CompareByFirstField::operator()
bool operator()(const T &a, const T &b) const
Definition: map_entry_lite.h:644
google::protobuf.internal::MapEntryHelper< MapEntryLite< T, Key, Value, kKeyFieldType, kValueFieldType, default_enum_value > >::MapEntryHelper
MapEntryHelper(const MapPair< Key, Value > &map_pair)
Definition: map_entry_lite.h:708
google::protobuf.internal::MapEntryFuncs
Definition: map_entry_lite.h:108
d
d
google::protobuf.internal.python_message.ByteSize
ByteSize
Definition: python_message.py:1067
google::protobuf.internal::MapEntryImpl::InternalSerializeWithCachedSizesToArray
::google::protobuf::uint8 * InternalSerializeWithCachedSizesToArray(::google::protobuf::uint8 *output) const override
Definition: map_entry_lite.h:332
casts.h
google::protobuf::Map::size_type
size_t size_type
Definition: map.h:140
google::protobuf.internal::MapEntryImpl::MapEntryImpl
MapEntryImpl()
Definition: map_entry_lite.h:197
map.h
google::protobuf.internal::FromHelper< WireFormatLite::TYPE_BYTES >::From
static ArenaStringPtr From(const std::string &x)
Definition: map_entry_lite.h:674
key
const SETUP_TEARDOWN_TESTCONTEXT char * key
Definition: test_wss_transport.cpp:10
google::protobuf.internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED
@ WIRETYPE_LENGTH_DELIMITED
Definition: wire_format_lite.h:104
google::protobuf.internal::MapEntryImpl::ValueMapEntryAccessorType
ValueTypeHandler::MapEntryAccessorType ValueMapEntryAccessorType
Definition: map_entry_lite.h:174
google::protobuf.internal::MapEntryImpl::value
virtual const ValueMapEntryAccessorType & value() const
Definition: map_entry_lite.h:222
google::protobuf.internal::MapEntryImpl::New
Base * New(Arena *arena) const override
Definition: map_entry_lite.h:361
google::protobuf.internal::MapEntryImpl::IsInitialized
bool IsInitialized() const override
Definition: map_entry_lite.h:352
google::protobuf.internal::MapEntryImpl::Parser::key
const Key & key() const
Definition: map_entry_lite.h:515
google::protobuf.internal::MapEntryImpl::Funcs
MapEntryFuncs< Key, Value, kKeyFieldType, kValueFieldType > Funcs
Definition: map_entry_lite.h:157
google::protobuf.internal::MapEntryImpl::value_
ValueOnMemory value_
Definition: map_entry_lite.h:576
google::protobuf.internal::MapEntryImpl::Parser::mf_
MapField *const mf_
Definition: map_entry_lite.h:556
google::protobuf.internal::MapEntryImpl::KeyMapEntryAccessorType
KeyTypeHandler::MapEntryAccessorType KeyMapEntryAccessorType
Definition: map_entry_lite.h:172
google::protobuf::io::CodedOutputStream
Definition: coded_stream.h:693
google::protobuf.internal::SortItem::SortItem
SortItem(PtrToKeyValuePair p)
Definition: map_entry_lite.h:636
google::protobuf.internal::MapEntryImpl::Parser::ValueMover
MoveHelper< ValueTypeHandler::kIsEnum, ValueTypeHandler::kIsMessage, ValueTypeHandler::kWireType==WireFormatLite::WIRETYPE_LENGTH_DELIMITED, Value > ValueMover
Definition: map_entry_lite.h:554
google::protobuf::Metadata
Definition: src/google/protobuf/message.h:190
google::protobuf.internal::MapEntry
Definition: map_entry.h:95
value_
int value_
Definition: gmock-matchers_test.cc:571
google::protobuf.internal::WireFormatLite::GetTagWireType
static WireType GetTagWireType(uint32 tag)
Definition: wire_format_lite.h:773
google::protobuf.internal::MapEntryImpl::Parser::entry_key
const Key & entry_key() const
Definition: map_entry_lite.h:518
google::protobuf.internal::MoveHelper< false, false, true, T >::Move
static void Move(T *src, T *dest)
Definition: map_entry_lite.h:95
google::protobuf.internal::MapEntryImpl::Parser::MergePartialFromCodedStream
bool MergePartialFromCodedStream(io::CodedInputStream *input)
Definition: map_entry_lite.h:414
google::protobuf.internal::MapEntryHelper< MapEntryLite< T, Key, Value, kKeyFieldType, kValueFieldType, default_enum_value > >::_cached_size_
uint32 _cached_size_
Definition: map_entry_lite.h:721
testing::internal::posix::Write
int Write(int fd, const void *buf, unsigned int count)
Definition: gtest-port.h:2129
google::protobuf.internal::MapEntryImpl::arena_
Arena * arena_
Definition: map_entry_lite.h:577
google::protobuf.internal::TaggedPtr
Definition: arenastring.h:57
google::protobuf.internal.python_message.Clear
Clear
Definition: python_message.py:1431
google::protobuf.internal::MoveHelper< false, true, is_stringlike, T >::Move
static void Move(T *src, T *dest)
Definition: map_entry_lite.h:90
google::protobuf.internal::MapEntryFuncs::ByteSizeLong
static size_t ByteSizeLong(const Key &key, const Value &value)
Definition: map_entry_lite.h:135
google::protobuf.internal::WireFormatLite::WriteTag
static PROTOBUF_ALWAYS_INLINE void WriteTag(int field_number, WireType type, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1272
google::protobuf.internal::MapEntryImpl::GetArena
Arena * GetArena() const override
Definition: map_entry_lite.h:399
google::protobuf.internal::MapEntryImpl::kValueFieldNumber
static const int kValueFieldNumber
Definition: map_entry_lite.h:178
benchmarks.python.py_benchmark.dest
dest
Definition: py_benchmark.py:13
size
GLsizeiptr size
Definition: glcorearb.h:2943
google::protobuf.internal::MapEntryImpl::MapEntryImpl
MapEntryImpl(Arena *arena)
Definition: map_entry_lite.h:204
arena.h
google::protobuf.internal::MoveHelper::Move
static void Move(T *src, T *dest)
Definition: map_entry_lite.h:77
google::protobuf.internal::MapEntryImpl::Parser::_InternalParse
const char * _InternalParse(const char *ptr, ParseContext *ctx)
Definition: map_entry_lite.h:456
google::protobuf.internal::FromHelper
Definition: map_entry_lite.h:655
google::protobuf::io::CodedInputStream
Definition: coded_stream.h:173
google::protobuf.internal::MapEntryHelper
Definition: map_entry_lite.h:691
google::protobuf.internal::MapEntryImpl::Parser::key_
Key key_
Definition: map_entry_lite.h:558
google::protobuf.internal::MapEntryHelper< MapEntryLite< T, Key, Value, kKeyFieldType, kValueFieldType, default_enum_value > >::value_
ValueOnMemory value_
Definition: map_entry_lite.h:723
ImGui::Initialize
IMGUI_API void Initialize(ImGuiContext *context)
Definition: imgui.cpp:3894
google::protobuf.internal::MapEntryImpl::_has_bits_
uint32 _has_bits_[1]
Definition: map_entry_lite.h:578
google::protobuf.internal::MapEntryFuncs::kKeyFieldNumber
static const int kKeyFieldNumber
Definition: map_entry_lite.h:111
google::protobuf.internal::MapEntryImpl::MergePartialFromCodedStream
bool MergePartialFromCodedStream(io::CodedInputStream *input) override
Definition: map_entry_lite.h:274
google::protobuf.internal::MoveHelper< true, is_message, is_stringlike, T >::Move
static void Move(T *src, int *dest)
Definition: map_entry_lite.h:84
google::protobuf::Map::size
size_type size() const
Definition: map.h:1045
first
GLint first
Definition: glcorearb.h:2830
google::protobuf.internal::MapEntryImpl::InitAsDefaultInstance
static void InitAsDefaultInstance()
Definition: map_entry_lite.h:393
generated_message_util.h
google::protobuf.internal.python_message.IsInitialized
IsInitialized
Definition: python_message.py:1246
google::protobuf::MessageLite::MessageLite
MessageLite()
Definition: message_lite.h:185
google::protobuf.internal::MapEntryImpl::Parser::~Parser
~Parser()
Definition: map_entry_lite.h:407
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: glcorearb.h:2879
google::protobuf.internal::MapEntryImpl::Parser::Parser
Parser(MapField *mf)
Definition: map_entry_lite.h:406
google::protobuf.internal::MapEntryHelper< MapEntryLite< T, Key, Value, kKeyFieldType, kValueFieldType, default_enum_value > >::KeyOnMemory
KeyTypeHandler::TypeOnMemory KeyOnMemory
Definition: map_entry_lite.h:705
google::protobuf.internal::MapEntryLite::MapEntryLite
MapEntryLite(Arena *arena)
Definition: map_entry_lite.h:605
GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG
#define GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(FIELD_NUMBER, TYPE)
Definition: wire_format_lite.h:202
true
#define true
Definition: cJSON.c:65
google::protobuf.internal::CompareByDerefFirst
Definition: map_entry_lite.h:648
google::protobuf::Map
Definition: map.h:62
google::protobuf.internal::MapEntryFuncs::KeyTypeHandler
MapTypeHandler< kKeyFieldType, Key > KeyTypeHandler
Definition: map_entry_lite.h:109
internal
Definition: any.pb.h:40
google::protobuf.internal::MoveHelper< true, is_message, is_stringlike, T >::Move
static void Move(int *src, T *dest)
Definition: map_entry_lite.h:85
google::protobuf.internal::ReadTag
const char * ReadTag(const char *p, uint32 *out)
Definition: parse_context.h:433
google::protobuf.internal::MapEntryImpl::EntryKeyType
Key EntryKeyType
Definition: map_entry_lite.h:191
google::protobuf.internal::MapEntryImpl::mutable_key
KeyMapEntryAccessorType * mutable_key()
Definition: map_entry_lite.h:226
google::protobuf::Map::erase
size_type erase(const key_type &key)
Definition: map.h:1123
google::protobuf.internal::MapEntryImpl::ValueOnMemory
ValueTypeHandler::TypeOnMemory ValueOnMemory
Definition: map_entry_lite.h:168
google::protobuf.internal::MapEntryImpl::MapEntryHasMergeTypeTrait
void MapEntryHasMergeTypeTrait
Definition: map_entry_lite.h:189
google::protobuf.internal::MapEntryImpl::SerializeWithCachedSizes
void SerializeWithCachedSizes(io::CodedOutputStream *output) const override
Definition: map_entry_lite.h:327
value
GLsizei const GLfloat * value
Definition: glcorearb.h:3093
google::protobuf.internal::MapEntryImpl::Parser
Definition: map_entry_lite.h:404
google::protobuf.internal::FromHelper< WireFormatLite::TYPE_STRING >::From
static ArenaStringPtr From(const std::string &x)
Definition: map_entry_lite.h:664
google::protobuf.internal::MapEntryImpl::Parser::map_
Map *const map_
Definition: map_entry_lite.h:557
assert.h
google::protobuf.internal::MapEntryImpl::key_
KeyOnMemory key_
Definition: map_entry_lite.h:575
output
const upb_json_parsermethod const upb_symtab upb_sink * output
Definition: ruby/ext/google/protobuf_c/upb.h:10503
google::protobuf.internal::MapEntryImpl::KeyTypeHandler
MapTypeHandler< kKeyFieldType, Key > KeyTypeHandler
Definition: map_entry_lite.h:162
google::protobuf.internal::WireFormatLite
Definition: wire_format_lite.h:84
false
#define false
Definition: cJSON.c:70
a
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:3228
google::protobuf.internal::MapEntryImpl::set_has_key
void set_has_key()
Definition: map_entry_lite.h:564
google::protobuf.internal::DeconstructMapEntry
Definition: map_entry_lite.h:615
google::protobuf.internal::MapEntryImpl::EntryType
Derived EntryType
Definition: map_entry_lite.h:190
google::protobuf.internal::CompareByDerefFirst::operator()
bool operator()(const T &a, const T &b) const
Definition: map_entry_lite.h:649
google
Definition: data_proto2_to_proto3_util.h:11
google::protobuf.internal::ArenaStringPtr
Definition: arenastring.h:68
google::protobuf.internal::MapEntryImpl::Parser::value_ptr_
Value * value_ptr_
Definition: map_entry_lite.h:559
google::protobuf.internal::MapEntryImpl::EntryValueType
Value EntryValueType
Definition: map_entry_lite.h:192
google::protobuf.internal::SortItem::first
Key first
Definition: map_entry_lite.h:638
GOOGLE_PROTOBUF_PARSER_ASSERT
#define GOOGLE_PROTOBUF_PARSER_ASSERT(predicate)
Definition: parse_context.h:633
google::protobuf.internal::MapEntryHelper< MapEntryLite< T, Key, Value, kKeyFieldType, kValueFieldType, default_enum_value > >::key_
KeyOnMemory key_
Definition: map_entry_lite.h:722
google::protobuf.text_format.Merge
def Merge(text, message, allow_unknown_extension=False, allow_field_number=False, descriptor_pool=None, allow_unknown_field=False)
Definition: text_format.py:656
google::protobuf.internal::CompareByFirstField
Definition: map_entry_lite.h:643
google::protobuf.internal::MapEntryImpl::key
virtual const KeyMapEntryAccessorType & key() const
Definition: map_entry_lite.h:219
google::protobuf::MapPair
Definition: map.h:92
google::protobuf.internal::MapEntryImpl::DestructorSkippable_
void DestructorSkippable_
Definition: map_entry_lite.h:583
google::protobuf.internal::SortItem::second
PtrToKeyValuePair second
Definition: map_entry_lite.h:639
Value
struct Value Value
Definition: php/ext/google/protobuf/protobuf.h:667


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