protobuf/src/google/protobuf/map_field.cc
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 #include <google/protobuf/map_field.h>
32 #include <google/protobuf/map_field_inl.h>
33 
34 #include <vector>
35 
36 #include <google/protobuf/port_def.inc>
37 
38 namespace google {
39 namespace protobuf {
40 namespace internal {
41 
43  if (repeated_field_ != nullptr && arena_ == nullptr) delete repeated_field_;
44 }
45 
46 const RepeatedPtrFieldBase& MapFieldBase::GetRepeatedField() const {
47  ConstAccess();
49  return *reinterpret_cast<RepeatedPtrFieldBase*>(repeated_field_);
50 }
51 
52 RepeatedPtrFieldBase* MapFieldBase::MutableRepeatedField() {
53  MutableAccess();
56  return reinterpret_cast<RepeatedPtrFieldBase*>(repeated_field_);
57 }
58 
60  // a relaxed swap of the atomic
61  auto other_state = other->state_.load(std::memory_order_relaxed);
62  auto this_state = state_.load(std::memory_order_relaxed);
63  other->state_.store(this_state, std::memory_order_relaxed);
64  state_.store(other_state, std::memory_order_relaxed);
65 }
66 
68  RepeatedPtrField<Message>** to, Arena* from_arena,
69  Arena* to_arena) {
70  GOOGLE_DCHECK(*from != nullptr);
71  GOOGLE_DCHECK(*to == nullptr);
72  *to = Arena::CreateMessage<RepeatedPtrField<Message> >(to_arena);
73  **to = std::move(**from);
74  if (from_arena == nullptr) {
75  delete *from;
76  }
77  *from = nullptr;
78 }
79 
81  if (arena_ == other->arena_) {
82  InternalSwap(other);
83  return;
84  }
85  if (repeated_field_ != nullptr || other->repeated_field_ != nullptr) {
86  if (repeated_field_ == nullptr) {
88  other->arena_, arena_);
89  } else if (other->repeated_field_ == nullptr) {
91  other->arena_);
92  } else {
93  repeated_field_->Swap(other->repeated_field_);
94  }
95  }
96  SwapState(other);
97 }
98 
100  GOOGLE_DCHECK_EQ(arena_, other->arena_);
101  InternalSwap(other);
102 }
103 
105  std::swap(arena_, other->arena_);
107  SwapState(other);
108 }
109 
111  ConstAccess();
112  mutex_.Lock();
114  mutex_.Unlock();
115  ConstAccess();
116  return size;
117 }
118 
120  if (repeated_field_ != nullptr) {
121  return repeated_field_->SpaceUsedExcludingSelfLong();
122  } else {
123  return 0;
124  }
125 }
126 
127 bool MapFieldBase::IsMapValid() const {
128  ConstAccess();
129  // "Acquire" insures the operation after SyncRepeatedFieldWithMap won't get
130  // executed before state_ is checked.
131  int state = state_.load(std::memory_order_acquire);
132  return state != STATE_MODIFIED_REPEATED;
133 }
134 
136  ConstAccess();
137  int state = state_.load(std::memory_order_acquire);
138  return state != STATE_MODIFIED_MAP;
139 }
140 
142  MutableAccess();
143  // These are called by (non-const) mutator functions. So by our API it's the
144  // callers responsibility to have these calls properly ordered.
145  state_.store(STATE_MODIFIED_MAP, std::memory_order_relaxed);
146 }
147 
149  MutableAccess();
150  // These are called by (non-const) mutator functions. So by our API it's the
151  // callers responsibility to have these calls properly ordered.
152  state_.store(STATE_MODIFIED_REPEATED, std::memory_order_relaxed);
153 }
154 
156  ConstAccess();
157  // acquire here matches with release below to ensure that we can only see a
158  // value of CLEAN after all previous changes have been synced.
159  switch (state_.load(std::memory_order_acquire)) {
160  case STATE_MODIFIED_MAP:
161  mutex_.Lock();
162  // Double check state, because another thread may have seen the same
163  // state and done the synchronization before the current thread.
164  if (state_.load(std::memory_order_relaxed) == STATE_MODIFIED_MAP) {
166  state_.store(CLEAN, std::memory_order_release);
167  }
168  mutex_.Unlock();
169  ConstAccess();
170  break;
171  case CLEAN:
172  mutex_.Lock();
173  // Double check state
174  if (state_.load(std::memory_order_relaxed) == CLEAN) {
175  if (repeated_field_ == nullptr) {
177  Arena::CreateMessage<RepeatedPtrField<Message> >(arena_);
178  }
179  state_.store(CLEAN, std::memory_order_release);
180  }
181  mutex_.Unlock();
182  ConstAccess();
183  break;
184  default:
185  break;
186  }
187 }
188 
190  if (repeated_field_ == nullptr) {
191  repeated_field_ = Arena::CreateMessage<RepeatedPtrField<Message> >(arena_);
192  }
193 }
194 
196  ConstAccess();
197  // acquire here matches with release below to ensure that we can only see a
198  // value of CLEAN after all previous changes have been synced.
199  if (state_.load(std::memory_order_acquire) == STATE_MODIFIED_REPEATED) {
200  mutex_.Lock();
201  // Double check state, because another thread may have seen the same state
202  // and done the synchronization before the current thread.
203  if (state_.load(std::memory_order_relaxed) == STATE_MODIFIED_REPEATED) {
205  state_.store(CLEAN, std::memory_order_release);
206  }
207  mutex_.Unlock();
208  ConstAccess();
209  }
210 }
211 
212 // ------------------DynamicMapField------------------
213 DynamicMapField::DynamicMapField(const Message* default_entry)
214  : default_entry_(default_entry) {}
215 
216 DynamicMapField::DynamicMapField(const Message* default_entry, Arena* arena)
217  : TypeDefinedMapFieldBase<MapKey, MapValueRef>(arena),
218  map_(arena),
219  default_entry_(default_entry) {}
220 
222  if (arena_ != nullptr) return;
223  // DynamicMapField owns map values. Need to delete them before clearing the
224  // map.
225  for (auto& kv : map_) {
226  kv.second.DeleteData();
227  }
228  map_.clear();
229 }
230 
231 int DynamicMapField::size() const { return GetMap().size(); }
232 
233 void DynamicMapField::Clear() {
234  Map<MapKey, MapValueRef>* map = &const_cast<DynamicMapField*>(this)->map_;
235  if (MapFieldBase::arena_ == nullptr) {
237  iter != map->end(); ++iter) {
238  iter->second.DeleteData();
239  }
240  }
241 
242  map->clear();
243 
244  if (MapFieldBase::repeated_field_ != nullptr) {
246  }
247  // Data in map and repeated field are both empty, but we can't set status
248  // CLEAN which will invalidate previous reference to map.
250 }
251 
252 bool DynamicMapField::ContainsMapKey(const MapKey& map_key) const {
255  return iter != map.end();
256 }
257 
258 void DynamicMapField::AllocateMapValue(MapValueRef* map_val) {
259  const FieldDescriptor* val_des = default_entry_->GetDescriptor()->map_value();
260  map_val->SetType(val_des->cpp_type());
261  // Allocate memory for the MapValueRef, and initialize to
262  // default value.
263  switch (val_des->cpp_type()) {
264 #define HANDLE_TYPE(CPPTYPE, TYPE) \
265  case FieldDescriptor::CPPTYPE_##CPPTYPE: { \
266  TYPE* value = Arena::Create<TYPE>(MapFieldBase::arena_); \
267  map_val->SetValue(value); \
268  break; \
269  }
270  HANDLE_TYPE(INT32, int32_t);
271  HANDLE_TYPE(INT64, int64_t);
272  HANDLE_TYPE(UINT32, uint32_t);
273  HANDLE_TYPE(UINT64, uint64_t);
274  HANDLE_TYPE(DOUBLE, double);
275  HANDLE_TYPE(FLOAT, float);
276  HANDLE_TYPE(BOOL, bool);
277  HANDLE_TYPE(STRING, std::string);
278  HANDLE_TYPE(ENUM, int32_t);
279 #undef HANDLE_TYPE
281  const Message& message =
284  map_val->SetValue(value);
285  break;
286  }
287  }
288 }
289 
290 bool DynamicMapField::InsertOrLookupMapValue(const MapKey& map_key,
291  MapValueRef* val) {
292  // Always use mutable map because users may change the map value by
293  // MapValueRef.
296  if (iter == map->end()) {
297  MapValueRef& map_val = map_[map_key];
298  AllocateMapValue(&map_val);
299  val->CopyFrom(map_val);
300  return true;
301  }
302  // map_key is already in the map. Make sure (*map)[map_key] is not called.
303  // [] may reorder the map and iterators.
304  val->CopyFrom(iter->second);
305  return false;
306 }
307 
309  MapValueConstRef* val) const {
312  if (iter == map.end()) {
313  return false;
314  }
315  // map_key is already in the map. Make sure (*map)[map_key] is not called.
316  // [] may reorder the map and iterators.
317  val->CopyFrom(iter->second);
318  return true;
319 }
320 
321 bool DynamicMapField::DeleteMapValue(const MapKey& map_key) {
324  if (iter == map_.end()) {
325  return false;
326  }
327  // Set map dirty only if the delete is successful.
329  if (MapFieldBase::arena_ == nullptr) {
330  iter->second.DeleteData();
331  }
332  map_.erase(iter);
333  return true;
334 }
335 
338  return map_;
339 }
340 
344  return &map_;
345 }
346 
347 void DynamicMapField::SetMapIteratorValue(MapIterator* map_iter) const {
350  map_iter);
351  if (iter == map_.end()) return;
352  map_iter->key_.CopyFrom(iter->first);
353  map_iter->value_.CopyFrom(iter->second);
354 }
355 
356 void DynamicMapField::MergeFrom(const MapFieldBase& other) {
357  GOOGLE_DCHECK(IsMapValid() && other.IsMapValid());
359  const DynamicMapField& other_field =
360  reinterpret_cast<const DynamicMapField&>(other);
362  other_field.map_.begin();
363  other_it != other_field.map_.end(); ++other_it) {
364  Map<MapKey, MapValueRef>::iterator iter = map->find(other_it->first);
365  MapValueRef* map_val;
366  if (iter == map->end()) {
367  map_val = &map_[other_it->first];
368  AllocateMapValue(map_val);
369  } else {
370  map_val = &iter->second;
371  }
372 
373  // Copy map value
374  const FieldDescriptor* field_descriptor =
376  switch (field_descriptor->cpp_type()) {
378  map_val->SetInt32Value(other_it->second.GetInt32Value());
379  break;
380  }
382  map_val->SetInt64Value(other_it->second.GetInt64Value());
383  break;
384  }
386  map_val->SetUInt32Value(other_it->second.GetUInt32Value());
387  break;
388  }
390  map_val->SetUInt64Value(other_it->second.GetUInt64Value());
391  break;
392  }
394  map_val->SetFloatValue(other_it->second.GetFloatValue());
395  break;
396  }
398  map_val->SetDoubleValue(other_it->second.GetDoubleValue());
399  break;
400  }
402  map_val->SetBoolValue(other_it->second.GetBoolValue());
403  break;
404  }
406  map_val->SetStringValue(other_it->second.GetStringValue());
407  break;
408  }
410  map_val->SetEnumValue(other_it->second.GetEnumValue());
411  break;
412  }
414  map_val->MutableMessageValue()->CopyFrom(
415  other_it->second.GetMessageValue());
416  break;
417  }
418  }
419  }
420 }
421 
422 void DynamicMapField::Swap(MapFieldBase* other) {
423  DynamicMapField* other_field = down_cast<DynamicMapField*>(other);
424  std::swap(this->MapFieldBase::repeated_field_, other_field->repeated_field_);
425  map_.swap(other_field->map_);
426  // a relaxed swap of the atomic
427  auto other_state = other_field->state_.load(std::memory_order_relaxed);
428  auto this_state = this->MapFieldBase::state_.load(std::memory_order_relaxed);
429  other_field->state_.store(this_state, std::memory_order_relaxed);
430  this->MapFieldBase::state_.store(other_state, std::memory_order_relaxed);
431 }
432 
434  const Reflection* reflection = default_entry_->GetReflection();
435  const FieldDescriptor* key_des = default_entry_->GetDescriptor()->map_key();
436  const FieldDescriptor* val_des = default_entry_->GetDescriptor()->map_value();
437  if (MapFieldBase::repeated_field_ == nullptr) {
439  Arena::CreateMessage<RepeatedPtrField<Message> >(MapFieldBase::arena_);
440  }
441 
443 
445  it != map_.end(); ++it) {
447  MapFieldBase::repeated_field_->AddAllocated(new_entry);
448  const MapKey& map_key = it->first;
449  switch (key_des->cpp_type()) {
451  reflection->SetString(new_entry, key_des, map_key.GetStringValue());
452  break;
454  reflection->SetInt64(new_entry, key_des, map_key.GetInt64Value());
455  break;
457  reflection->SetInt32(new_entry, key_des, map_key.GetInt32Value());
458  break;
460  reflection->SetUInt64(new_entry, key_des, map_key.GetUInt64Value());
461  break;
463  reflection->SetUInt32(new_entry, key_des, map_key.GetUInt32Value());
464  break;
466  reflection->SetBool(new_entry, key_des, map_key.GetBoolValue());
467  break;
472  GOOGLE_LOG(FATAL) << "Can't get here.";
473  break;
474  }
475  const MapValueRef& map_val = it->second;
476  switch (val_des->cpp_type()) {
478  reflection->SetString(new_entry, val_des, map_val.GetStringValue());
479  break;
481  reflection->SetInt64(new_entry, val_des, map_val.GetInt64Value());
482  break;
484  reflection->SetInt32(new_entry, val_des, map_val.GetInt32Value());
485  break;
487  reflection->SetUInt64(new_entry, val_des, map_val.GetUInt64Value());
488  break;
490  reflection->SetUInt32(new_entry, val_des, map_val.GetUInt32Value());
491  break;
493  reflection->SetBool(new_entry, val_des, map_val.GetBoolValue());
494  break;
496  reflection->SetDouble(new_entry, val_des, map_val.GetDoubleValue());
497  break;
499  reflection->SetFloat(new_entry, val_des, map_val.GetFloatValue());
500  break;
502  reflection->SetEnumValue(new_entry, val_des, map_val.GetEnumValue());
503  break;
505  const Message& message = map_val.GetMessageValue();
506  reflection->MutableMessage(new_entry, val_des)->CopyFrom(message);
507  break;
508  }
509  }
510  }
511 }
512 
514  Map<MapKey, MapValueRef>* map = &const_cast<DynamicMapField*>(this)->map_;
515  const Reflection* reflection = default_entry_->GetReflection();
516  const FieldDescriptor* key_des = default_entry_->GetDescriptor()->map_key();
517  const FieldDescriptor* val_des = default_entry_->GetDescriptor()->map_value();
518  // DynamicMapField owns map values. Need to delete them before clearing
519  // the map.
520  if (MapFieldBase::arena_ == nullptr) {
522  iter != map->end(); ++iter) {
523  iter->second.DeleteData();
524  }
525  }
526  map->clear();
529  it != MapFieldBase::repeated_field_->end(); ++it) {
530  // MapKey type will be set later.
531  MapKey map_key;
532  switch (key_des->cpp_type()) {
534  map_key.SetStringValue(reflection->GetString(*it, key_des));
535  break;
537  map_key.SetInt64Value(reflection->GetInt64(*it, key_des));
538  break;
540  map_key.SetInt32Value(reflection->GetInt32(*it, key_des));
541  break;
543  map_key.SetUInt64Value(reflection->GetUInt64(*it, key_des));
544  break;
546  map_key.SetUInt32Value(reflection->GetUInt32(*it, key_des));
547  break;
549  map_key.SetBoolValue(reflection->GetBool(*it, key_des));
550  break;
555  GOOGLE_LOG(FATAL) << "Can't get here.";
556  break;
557  }
558 
559  if (MapFieldBase::arena_ == nullptr) {
560  // Remove existing map value with same key.
562  if (iter != map->end()) {
563  iter->second.DeleteData();
564  }
565  }
566 
567  MapValueRef& map_val = (*map)[map_key];
568  map_val.SetType(val_des->cpp_type());
569  switch (val_des->cpp_type()) {
570 #define HANDLE_TYPE(CPPTYPE, TYPE, METHOD) \
571  case FieldDescriptor::CPPTYPE_##CPPTYPE: { \
572  TYPE* value = Arena::Create<TYPE>(MapFieldBase::arena_); \
573  *value = reflection->Get##METHOD(*it, val_des); \
574  map_val.SetValue(value); \
575  break; \
576  }
577  HANDLE_TYPE(INT32, int32_t, Int32);
578  HANDLE_TYPE(INT64, int64_t, Int64);
579  HANDLE_TYPE(UINT32, uint32_t, UInt32);
580  HANDLE_TYPE(UINT64, uint64_t, UInt64);
581  HANDLE_TYPE(DOUBLE, double, Double);
582  HANDLE_TYPE(FLOAT, float, Float);
583  HANDLE_TYPE(BOOL, bool, Bool);
584  HANDLE_TYPE(STRING, std::string, String);
585  HANDLE_TYPE(ENUM, int32_t, EnumValue);
586 #undef HANDLE_TYPE
588  const Message& message = reflection->GetMessage(*it, val_des);
590  value->CopyFrom(message);
591  map_val.SetValue(value);
592  break;
593  }
594  }
595  }
596 }
597 
599  size_t size = 0;
600  if (MapFieldBase::repeated_field_ != nullptr) {
601  size += MapFieldBase::repeated_field_->SpaceUsedExcludingSelfLong();
602  }
603  size += sizeof(map_);
604  size_t map_size = map_.size();
605  if (map_size) {
607  size += sizeof(it->first) * map_size;
608  size += sizeof(it->second) * map_size;
609  // If key is string, add the allocated space.
610  if (it->first.type() == FieldDescriptor::CPPTYPE_STRING) {
611  size += sizeof(std::string) * map_size;
612  }
613  // Add the allocated space in MapValueRef.
614  switch (it->second.type()) {
615 #define HANDLE_TYPE(CPPTYPE, TYPE) \
616  case FieldDescriptor::CPPTYPE_##CPPTYPE: { \
617  size += sizeof(TYPE) * map_size; \
618  break; \
619  }
620  HANDLE_TYPE(INT32, int32_t);
621  HANDLE_TYPE(INT64, int64_t);
622  HANDLE_TYPE(UINT32, uint32_t);
623  HANDLE_TYPE(UINT64, uint64_t);
624  HANDLE_TYPE(DOUBLE, double);
625  HANDLE_TYPE(FLOAT, float);
626  HANDLE_TYPE(BOOL, bool);
627  HANDLE_TYPE(STRING, std::string);
628  HANDLE_TYPE(ENUM, int32_t);
629 #undef HANDLE_TYPE
631  while (it != map_.end()) {
632  const Message& message = it->second.GetMessageValue();
633  size += message.GetReflection()->SpaceUsedLong(message);
634  ++it;
635  }
636  break;
637  }
638  }
639  }
640  return size;
641 }
642 
643 } // namespace internal
644 } // namespace protobuf
645 } // namespace google
646 
647 #include <google/protobuf/port_undef.inc>
google::protobuf.internal::MapFieldBase::size
virtual int size() const =0
google::protobuf::RepeatedPtrField::iterator
internal::RepeatedPtrIterator< Element > iterator
Definition: bloaty/third_party/protobuf/src/google/protobuf/repeated_field.h:861
google::protobuf.internal::MapFieldBase::STATE_MODIFIED_MAP
@ STATE_MODIFIED_MAP
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.h:140
google::protobuf::Descriptor::map_key
const FieldDescriptor * map_key() const
Definition: protobuf/src/google/protobuf/descriptor.cc:2320
google::protobuf::RepeatedPtrField
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/command_line_interface.h:62
google::protobuf.internal::MapFieldBase::SpaceUsedExcludingSelfNoLock
virtual size_t SpaceUsedExcludingSelfNoLock() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:64
regen-readme.it
it
Definition: regen-readme.py:15
google::protobuf::value
const Descriptor::ReservedRange value
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1954
google::protobuf.internal::SwapRepeatedPtrToNull
void SwapRepeatedPtrToNull(RepeatedPtrField< Message > **from, RepeatedPtrField< Message > **to, Arena *from_arena, Arena *to_arena)
Definition: protobuf/src/google/protobuf/map_field.cc:67
google::protobuf.internal::DynamicMapField::map_
Map< MapKey, MapValueRef > map_
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.h:345
Map
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:451
testing::internal::Int32
TypeWithSize< 4 >::Int Int32
Definition: bloaty/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:2159
google::protobuf.internal::MapFieldBase::arena_
Arena * arena_
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.h:147
google::protobuf::FieldDescriptor::CPPTYPE_STRING
@ CPPTYPE_STRING
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:562
google::protobuf.internal::MapFieldBase::UnsafeShallowSwap
virtual void UnsafeShallowSwap(MapFieldBase *other)
Definition: protobuf/src/google/protobuf/map_field.cc:99
begin
char * begin
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1007
Bool
Definition: bloaty/third_party/googletest/googletest/test/gtest_pred_impl_unittest.cc:56
google::protobuf.internal::MapFieldBase::mutex_
internal::WrappedMutex mutex_
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.h:151
google::protobuf.internal::DynamicMapField::SetMapIteratorValue
void SetMapIteratorValue(MapIterator *map_iter) const override
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:270
GOOGLE_DCHECK
#define GOOGLE_DCHECK
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:194
google::protobuf.internal::DynamicMapField::InsertOrLookupMapValue
bool InsertOrLookupMapValue(const MapKey &map_key, MapValueRef *val) override
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:228
google::protobuf::Message::GetReflection
const Reflection * GetReflection() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message.h:332
google::protobuf.internal::MapFieldBase::GetRepeatedField
const RepeatedPtrFieldBase & GetRepeatedField() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:46
Arena
Definition: arena.c:39
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
testing::internal::UInt64
TypeWithSize< 8 >::UInt UInt64
Definition: bloaty/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:2162
google::protobuf
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:12
to
size_t to
Definition: abseil-cpp/absl/container/internal/layout_test.cc:1385
testing::internal::UInt32
TypeWithSize< 4 >::UInt UInt32
Definition: bloaty/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:2160
map
zval * map
Definition: php/ext/google/protobuf/encode_decode.c:480
google::protobuf::HANDLE_TYPE
HANDLE_TYPE(int32, FieldDescriptor::CPPTYPE_INT32, -1)
EnumValue
Definition: bloaty/third_party/protobuf/src/google/protobuf/type.pb.h:1105
message
char * message
Definition: libuv/docs/code/tty-gravity/main.c:12
google::protobuf.internal::MapFieldBase::SpaceUsedExcludingSelfLong
size_t SpaceUsedExcludingSelfLong() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:57
BOOL
int BOOL
Definition: undname.c:46
google::protobuf.internal::MapFieldBase::state_
std::atomic< State > state_
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.h:153
arena
grpc_core::ScopedArenaPtr arena
Definition: binder_transport_test.cc:237
google::protobuf.internal::MapFieldBase::MutableAccess
void MutableAccess()
Definition: protobuf/src/google/protobuf/map_field.h:424
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
from
size_t from
Definition: abseil-cpp/absl/container/internal/layout_test.cc:1384
FieldDescriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:133
arena_
Arena * arena_
Definition: client_channel.cc:391
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
int64_t
signed __int64 int64_t
Definition: stdint-msvc2008.h:89
google::protobuf.internal::MapFieldBase::repeated_field_
RepeatedPtrField< Message > * repeated_field_
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.h:148
google::protobuf.internal::MapFieldBase::IsRepeatedFieldValid
bool IsRepeatedFieldValid() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:79
testing::internal::Float
FloatingPoint< float > Float
Definition: bloaty/third_party/googletest/googletest/include/gtest/internal/gtest-internal.h:396
google::protobuf.internal::DynamicMapField::GetMap
const Map< MapKey, MapValueRef > & GetMap() const override
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:259
google::protobuf.internal::MapFieldBase::SyncRepeatedFieldWithMap
void SyncRepeatedFieldWithMap() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:96
uint64_t
unsigned __int64 uint64_t
Definition: stdint-msvc2008.h:90
google::protobuf.internal::MapFieldBase::SetMapDirty
void SetMapDirty()
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:84
google::protobuf.internal::DynamicMapField::default_entry_
const Message * default_entry_
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.h:346
std::swap
void swap(Json::Value &a, Json::Value &b)
Specialize std::swap() for Json::Value.
Definition: third_party/bloaty/third_party/protobuf/conformance/third_party/jsoncpp/json.h:1226
google::protobuf.internal::MapFieldBase::InternalSwap
void InternalSwap(MapFieldBase *other)
Definition: protobuf/src/google/protobuf/map_field.cc:104
google::protobuf.internal::MapFieldBase::SyncRepeatedFieldWithMapNoLock
virtual void SyncRepeatedFieldWithMapNoLock() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:131
google::protobuf::FieldDescriptor::CPPTYPE_UINT64
@ CPPTYPE_UINT64
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:557
google::protobuf.internal::DynamicMapField::MergeFrom
void MergeFrom(const MapFieldBase &other) override
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:279
google::protobuf.internal::MapFieldBase::ConstAccess
void ConstAccess() const
Definition: protobuf/src/google/protobuf/map_field.h:423
google::protobuf.internal::MapFieldBase::STATE_MODIFIED_REPEATED
@ STATE_MODIFIED_REPEATED
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.h:142
google::protobuf::FieldDescriptor::CPPTYPE_INT64
@ CPPTYPE_INT64
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:555
google::protobuf.internal::DynamicMapField::Clear
void Clear() override
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:173
google::protobuf.internal::DynamicMapField::ContainsMapKey
bool ContainsMapKey(const MapKey &map_key) const override
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:189
google::protobuf.internal::DynamicMapField::LookupMapValue
bool LookupMapValue(const MapKey &map_key, MapValueConstRef *val) const override
Definition: protobuf/src/google/protobuf/map_field.cc:308
FATAL
#define FATAL(msg)
Definition: task.h:88
google::protobuf::Message::GetDescriptor
const Descriptor * GetDescriptor() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message.h:323
google::protobuf::FieldDescriptor::CPPTYPE_UINT32
@ CPPTYPE_UINT32
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:556
google::protobuf::FieldDescriptor::CPPTYPE_FLOAT
@ CPPTYPE_FLOAT
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:559
google::protobuf.internal::MapFieldBase::Swap
virtual void Swap(MapFieldBase *other)=0
Definition: protobuf/src/google/protobuf/map_field.cc:80
google::protobuf.internal::DynamicMapField::AllocateMapValue
void AllocateMapValue(MapValueRef *map_val)
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:195
google::protobuf.internal::MapFieldBase::SwapState
void SwapState(MapFieldBase *other)
Definition: protobuf/src/google/protobuf/map_field.cc:59
google::protobuf.internal::MapFieldBase::IsMapValid
bool IsMapValid() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:72
google::protobuf::FieldDescriptor::CPPTYPE_BOOL
@ CPPTYPE_BOOL
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:560
google::protobuf::FieldDescriptor::CPPTYPE_DOUBLE
@ CPPTYPE_DOUBLE
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:558
google::protobuf::MapKey
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.h:371
google::protobuf.internal::MapFieldBase::MutableRepeatedField
RepeatedPtrFieldBase * MutableRepeatedField()
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:51
google::protobuf::FieldDescriptor::CPPTYPE_ENUM
@ CPPTYPE_ENUM
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:561
testing::internal::Double
FloatingPoint< double > Double
Definition: bloaty/third_party/googletest/googletest/include/gtest/internal/gtest-internal.h:397
google::protobuf.internal::MapFieldBase::SyncMapWithRepeatedFieldNoLock
virtual void SyncMapWithRepeatedFieldNoLock() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.h:128
google::protobuf.internal::MapFieldBase::SyncMapWithRepeatedField
void SyncMapWithRepeatedField() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:137
google::protobuf.internal::DynamicMapField::SyncRepeatedFieldWithMapNoLock
void SyncRepeatedFieldWithMapNoLock() const override
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:356
state
Definition: bloaty/third_party/zlib/contrib/blast/blast.c:41
GOOGLE_DCHECK_EQ
#define GOOGLE_DCHECK_EQ
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:196
google::protobuf::Message::New
Message * New() const override=0
google::protobuf.internal::DynamicMapField::Swap
void Swap(MapFieldBase *other) override
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:345
google::protobuf.internal::TypeDefinedMapFieldBase::InternalGetIterator
Map< Key, T >::const_iterator & InternalGetIterator(const MapIterator *map_iter) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field_inl.h:107
google::protobuf.internal::DynamicMapField::DeleteMapValue
bool DeleteMapValue(const MapKey &map_key) override
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:246
google::protobuf::Map
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/arena.h:79
google::protobuf.internal::MapFieldBase::CLEAN
@ CLEAN
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.h:144
internal
Definition: benchmark/test/output_test_helper.cc:20
google::protobuf.internal::MapFieldBase
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.h:69
iter
Definition: test_winkernel.cpp:47
google::protobuf::FieldDescriptor::CPPTYPE_MESSAGE
@ CPPTYPE_MESSAGE
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:563
testing::internal::Int64
TypeWithSize< 8 >::Int Int64
Definition: bloaty/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:2161
google::protobuf::Descriptor::map_value
const FieldDescriptor * map_value() const
Definition: protobuf/src/google/protobuf/descriptor.cc:2326
google::protobuf.internal::DynamicMapField::size
int size() const override
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:171
size
voidpf void uLong size
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
int32_t
signed int int32_t
Definition: stdint-msvc2008.h:77
GOOGLE_LOG
#define GOOGLE_LOG(LEVEL)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:146
google::protobuf::MapValueConstRef::CopyFrom
void CopyFrom(const MapValueConstRef &other)
Definition: protobuf/src/google/protobuf/map_field.h:769
google::protobuf.internal::MapFieldBase::~MapFieldBase
virtual ~MapFieldBase()
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:42
google
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:11
Message
Definition: protobuf/php/ext/google/protobuf/message.c:53
google::protobuf.internal::DynamicMapField::SpaceUsedExcludingSelfNoLock
size_t SpaceUsedExcludingSelfNoLock() const override
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:525
google::protobuf.internal::DynamicMapField::SyncMapWithRepeatedFieldNoLock
void SyncMapWithRepeatedFieldNoLock() const override
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:443
google::protobuf::MapValueConstRef
Definition: protobuf/src/google/protobuf/map_field.h:685
google::protobuf.internal::DynamicMapField::DynamicMapField
DynamicMapField(const Message *default_entry)
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:153
google::protobuf.internal::DynamicMapField::MutableMap
Map< MapKey, MapValueRef > * MutableMap() override
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:264
google::protobuf.internal::DynamicMapField::~DynamicMapField
~DynamicMapField() override
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:161
google::protobuf::Reflection::GetMessage
const Message & GetMessage(const Message &message, const FieldDescriptor *field, MessageFactory *factory=nullptr) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:1442
google::protobuf::FieldDescriptor::CPPTYPE_INT32
@ CPPTYPE_INT32
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:554
google::protobuf.internal::MapFieldBase::SetRepeatedDirty
void SetRepeatedDirty()
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:90


grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:19