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 
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_ != NULL && arena_ == NULL) delete repeated_field_;
44 }
45 
48  return *reinterpret_cast<RepeatedPtrFieldBase*>(repeated_field_);
49 }
50 
54  return reinterpret_cast<RepeatedPtrFieldBase*>(repeated_field_);
55 }
56 
58  mutex_.Lock();
60  mutex_.Unlock();
61  return size;
62 }
63 
65  if (repeated_field_ != NULL) {
66  return repeated_field_->SpaceUsedExcludingSelfLong();
67  } else {
68  return 0;
69  }
70 }
71 
73  // "Acquire" insures the operation after SyncRepeatedFieldWithMap won't get
74  // executed before state_ is checked.
75  int state = state_.load(std::memory_order_acquire);
76  return state != STATE_MODIFIED_REPEATED;
77 }
78 
80  int state = state_.load(std::memory_order_acquire);
81  return state != STATE_MODIFIED_MAP;
82 }
83 
85  // These are called by (non-const) mutator functions. So by our API it's the
86  // callers responsibility to have these calls properly ordered.
87  state_.store(STATE_MODIFIED_MAP, std::memory_order_relaxed);
88 }
89 
91  // These are called by (non-const) mutator functions. So by our API it's the
92  // callers responsibility to have these calls properly ordered.
93  state_.store(STATE_MODIFIED_REPEATED, std::memory_order_relaxed);
94 }
95 
97  // acquire here matches with release below to ensure that we can only see a
98  // value of CLEAN after all previous changes have been synced.
99  switch (state_.load(std::memory_order_acquire)) {
100  case STATE_MODIFIED_MAP:
101  mutex_.Lock();
102  // Double check state, because another thread may have seen the same
103  // state and done the synchronization before the current thread.
104  if (state_.load(std::memory_order_relaxed) == STATE_MODIFIED_MAP) {
106  state_.store(CLEAN, std::memory_order_release);
107  }
108  mutex_.Unlock();
109  break;
110  case CLEAN:
111  mutex_.Lock();
112  // Double check state
113  if (state_.load(std::memory_order_relaxed) == CLEAN) {
114  if (repeated_field_ == nullptr) {
115  if (arena_ == nullptr) {
117  } else {
119  Arena::CreateMessage<RepeatedPtrField<Message> >(arena_);
120  }
121  }
122  state_.store(CLEAN, std::memory_order_release);
123  }
124  mutex_.Unlock();
125  break;
126  default:
127  break;
128  }
129 }
130 
132  if (repeated_field_ == NULL) {
133  repeated_field_ = Arena::CreateMessage<RepeatedPtrField<Message> >(arena_);
134  }
135 }
136 
138  // acquire here matches with release below to ensure that we can only see a
139  // value of CLEAN after all previous changes have been synced.
140  if (state_.load(std::memory_order_acquire) == STATE_MODIFIED_REPEATED) {
141  mutex_.Lock();
142  // Double check state, because another thread may have seen the same state
143  // and done the synchronization before the current thread.
144  if (state_.load(std::memory_order_relaxed) == STATE_MODIFIED_REPEATED) {
146  state_.store(CLEAN, std::memory_order_release);
147  }
148  mutex_.Unlock();
149  }
150 }
151 
152 // ------------------DynamicMapField------------------
154  : default_entry_(default_entry) {}
155 
156 DynamicMapField::DynamicMapField(const Message* default_entry, Arena* arena)
158  map_(arena),
159  default_entry_(default_entry) {}
160 
162  // DynamicMapField owns map values. Need to delete them before clearing
163  // the map.
164  for (Map<MapKey, MapValueRef>::iterator iter = map_.begin();
165  iter != map_.end(); ++iter) {
166  iter->second.DeleteData();
167  }
168  map_.clear();
169 }
170 
171 int DynamicMapField::size() const { return GetMap().size(); }
172 
174  Map<MapKey, MapValueRef>* map = &const_cast<DynamicMapField*>(this)->map_;
175  for (Map<MapKey, MapValueRef>::iterator iter = map->begin();
176  iter != map->end(); ++iter) {
177  iter->second.DeleteData();
178  }
179  map->clear();
180 
181  if (MapFieldBase::repeated_field_ != nullptr) {
183  }
184  // Data in map and repeated field are both empty, but we can't set status
185  // CLEAN which will invalidate previous reference to map.
187 }
188 
189 bool DynamicMapField::ContainsMapKey(const MapKey& map_key) const {
191  Map<MapKey, MapValueRef>::const_iterator iter = map.find(map_key);
192  return iter != map.end();
193 }
194 
196  const FieldDescriptor* val_des =
198  map_val->SetType(val_des->cpp_type());
199  // Allocate memory for the MapValueRef, and initialize to
200  // default value.
201  switch (val_des->cpp_type()) {
202 #define HANDLE_TYPE(CPPTYPE, TYPE) \
203  case FieldDescriptor::CPPTYPE_##CPPTYPE: { \
204  TYPE* value = new TYPE(); \
205  map_val->SetValue(value); \
206  break; \
207  }
208  HANDLE_TYPE(INT32, int32);
209  HANDLE_TYPE(INT64, int64);
210  HANDLE_TYPE(UINT32, uint32);
211  HANDLE_TYPE(UINT64, uint64);
212  HANDLE_TYPE(DOUBLE, double);
213  HANDLE_TYPE(FLOAT, float);
214  HANDLE_TYPE(BOOL, bool);
215  HANDLE_TYPE(STRING, std::string);
216  HANDLE_TYPE(ENUM, int32);
217 #undef HANDLE_TYPE
219  const Message& message =
221  Message* value = message.New();
222  map_val->SetValue(value);
223  break;
224  }
225  }
226 }
227 
229  MapValueRef* val) {
230  // Always use mutable map because users may change the map value by
231  // MapValueRef.
233  Map<MapKey, MapValueRef>::iterator iter = map->find(map_key);
234  if (iter == map->end()) {
235  MapValueRef& map_val = map_[map_key];
236  AllocateMapValue(&map_val);
237  val->CopyFrom(map_val);
238  return true;
239  }
240  // map_key is already in the map. Make sure (*map)[map_key] is not called.
241  // [] may reorder the map and iterators.
242  val->CopyFrom(iter->second);
243  return false;
244 }
245 
248  Map<MapKey, MapValueRef>::iterator iter = map_.find(map_key);
249  if (iter == map_.end()) {
250  return false;
251  }
252  // Set map dirty only if the delete is successful.
254  iter->second.DeleteData();
255  map_.erase(iter);
256  return true;
257 }
258 
261  return map_;
262 }
263 
267  return &map_;
268 }
269 
273  map_iter);
274  if (iter == map_.end()) return;
275  map_iter->key_.CopyFrom(iter->first);
276  map_iter->value_.CopyFrom(iter->second);
277 }
278 
280  GOOGLE_DCHECK(IsMapValid() && other.IsMapValid());
282  const DynamicMapField& other_field =
283  reinterpret_cast<const DynamicMapField&>(other);
285  other_field.map_.begin();
286  other_it != other_field.map_.end(); ++other_it) {
287  Map<MapKey, MapValueRef>::iterator iter = map->find(other_it->first);
288  MapValueRef* map_val;
289  if (iter == map->end()) {
290  map_val = &map_[other_it->first];
291  AllocateMapValue(map_val);
292  } else {
293  map_val = &iter->second;
294  }
295 
296  // Copy map value
297  const FieldDescriptor* field_descriptor =
299  switch (field_descriptor->cpp_type()) {
301  map_val->SetInt32Value(other_it->second.GetInt32Value());
302  break;
303  }
305  map_val->SetInt64Value(other_it->second.GetInt64Value());
306  break;
307  }
309  map_val->SetUInt32Value(other_it->second.GetUInt32Value());
310  break;
311  }
313  map_val->SetUInt64Value(other_it->second.GetUInt64Value());
314  break;
315  }
317  map_val->SetFloatValue(other_it->second.GetFloatValue());
318  break;
319  }
321  map_val->SetDoubleValue(other_it->second.GetDoubleValue());
322  break;
323  }
325  map_val->SetBoolValue(other_it->second.GetBoolValue());
326  break;
327  }
329  map_val->SetStringValue(other_it->second.GetStringValue());
330  break;
331  }
333  map_val->SetEnumValue(other_it->second.GetEnumValue());
334  break;
335  }
337  map_val->MutableMessageValue()->CopyFrom(
338  other_it->second.GetMessageValue());
339  break;
340  }
341  }
342  }
343 }
344 
346  DynamicMapField* other_field = down_cast<DynamicMapField*>(other);
347  std::swap(this->MapFieldBase::repeated_field_, other_field->repeated_field_);
348  map_.swap(other_field->map_);
349  // a relaxed swap of the atomic
350  auto other_state = other_field->state_.load(std::memory_order_relaxed);
351  auto this_state = this->MapFieldBase::state_.load(std::memory_order_relaxed);
352  other_field->state_.store(this_state, std::memory_order_relaxed);
353  this->MapFieldBase::state_.store(other_state, std::memory_order_relaxed);
354 }
355 
357  const Reflection* reflection = default_entry_->GetReflection();
358  const FieldDescriptor* key_des =
360  const FieldDescriptor* val_des =
363  if (MapFieldBase::arena_ == NULL) {
365  } else {
367  Arena::CreateMessage<RepeatedPtrField<Message> >(
369  }
370  }
371 
373 
375  it != map_.end(); ++it) {
376  Message* new_entry = default_entry_->New();
377  MapFieldBase::repeated_field_->AddAllocated(new_entry);
378  const MapKey& map_key = it->first;
379  switch (key_des->cpp_type()) {
381  reflection->SetString(new_entry, key_des, map_key.GetStringValue());
382  break;
384  reflection->SetInt64(new_entry, key_des, map_key.GetInt64Value());
385  break;
387  reflection->SetInt32(new_entry, key_des, map_key.GetInt32Value());
388  break;
390  reflection->SetUInt64(new_entry, key_des, map_key.GetUInt64Value());
391  break;
393  reflection->SetUInt32(new_entry, key_des, map_key.GetUInt32Value());
394  break;
396  reflection->SetBool(new_entry, key_des, map_key.GetBoolValue());
397  break;
402  GOOGLE_LOG(FATAL) << "Can't get here.";
403  break;
404  }
405  const MapValueRef& map_val = it->second;
406  switch (val_des->cpp_type()) {
408  reflection->SetString(new_entry, val_des, map_val.GetStringValue());
409  break;
411  reflection->SetInt64(new_entry, val_des, map_val.GetInt64Value());
412  break;
414  reflection->SetInt32(new_entry, val_des, map_val.GetInt32Value());
415  break;
417  reflection->SetUInt64(new_entry, val_des, map_val.GetUInt64Value());
418  break;
420  reflection->SetUInt32(new_entry, val_des, map_val.GetUInt32Value());
421  break;
423  reflection->SetBool(new_entry, val_des, map_val.GetBoolValue());
424  break;
426  reflection->SetDouble(new_entry, val_des, map_val.GetDoubleValue());
427  break;
429  reflection->SetFloat(new_entry, val_des, map_val.GetFloatValue());
430  break;
432  reflection->SetEnumValue(new_entry, val_des, map_val.GetEnumValue());
433  break;
435  const Message& message = map_val.GetMessageValue();
436  reflection->MutableMessage(new_entry, val_des)->CopyFrom(message);
437  break;
438  }
439  }
440  }
441 }
442 
444  Map<MapKey, MapValueRef>* map = &const_cast<DynamicMapField*>(this)->map_;
445  const Reflection* reflection = default_entry_->GetReflection();
446  const FieldDescriptor* key_des =
448  const FieldDescriptor* val_des =
450  // DynamicMapField owns map values. Need to delete them before clearing
451  // the map.
452  for (Map<MapKey, MapValueRef>::iterator iter = map->begin();
453  iter != map->end(); ++iter) {
454  iter->second.DeleteData();
455  }
456  map->clear();
459  it != MapFieldBase::repeated_field_->end(); ++it) {
460  MapKey map_key;
461  switch (key_des->cpp_type()) {
463  map_key.SetStringValue(reflection->GetString(*it, key_des));
464  break;
466  map_key.SetInt64Value(reflection->GetInt64(*it, key_des));
467  break;
469  map_key.SetInt32Value(reflection->GetInt32(*it, key_des));
470  break;
472  map_key.SetUInt64Value(reflection->GetUInt64(*it, key_des));
473  break;
475  map_key.SetUInt32Value(reflection->GetUInt32(*it, key_des));
476  break;
478  map_key.SetBoolValue(reflection->GetBool(*it, key_des));
479  break;
484  GOOGLE_LOG(FATAL) << "Can't get here.";
485  break;
486  }
487 
488  // Remove existing map value with same key.
489  Map<MapKey, MapValueRef>::iterator iter = map->find(map_key);
490  if (iter != map->end()) {
491  iter->second.DeleteData();
492  }
493 
494  MapValueRef& map_val = (*map)[map_key];
495  map_val.SetType(val_des->cpp_type());
496  switch (val_des->cpp_type()) {
497 #define HANDLE_TYPE(CPPTYPE, TYPE, METHOD) \
498  case FieldDescriptor::CPPTYPE_##CPPTYPE: { \
499  TYPE* value = new TYPE; \
500  *value = reflection->Get##METHOD(*it, val_des); \
501  map_val.SetValue(value); \
502  break; \
503  }
504  HANDLE_TYPE(INT32, int32, Int32);
505  HANDLE_TYPE(INT64, int64, Int64);
506  HANDLE_TYPE(UINT32, uint32, UInt32);
507  HANDLE_TYPE(UINT64, uint64, UInt64);
508  HANDLE_TYPE(DOUBLE, double, Double);
509  HANDLE_TYPE(FLOAT, float, Float);
510  HANDLE_TYPE(BOOL, bool, Bool);
511  HANDLE_TYPE(STRING, std::string, String);
512  HANDLE_TYPE(ENUM, int32, EnumValue);
513 #undef HANDLE_TYPE
515  const Message& message = reflection->GetMessage(*it, val_des);
516  Message* value = message.New();
518  map_val.SetValue(value);
519  break;
520  }
521  }
522  }
523 }
524 
526  size_t size = 0;
528  size += MapFieldBase::repeated_field_->SpaceUsedExcludingSelfLong();
529  }
530  size += sizeof(map_);
531  size_t map_size = map_.size();
532  if (map_size) {
534  size += sizeof(it->first) * map_size;
535  size += sizeof(it->second) * map_size;
536  // If key is string, add the allocated space.
537  if (it->first.type() == FieldDescriptor::CPPTYPE_STRING) {
538  size += sizeof(std::string) * map_size;
539  }
540  // Add the allocated space in MapValueRef.
541  switch (it->second.type()) {
542 #define HANDLE_TYPE(CPPTYPE, TYPE) \
543  case FieldDescriptor::CPPTYPE_##CPPTYPE: { \
544  size += sizeof(TYPE) * map_size; \
545  break; \
546  }
547  HANDLE_TYPE(INT32, int32);
548  HANDLE_TYPE(INT64, int64);
549  HANDLE_TYPE(UINT32, uint32);
550  HANDLE_TYPE(UINT64, uint64);
551  HANDLE_TYPE(DOUBLE, double);
552  HANDLE_TYPE(FLOAT, float);
553  HANDLE_TYPE(BOOL, bool);
554  HANDLE_TYPE(STRING, std::string);
555  HANDLE_TYPE(ENUM, int32);
556 #undef HANDLE_TYPE
558  while (it != map_.end()) {
559  const Message& message = it->second.GetMessageValue();
560  size += message.GetReflection()->SpaceUsedLong(message);
561  ++it;
562  }
563  break;
564  }
565  }
566  }
567  return size;
568 }
569 
570 } // namespace internal
571 } // namespace protobuf
572 } // namespace google
google::protobuf.internal::MapFieldBase::size
virtual int size() const =0
google::protobuf::Reflection::GetString
std::string GetString(const Message &message, const FieldDescriptor *field) const
Definition: generated_message_reflection.cc:1151
google::protobuf.internal::MapFieldBase::STATE_MODIFIED_MAP
@ STATE_MODIFIED_MAP
Definition: map_field.h:140
Json::UInt64
unsigned long long int UInt64
Definition: json.h:241
google::protobuf::FieldDescriptor::CPPTYPE_ENUM
@ CPPTYPE_ENUM
Definition: src/google/protobuf/descriptor.h:561
google::protobuf::RepeatedPtrField
Definition: command_line_interface.h:62
google::protobuf.internal::MapFieldBase::SpaceUsedExcludingSelfNoLock
virtual size_t SpaceUsedExcludingSelfNoLock() const
Definition: map_field.cc:64
google::protobuf::MapValueRef::SetBoolValue
void SetBoolValue(bool value)
Definition: map_field.h:585
google::protobuf::FieldDescriptor::CPPTYPE_STRING
@ CPPTYPE_STRING
Definition: src/google/protobuf/descriptor.h:562
google::protobuf::FieldDescriptor
Definition: src/google/protobuf/descriptor.h:515
google::protobuf::Reflection::SetBool
void SetBool(Message *message, const FieldDescriptor *field, bool value) const
NULL
NULL
Definition: test_security_zap.cpp:405
Bool
Definition: gtest_pred_impl_unittest.cc:56
google::protobuf::int64
int64_t int64
Definition: protobuf/src/google/protobuf/stubs/port.h:151
google::protobuf.internal::MapFieldBase::mutex_
internal::WrappedMutex mutex_
Definition: map_field.h:151
map_field_inl.h
google::protobuf::FieldDescriptor::CPPTYPE_UINT64
@ CPPTYPE_UINT64
Definition: src/google/protobuf/descriptor.h:557
google::protobuf::MapKey::GetUInt64Value
uint64 GetUInt64Value() const
Definition: map_field.h:424
google::protobuf::Reflection::GetUInt32
uint32 GetUInt32(const Message &message, const FieldDescriptor *field) const
google::protobuf::MapValueRef::GetUInt32Value
uint32 GetUInt32Value() const
Definition: map_field.h:619
google::protobuf.internal::DynamicMapField::SetMapIteratorValue
void SetMapIteratorValue(MapIterator *map_iter) const override
Definition: map_field.cc:270
FATAL
const int FATAL
Definition: log_severity.h:60
google::protobuf.internal::DynamicMapField::InsertOrLookupMapValue
bool InsertOrLookupMapValue(const MapKey &map_key, MapValueRef *val) override
Definition: map_field.cc:228
google::protobuf::MapKey::SetUInt64Value
void SetUInt64Value(uint64 value)
Definition: map_field.h:399
google::protobuf::MapKey::SetStringValue
void SetStringValue(const std::string &val)
Definition: map_field.h:415
GOOGLE_DCHECK
#define GOOGLE_DCHECK
Definition: logging.h:194
google::protobuf::Message::GetReflection
const Reflection * GetReflection() const
Definition: src/google/protobuf/message.h:335
google::protobuf.internal::MapFieldBase::GetRepeatedField
const RepeatedPtrFieldBase & GetRepeatedField() const
Definition: map_field.cc:46
google::protobuf::FieldDescriptor::CPPTYPE_INT64
@ CPPTYPE_INT64
Definition: src/google/protobuf/descriptor.h:555
google::protobuf::MapKey::GetInt32Value
int32 GetInt32Value() const
Definition: map_field.h:428
google::protobuf::FieldDescriptor::CPPTYPE_UINT32
@ CPPTYPE_UINT32
Definition: src/google/protobuf/descriptor.h:556
google::protobuf::MapValueRef::GetBoolValue
bool GetBoolValue() const
Definition: map_field.h:623
google::protobuf::uint32
uint32_t uint32
Definition: protobuf/src/google/protobuf/stubs/port.h:155
google::protobuf::Message::CopyFrom
virtual void CopyFrom(const Message &from)
Definition: src/google/protobuf/message.cc:98
google::protobuf::MapKey::GetUInt32Value
uint32 GetUInt32Value() const
Definition: map_field.h:432
google::protobuf::Reflection::SetDouble
void SetDouble(Message *message, const FieldDescriptor *field, double value) const
google::protobuf.internal::TypeDefinedMapFieldBase
Definition: map.h:81
string
GLsizei const GLchar *const * string
Definition: glcorearb.h:3083
google::protobuf::Reflection::SetInt64
void SetInt64(Message *message, const FieldDescriptor *field, int64 value) const
google::protobuf::Reflection::SetString
void SetString(Message *message, const FieldDescriptor *field, const std::string &value) const
Definition: generated_message_reflection.cc:1193
google::protobuf.internal::DynamicMapField
Definition: map_field.h:324
google::protobuf::MapValueRef::GetDoubleValue
double GetDoubleValue() const
Definition: map_field.h:639
google::protobuf::Reflection
Definition: src/google/protobuf/message.h:400
google::protobuf::MapValueRef::GetMessageValue
const Message & GetMessageValue() const
Definition: map_field.h:644
map
zval * map
Definition: php/ext/google/protobuf/encode_decode.c:473
google::protobuf::HANDLE_TYPE
HANDLE_TYPE(int32, FieldDescriptor::CPPTYPE_INT32, -1)
EnumValue
Definition: type.pb.h:1012
google::protobuf::Reflection::GetBool
bool GetBool(const Message &message, const FieldDescriptor *field) const
testing::internal::Int32
TypeWithSize< 4 >::Int Int32
Definition: gtest-port.h:2241
google::protobuf.internal::MapFieldBase::SpaceUsedExcludingSelfLong
size_t SpaceUsedExcludingSelfLong() const
Definition: map_field.cc:57
google::protobuf::MapValueRef::SetUInt32Value
void SetUInt32Value(uint32 value)
Definition: map_field.h:581
google::protobuf::MapValueRef::GetInt32Value
int32 GetInt32Value() const
Definition: map_field.h:615
map_field.h
google::protobuf::MapIterator::key_
MapKey key_
Definition: map_field.h:774
google::protobuf::MapValueRef::CopyFrom
void CopyFrom(const MapValueRef &other)
Definition: map_field.h:678
google::protobuf::Reflection::SetUInt64
void SetUInt64(Message *message, const FieldDescriptor *field, uint64 value) const
testing::internal::Double
FloatingPoint< double > Double
Definition: gtest-internal.h:429
testing::internal::UInt32
TypeWithSize< 4 >::UInt UInt32
Definition: gtest-port.h:2242
begin
static size_t begin(const upb_table *t)
Definition: php/ext/google/protobuf/upb.c:4898
google::protobuf::MapValueRef::GetUInt64Value
uint64 GetUInt64Value() const
Definition: map_field.h:611
google::protobuf::int32
int32_t int32
Definition: protobuf/src/google/protobuf/stubs/port.h:150
google::protobuf::MapKey::CopyFrom
void CopyFrom(const MapKey &other)
Definition: map_field.h:503
google::protobuf::MapValueRef::GetStringValue
const std::string & GetStringValue() const
Definition: map_field.h:631
testing::internal::Float
FloatingPoint< float > Float
Definition: gtest-internal.h:428
google::protobuf.internal::MapFieldBase::CLEAN
@ CLEAN
Definition: map_field.h:144
google::protobuf.internal::MapFieldBase::IsRepeatedFieldValid
bool IsRepeatedFieldValid() const
Definition: map_field.cc:79
google::protobuf.internal::DynamicMapField::GetMap
const Map< MapKey, MapValueRef > & GetMap() const override
Definition: map_field.cc:259
google::protobuf::MapValueRef::SetFloatValue
void SetFloatValue(float value)
Definition: map_field.h:598
google::protobuf::MapValueRef::SetType
void SetType(FieldDescriptor::CppType type)
Definition: map_field.h:668
google::protobuf.internal::MapFieldBase::repeated_field_
RepeatedPtrField< Message > * repeated_field_
Definition: map_field.h:148
google::protobuf::MapKey::GetInt64Value
int64 GetInt64Value() const
Definition: map_field.h:420
google::protobuf.internal::MapFieldBase::SyncRepeatedFieldWithMap
void SyncRepeatedFieldWithMap() const
Definition: map_field.cc:96
google::protobuf.internal::MapFieldBase::SetMapDirty
void SetMapDirty()
Definition: map_field.cc:84
google::protobuf::MapValueRef::SetEnumValue
void SetEnumValue(int value)
Definition: map_field.h:590
google::protobuf::Reflection::SetInt32
void SetInt32(Message *message, const FieldDescriptor *field, int32 value) const
GOOGLE_LOG
#define GOOGLE_LOG(LEVEL)
Definition: logging.h:146
google::protobuf::MapValueRef::SetUInt64Value
void SetUInt64Value(uint64 value)
Definition: map_field.h:573
std::swap
void swap(Json::Value &a, Json::Value &b)
Specialize std::swap() for Json::Value.
Definition: json.h:1226
google::protobuf.internal::MapFieldBase::arena_
Arena * arena_
Definition: map_field.h:147
google::protobuf::MapValueRef::SetInt32Value
void SetInt32Value(int32 value)
Definition: map_field.h:577
google::protobuf::uint64
uint64_t uint64
Definition: protobuf/src/google/protobuf/stubs/port.h:156
google::protobuf.internal::MapFieldBase::SyncRepeatedFieldWithMapNoLock
virtual void SyncRepeatedFieldWithMapNoLock() const
Definition: map_field.cc:131
google::protobuf.internal::RepeatedPtrIterator
Definition: repeated_field.h:369
google::protobuf::MapValueRef::GetInt64Value
int64 GetInt64Value() const
Definition: map_field.h:607
google::protobuf::MapKey::SetInt64Value
void SetInt64Value(int64 value)
Definition: map_field.h:395
google::protobuf.internal::DynamicMapField::MergeFrom
void MergeFrom(const MapFieldBase &other) override
Definition: map_field.cc:279
google::protobuf::Reflection::GetInt32
int32 GetInt32(const Message &message, const FieldDescriptor *field) const
google::protobuf::FieldDescriptor::CPPTYPE_DOUBLE
@ CPPTYPE_DOUBLE
Definition: src/google/protobuf/descriptor.h:558
google::protobuf::Reflection::MutableMessage
Message * MutableMessage(Message *message, const FieldDescriptor *field, MessageFactory *factory=nullptr) const
Definition: generated_message_reflection.cc:1462
google::protobuf::MapIterator::value_
MapValueRef value_
Definition: map_field.h:775
google::protobuf.internal::MapFieldBase::STATE_MODIFIED_REPEATED
@ STATE_MODIFIED_REPEATED
Definition: map_field.h:142
google::protobuf::MapValueRef::SetInt64Value
void SetInt64Value(int64 value)
Definition: map_field.h:569
google::protobuf.internal::DynamicMapField::Clear
void Clear() override
Definition: map_field.cc:173
google::protobuf.internal::DynamicMapField::ContainsMapKey
bool ContainsMapKey(const MapKey &map_key) const override
Definition: map_field.cc:189
google::protobuf::MapKey::SetInt32Value
void SetInt32Value(int32 value)
Definition: map_field.h:403
google::protobuf::FieldDescriptor::CPPTYPE_FLOAT
@ CPPTYPE_FLOAT
Definition: src/google/protobuf/descriptor.h:559
google::protobuf::FieldDescriptor::CPPTYPE_BOOL
@ CPPTYPE_BOOL
Definition: src/google/protobuf/descriptor.h:560
google::protobuf::Message
Definition: src/google/protobuf/message.h:205
google::protobuf::Message::GetDescriptor
const Descriptor * GetDescriptor() const
Definition: src/google/protobuf/message.h:326
google::protobuf::MapValueRef::GetFloatValue
float GetFloatValue() const
Definition: map_field.h:635
google::protobuf.internal::DynamicMapField::default_entry_
const Message * default_entry_
Definition: map_field.h:346
google::protobuf.internal::DynamicMapField::AllocateMapValue
void AllocateMapValue(MapValueRef *map_val)
Definition: map_field.cc:195
google::protobuf.internal::MapFieldBase::IsMapValid
bool IsMapValid() const
Definition: map_field.cc:72
google::protobuf::Descriptor::FindFieldByName
const FieldDescriptor * FindFieldByName(const std::string &name) const
Definition: src/google/protobuf/descriptor.cc:1615
google::protobuf::Reflection::SetEnumValue
void SetEnumValue(Message *message, const FieldDescriptor *field, int value) const
Definition: generated_message_reflection.cc:1322
size
GLsizeiptr size
Definition: glcorearb.h:2943
google::protobuf::MapKey
Definition: map_field.h:371
google::protobuf.internal::MapFieldBase::MutableRepeatedField
RepeatedPtrFieldBase * MutableRepeatedField()
Definition: map_field.cc:51
google::protobuf::MapKey::GetStringValue
const std::string & GetStringValue() const
Definition: map_field.h:440
google::protobuf::MapValueRef::SetValue
void SetValue(const void *val)
Definition: map_field.h:677
google::protobuf.internal::MapFieldBase::SyncMapWithRepeatedFieldNoLock
virtual void SyncMapWithRepeatedFieldNoLock() const
Definition: map_field.h:128
google::protobuf::MapValueRef::SetDoubleValue
void SetDoubleValue(double value)
Definition: map_field.h:602
google::protobuf.internal::MapFieldBase::SyncMapWithRepeatedField
void SyncMapWithRepeatedField() const
Definition: map_field.cc:137
google::protobuf.internal::DynamicMapField::SyncRepeatedFieldWithMapNoLock
void SyncRepeatedFieldWithMapNoLock() const override
Definition: map_field.cc:356
google::protobuf::MapValueRef::SetStringValue
void SetStringValue(const std::string &value)
Definition: map_field.h:594
google::protobuf::Reflection::GetInt64
int64 GetInt64(const Message &message, const FieldDescriptor *field) const
google::protobuf::Message::New
Message * New() const override=0
google::protobuf.internal::DynamicMapField::Swap
void Swap(MapFieldBase *other) override
Definition: map_field.cc:345
google::protobuf.internal::RepeatedPtrFieldBase
Definition: repeated_field.h:459
google::protobuf.internal::TypeDefinedMapFieldBase::InternalGetIterator
Map< Key, T >::const_iterator & InternalGetIterator(const MapIterator *map_iter) const
Definition: map_field_inl.h:107
google::protobuf.internal::DynamicMapField::DeleteMapValue
bool DeleteMapValue(const MapKey &map_key) override
Definition: map_field.cc:246
google::protobuf::Map
Definition: map.h:62
internal
Definition: any.pb.h:40
google::protobuf.internal::MapFieldBase
Definition: map_field.h:69
google::protobuf.internal::DynamicMapField::map_
Map< MapKey, MapValueRef > map_
Definition: map_field.h:345
val
GLuint GLfloat * val
Definition: glcorearb.h:3604
google::protobuf.internal::DynamicMapField::size
int size() const override
Definition: map_field.cc:171
value
GLsizei const GLfloat * value
Definition: glcorearb.h:3093
google::protobuf::MapKey::SetBoolValue
void SetBoolValue(bool value)
Definition: map_field.h:411
google::protobuf::FieldDescriptor::CPPTYPE_MESSAGE
@ CPPTYPE_MESSAGE
Definition: src/google/protobuf/descriptor.h:563
google::protobuf::MapKey::GetBoolValue
bool GetBoolValue() const
Definition: map_field.h:436
google::protobuf::MapIterator
Definition: map_field.h:712
google::protobuf::FieldDescriptor::CPPTYPE_INT32
@ CPPTYPE_INT32
Definition: src/google/protobuf/descriptor.h:554
google::protobuf.internal::MapFieldBase::state_
std::atomic< State > state_
Definition: map_field.h:153
google::protobuf::MapValueRef::GetEnumValue
int GetEnumValue() const
Definition: map_field.h:627
Json::Int64
long long int Int64
Definition: json.h:240
google::protobuf::MapKey::SetUInt32Value
void SetUInt32Value(uint32 value)
Definition: map_field.h:407
google::protobuf::FieldDescriptor::cpp_type
CppType cpp_type() const
Definition: src/google/protobuf/descriptor.h:2139
google::protobuf.internal::MapFieldBase::~MapFieldBase
virtual ~MapFieldBase()
Definition: map_field.cc:42
google::protobuf::Reflection::SetFloat
void SetFloat(Message *message, const FieldDescriptor *field, float value) const
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::Reflection::GetUInt64
uint64 GetUInt64(const Message &message, const FieldDescriptor *field) const
google::protobuf.internal::DynamicMapField::SpaceUsedExcludingSelfNoLock
size_t SpaceUsedExcludingSelfNoLock() const override
Definition: map_field.cc:525
google::protobuf.internal::DynamicMapField::SyncMapWithRepeatedFieldNoLock
void SyncMapWithRepeatedFieldNoLock() const override
Definition: map_field.cc:443
google::protobuf.internal::DynamicMapField::DynamicMapField
DynamicMapField(const Message *default_entry)
Definition: map_field.cc:153
google::protobuf.internal::DynamicMapField::MutableMap
Map< MapKey, MapValueRef > * MutableMap() override
Definition: map_field.cc:264
google::protobuf::MapValueRef::MutableMessageValue
Message * MutableMessageValue()
Definition: map_field.h:650
google::protobuf.internal::DynamicMapField::~DynamicMapField
~DynamicMapField() override
Definition: map_field.cc:161
google::protobuf::Reflection::GetMessage
const Message & GetMessage(const Message &message, const FieldDescriptor *field, MessageFactory *factory=nullptr) const
Definition: generated_message_reflection.cc:1443
google::protobuf::MapValueRef
Definition: map_field.h:565
google::protobuf.internal::MapFieldBase::SetRepeatedDirty
void SetRepeatedDirty()
Definition: map_field.cc:90
google::protobuf::Reflection::SetUInt32
void SetUInt32(Message *message, const FieldDescriptor *field, uint32 value) const


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