protobuf/src/google/protobuf/reflection_ops.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 // Author: kenton@google.com (Kenton Varda)
32 // Based on original Protocol Buffers design by
33 // Sanjay Ghemawat, Jeff Dean, and others.
34 #include <google/protobuf/reflection_ops.h>
35 
36 #include <string>
37 #include <vector>
38 
39 #include <google/protobuf/stubs/logging.h>
40 #include <google/protobuf/stubs/common.h>
41 #include <google/protobuf/descriptor.pb.h>
42 #include <google/protobuf/descriptor.h>
43 #include <google/protobuf/map_field.h>
44 #include <google/protobuf/map_field_inl.h>
45 #include <google/protobuf/unknown_field_set.h>
46 
47 #include <google/protobuf/port_def.inc>
48 
49 namespace google {
50 namespace protobuf {
51 namespace internal {
52 
53 static const Reflection* GetReflectionOrDie(const Message& m) {
54  const Reflection* r = m.GetReflection();
55  if (r == nullptr) {
56  const Descriptor* d = m.GetDescriptor();
57  const std::string& mtype = d ? d->name() : "unknown";
58  // RawMessage is one known type for which GetReflection() returns nullptr.
59  GOOGLE_LOG(FATAL) << "Message does not support reflection (type " << mtype << ").";
60  }
61  return r;
62 }
63 
64 void ReflectionOps::Copy(const Message& from, Message* to) {
65  if (&from == to) return;
66  Clear(to);
67  Merge(from, to);
68 }
69 
72 
73  const Descriptor* descriptor = from.GetDescriptor();
74  GOOGLE_CHECK_EQ(to->GetDescriptor(), descriptor)
75  << "Tried to merge messages of different types "
76  << "(merge " << descriptor->full_name() << " to "
77  << to->GetDescriptor()->full_name() << ")";
78 
79  const Reflection* from_reflection = GetReflectionOrDie(from);
80  const Reflection* to_reflection = GetReflectionOrDie(*to);
81  bool is_from_generated = (from_reflection->GetMessageFactory() ==
83  bool is_to_generated = (to_reflection->GetMessageFactory() ==
85 
86  std::vector<const FieldDescriptor*> fields;
87  from_reflection->ListFieldsOmitStripped(from, &fields);
88  for (const FieldDescriptor* field : fields) {
89  if (field->is_repeated()) {
90  // Use map reflection if both are in map status and have the
91  // same map type to avoid sync with repeated field.
92  // Note: As from and to messages have the same descriptor, the
93  // map field types are the same if they are both generated
94  // messages or both dynamic messages.
95  if (is_from_generated == is_to_generated && field->is_map()) {
96  const MapFieldBase* from_field =
97  from_reflection->GetMapData(from, field);
98  MapFieldBase* to_field = to_reflection->MutableMapData(to, field);
99  if (to_field->IsMapValid() && from_field->IsMapValid()) {
100  to_field->MergeFrom(*from_field);
101  continue;
102  }
103  }
104  int count = from_reflection->FieldSize(from, field);
105  for (int j = 0; j < count; j++) {
106  switch (field->cpp_type()) {
107 #define HANDLE_TYPE(CPPTYPE, METHOD) \
108  case FieldDescriptor::CPPTYPE_##CPPTYPE: \
109  to_reflection->Add##METHOD( \
110  to, field, from_reflection->GetRepeated##METHOD(from, field, j)); \
111  break;
112 
113  HANDLE_TYPE(INT32, Int32);
114  HANDLE_TYPE(INT64, Int64);
115  HANDLE_TYPE(UINT32, UInt32);
116  HANDLE_TYPE(UINT64, UInt64);
117  HANDLE_TYPE(FLOAT, Float);
118  HANDLE_TYPE(DOUBLE, Double);
120  HANDLE_TYPE(STRING, String);
121  HANDLE_TYPE(ENUM, Enum);
122 #undef HANDLE_TYPE
123 
125  const Message& from_child =
126  from_reflection->GetRepeatedMessage(from, field, j);
127  if (from_reflection == to_reflection) {
128  to_reflection
129  ->AddMessage(to, field,
130  from_child.GetReflection()->GetMessageFactory())
131  ->MergeFrom(from_child);
132  } else {
133  to_reflection->AddMessage(to, field)->MergeFrom(from_child);
134  }
135  break;
136  }
137  }
138  } else {
139  switch (field->cpp_type()) {
140 #define HANDLE_TYPE(CPPTYPE, METHOD) \
141  case FieldDescriptor::CPPTYPE_##CPPTYPE: \
142  to_reflection->Set##METHOD(to, field, \
143  from_reflection->Get##METHOD(from, field)); \
144  break;
145 
146  HANDLE_TYPE(INT32, Int32);
147  HANDLE_TYPE(INT64, Int64);
148  HANDLE_TYPE(UINT32, UInt32);
149  HANDLE_TYPE(UINT64, UInt64);
150  HANDLE_TYPE(FLOAT, Float);
151  HANDLE_TYPE(DOUBLE, Double);
153  HANDLE_TYPE(STRING, String);
154  HANDLE_TYPE(ENUM, Enum);
155 #undef HANDLE_TYPE
156 
158  const Message& from_child = from_reflection->GetMessage(from, field);
159  if (from_reflection == to_reflection) {
160  to_reflection
161  ->MutableMessage(
162  to, field, from_child.GetReflection()->GetMessageFactory())
163  ->MergeFrom(from_child);
164  } else {
165  to_reflection->MutableMessage(to, field)->MergeFrom(from_child);
166  }
167  break;
168  }
169  }
170  }
171 
172  to_reflection->MutableUnknownFields(to)->MergeFrom(
173  from_reflection->GetUnknownFields(from));
174 }
175 
177  const Reflection* reflection = GetReflectionOrDie(*message);
178 
179  std::vector<const FieldDescriptor*> fields;
180  reflection->ListFieldsOmitStripped(*message, &fields);
181  for (const FieldDescriptor* field : fields) {
182  reflection->ClearField(message, field);
183  }
184 
185  reflection->MutableUnknownFields(message)->Clear();
186 }
187 
188 bool ReflectionOps::IsInitialized(const Message& message, bool check_fields,
189  bool check_descendants) {
190  const Descriptor* descriptor = message.GetDescriptor();
191  const Reflection* reflection = GetReflectionOrDie(message);
192  if (const int field_count = descriptor->field_count()) {
193  const FieldDescriptor* begin = descriptor->field(0);
194  const FieldDescriptor* end = begin + field_count;
195  GOOGLE_DCHECK_EQ(descriptor->field(field_count - 1), end - 1);
196 
197  if (check_fields) {
198  // Check required fields of this message.
199  for (const FieldDescriptor* field = begin; field != end; ++field) {
200  if (field->is_required() && !reflection->HasField(message, field)) {
201  return false;
202  }
203  }
204  }
205 
206  if (check_descendants) {
207  for (const FieldDescriptor* field = begin; field != end; ++field) {
208  if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
209  const Descriptor* message_type = field->message_type();
210  if (PROTOBUF_PREDICT_FALSE(message_type->options().map_entry())) {
211  if (message_type->field(1)->cpp_type() ==
213  const MapFieldBase* map_field =
214  reflection->GetMapData(message, field);
215  if (map_field->IsMapValid()) {
216  MapIterator it(const_cast<Message*>(&message), field);
217  MapIterator end_map(const_cast<Message*>(&message), field);
218  for (map_field->MapBegin(&it), map_field->MapEnd(&end_map);
219  it != end_map; ++it) {
220  if (!it.GetValueRef().GetMessageValue().IsInitialized()) {
221  return false;
222  }
223  }
224  }
225  }
226  } else if (field->is_repeated()) {
227  const int size = reflection->FieldSize(message, field);
228  for (int j = 0; j < size; j++) {
229  if (!reflection->GetRepeatedMessage(message, field, j)
230  .IsInitialized()) {
231  return false;
232  }
233  }
234  } else if (reflection->HasField(message, field)) {
235  if (!reflection->GetMessage(message, field).IsInitialized()) {
236  return false;
237  }
238  }
239  }
240  }
241  }
242  }
243  if (check_descendants && reflection->HasExtensionSet(message) &&
244  !reflection->GetExtensionSet(message).IsInitialized()) {
245  return false;
246  }
247  return true;
248 }
249 
251  const Descriptor* descriptor = message.GetDescriptor();
252  const Reflection* reflection = GetReflectionOrDie(message);
253 
254  // Check required fields of this message.
255  {
256  const int field_count = descriptor->field_count();
257  for (int i = 0; i < field_count; i++) {
258  if (descriptor->field(i)->is_required()) {
259  if (!reflection->HasField(message, descriptor->field(i))) {
260  return false;
261  }
262  }
263  }
264  }
265 
266  // Check that sub-messages are initialized.
267  std::vector<const FieldDescriptor*> fields;
268  // Should be safe to skip stripped fields because required fields are not
269  // stripped.
270  reflection->ListFieldsOmitStripped(message, &fields);
271  for (const FieldDescriptor* field : fields) {
272  if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
273 
274  if (field->is_map()) {
275  const FieldDescriptor* value_field = field->message_type()->field(1);
276  if (value_field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
277  const MapFieldBase* map_field =
278  reflection->GetMapData(message, field);
279  if (map_field->IsMapValid()) {
280  MapIterator iter(const_cast<Message*>(&message), field);
281  MapIterator end(const_cast<Message*>(&message), field);
282  for (map_field->MapBegin(&iter), map_field->MapEnd(&end);
283  iter != end; ++iter) {
284  if (!iter.GetValueRef().GetMessageValue().IsInitialized()) {
285  return false;
286  }
287  }
288  continue;
289  }
290  } else {
291  continue;
292  }
293  }
294 
295  if (field->is_repeated()) {
296  int size = reflection->FieldSize(message, field);
297 
298  for (int j = 0; j < size; j++) {
299  if (!reflection->GetRepeatedMessage(message, field, j)
300  .IsInitialized()) {
301  return false;
302  }
303  }
304  } else {
305  if (!reflection->GetMessage(message, field).IsInitialized()) {
306  return false;
307  }
308  }
309  }
310  }
311 
312  return true;
313 }
314 
315 static bool IsMapValueMessageTyped(const FieldDescriptor* map_field) {
316  return map_field->message_type()->field(1)->cpp_type() ==
318 }
319 
321  const Reflection* reflection = GetReflectionOrDie(*message);
322 
323  reflection->MutableUnknownFields(message)->Clear();
324 
325  // Walk through the fields of this message and DiscardUnknownFields on any
326  // messages present.
327  std::vector<const FieldDescriptor*> fields;
328  reflection->ListFields(*message, &fields);
329  for (const FieldDescriptor* field : fields) {
330  // Skip over non-message fields.
331  if (field->cpp_type() != FieldDescriptor::CPPTYPE_MESSAGE) {
332  continue;
333  }
334  // Discard the unknown fields in maps that contain message values.
335  if (field->is_map() && IsMapValueMessageTyped(field)) {
336  const MapFieldBase* map_field =
337  reflection->MutableMapData(message, field);
338  if (map_field->IsMapValid()) {
339  MapIterator iter(message, field);
340  MapIterator end(message, field);
341  for (map_field->MapBegin(&iter), map_field->MapEnd(&end); iter != end;
342  ++iter) {
343  iter.MutableValueRef()->MutableMessageValue()->DiscardUnknownFields();
344  }
345  }
346  // Discard every unknown field inside messages in a repeated field.
347  } else if (field->is_repeated()) {
348  int size = reflection->FieldSize(*message, field);
349  for (int j = 0; j < size; j++) {
350  reflection->MutableRepeatedMessage(message, field, j)
352  }
353  // Discard the unknown fields inside an optional message.
354  } else {
356  }
357  }
358 }
359 
361  const FieldDescriptor* field, int index) {
363  if (field->is_extension()) {
364  result.append("(");
365  result.append(field->full_name());
366  result.append(")");
367  } else {
368  result.append(field->name());
369  }
370  if (index != -1) {
371  result.append("[");
372  result.append(StrCat(index));
373  result.append("]");
374  }
375  result.append(".");
376  return result;
377 }
378 
380  const std::string& prefix,
381  std::vector<std::string>* errors) {
382  const Descriptor* descriptor = message.GetDescriptor();
383  const Reflection* reflection = GetReflectionOrDie(message);
384 
385  // Check required fields of this message.
386  {
387  const int field_count = descriptor->field_count();
388  for (int i = 0; i < field_count; i++) {
389  if (descriptor->field(i)->is_required()) {
390  if (!reflection->HasField(message, descriptor->field(i))) {
391  errors->push_back(prefix + descriptor->field(i)->name());
392  }
393  }
394  }
395  }
396 
397  // Check sub-messages.
398  std::vector<const FieldDescriptor*> fields;
399  reflection->ListFieldsOmitStripped(message, &fields);
400  for (const FieldDescriptor* field : fields) {
401  if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) {
402 
403  if (field->is_repeated()) {
404  int size = reflection->FieldSize(message, field);
405 
406  for (int j = 0; j < size; j++) {
407  const Message& sub_message =
408  reflection->GetRepeatedMessage(message, field, j);
409  FindInitializationErrors(sub_message,
411  }
412  } else {
413  const Message& sub_message = reflection->GetMessage(message, field);
414  FindInitializationErrors(sub_message,
416  }
417  }
418  }
419 }
420 
421 void GenericSwap(Message* lhs, Message* rhs) {
422 #ifndef PROTOBUF_FORCE_COPY_IN_SWAP
423  GOOGLE_DCHECK(Arena::InternalHelper<Message>::GetOwningArena(lhs) !=
424  Arena::InternalHelper<Message>::GetOwningArena(rhs));
425  GOOGLE_DCHECK(Arena::InternalHelper<Message>::GetOwningArena(lhs) != nullptr ||
426  Arena::InternalHelper<Message>::GetOwningArena(rhs) != nullptr);
427 #endif // !PROTOBUF_FORCE_COPY_IN_SWAP
428  // At least one of these must have an arena, so make `rhs` point to it.
429  Arena* arena = Arena::InternalHelper<Message>::GetOwningArena(rhs);
430  if (arena == nullptr) {
431  std::swap(lhs, rhs);
432  arena = Arena::InternalHelper<Message>::GetOwningArena(rhs);
433  }
434 
435  // Improve efficiency by placing the temporary on an arena so that messages
436  // are copied twice rather than three times.
437  Message* tmp = rhs->New(arena);
438  tmp->CheckTypeAndMergeFrom(*lhs);
439  lhs->Clear();
440  lhs->CheckTypeAndMergeFrom(*rhs);
441 #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
442  rhs->Clear();
443  rhs->CheckTypeAndMergeFrom(*tmp);
444  if (arena == nullptr) delete tmp;
445 #else // PROTOBUF_FORCE_COPY_IN_SWAP
446  rhs->GetReflection()->Swap(tmp, rhs);
447 #endif // !PROTOBUF_FORCE_COPY_IN_SWAP
448 }
449 
450 } // namespace internal
451 } // namespace protobuf
452 } // namespace google
453 
454 #include <google/protobuf/port_undef.inc>
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
google::protobuf.internal::GetReflectionOrDie
static const Reflection * GetReflectionOrDie(const Message &m)
Definition: bloaty/third_party/protobuf/src/google/protobuf/reflection_ops.cc:54
regen-readme.it
it
Definition: regen-readme.py:15
google::protobuf::Reflection::MutableMapData
internal::MapFieldBase * MutableMapData(Message *message, const FieldDescriptor *field) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:2212
google::protobuf::FieldDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:515
absl::str_format_internal::LengthMod::j
@ j
testing::internal::Int32
TypeWithSize< 4 >::Int Int32
Definition: bloaty/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:2159
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_DCHECK
#define GOOGLE_DCHECK
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:194
phone_pb2.message_type
message_type
Definition: phone_pb2.py:200
google::protobuf::Message::GetReflection
const Reflection * GetReflection() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/message.h:332
google::protobuf::FieldDescriptor::message_type
const Descriptor * message_type
Definition: protobuf/src/google/protobuf/descriptor.h:936
Arena
Definition: arena.c:39
GOOGLE_CHECK_EQ
#define GOOGLE_CHECK_EQ(A, B)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:156
google::protobuf::Reflection::GetExtensionSet
const internal::ExtensionSet & GetExtensionSet(const Message &message) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:1889
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
google::protobuf::MessageFactory::generated_factory
static MessageFactory * generated_factory()
Definition: bloaty/third_party/protobuf/src/google/protobuf/message.cc:645
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
google::protobuf::Message::CheckTypeAndMergeFrom
void CheckTypeAndMergeFrom(const MessageLite &other) override
Definition: bloaty/third_party/protobuf/src/google/protobuf/message.cc:93
google::protobuf.internal::GenericSwap
void GenericSwap(MessageLite *m1, MessageLite *m2)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:735
google::protobuf::Message::IsInitialized
bool IsInitialized() const override
Definition: bloaty/third_party/protobuf/src/google/protobuf/message.cc:115
to
size_t to
Definition: abseil-cpp/absl/container/internal/layout_test.cc:1385
google::protobuf::Reflection::Swap
void Swap(Message *message1, Message *message2) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:600
testing::internal::UInt32
TypeWithSize< 4 >::UInt UInt32
Definition: bloaty/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:2160
google::protobuf::Reflection
Definition: bloaty/third_party/protobuf/src/google/protobuf/message.h:397
google::protobuf::Reflection::HasField
bool HasField(const Message &message, const FieldDescriptor *field) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:728
google::protobuf::HANDLE_TYPE
HANDLE_TYPE(int32, FieldDescriptor::CPPTYPE_INT32, -1)
google::protobuf::UnknownFieldSet::Clear
void Clear()
Definition: bloaty/third_party/protobuf/src/google/protobuf/unknown_field_set.h:296
message
char * message
Definition: libuv/docs/code/tty-gravity/main.c:12
BOOL
int BOOL
Definition: undname.c:46
google::protobuf::StrCat
string StrCat(const AlphaNum &a, const AlphaNum &b)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/strutil.cc:1482
Enum
Definition: bloaty/third_party/protobuf/src/google/protobuf/type.pb.h:867
Descriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:121
arena
grpc_core::ScopedArenaPtr arena
Definition: binder_transport_test.cc:237
google::protobuf.internal::ReflectionOps::FindInitializationErrors
static void FindInitializationErrors(const Message &message, const std::string &prefix, std::vector< std::string > *errors)
Definition: bloaty/third_party/protobuf/src/google/protobuf/reflection_ops.cc:302
from
size_t from
Definition: abseil-cpp/absl/container/internal/layout_test.cc:1384
google::protobuf.internal::ReflectionOps::Merge
static void Merge(const Message &from, Message *to)
Definition: bloaty/third_party/protobuf/src/google/protobuf/reflection_ops.cc:71
FieldDescriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:133
google::protobuf::Descriptor::field
const FieldDescriptor * field(int index) const
errors
const char * errors
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/tokenizer_unittest.cc:841
end
char * end
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1008
google::protobuf::Reflection::MutableUnknownFields
UnknownFieldSet * MutableUnknownFields(Message *message) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:237
testing::internal::Float
FloatingPoint< float > Float
Definition: bloaty/third_party/googletest/googletest/include/gtest/internal/gtest-internal.h:396
google::protobuf.internal::ReflectionOps::DiscardUnknownFields
static void DiscardUnknownFields(Message *message)
Definition: bloaty/third_party/protobuf/src/google/protobuf/reflection_ops.cc:242
google::protobuf.internal::SubMessagePrefix
static std::string SubMessagePrefix(const std::string &prefix, const FieldDescriptor *field, int index)
Definition: bloaty/third_party/protobuf/src/google/protobuf/reflection_ops.cc:283
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::MapBegin
virtual void MapBegin(MapIterator *map_iter) const =0
google::protobuf.internal::ExtensionSet::IsInitialized
bool IsInitialized() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.cc:1135
google::protobuf::Reflection::ListFieldsOmitStripped
void ListFieldsOmitStripped(const Message &message, std::vector< const FieldDescriptor * > *output) const
Definition: protobuf/src/google/protobuf/generated_message_reflection.cc:1509
google::protobuf::Reflection::FieldSize
int FieldSize(const Message &message, const FieldDescriptor *field) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:744
google::protobuf.internal::MapFieldBase::MapEnd
virtual void MapEnd(MapIterator *map_iter) const =0
google::protobuf::Reflection::MutableMessage
Message * MutableMessage(Message *message, const FieldDescriptor *field, MessageFactory *factory=nullptr) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:1461
google::protobuf::Message::DiscardUnknownFields
virtual void DiscardUnknownFields()
Definition: bloaty/third_party/protobuf/src/google/protobuf/message.cc:135
FATAL
#define FATAL(msg)
Definition: task.h:88
google::protobuf::Message
Definition: bloaty/third_party/protobuf/src/google/protobuf/message.h:205
field
const FieldDescriptor * field
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/parser_unittest.cc:2692
google::protobuf.internal::IsMapValueMessageTyped
static bool IsMapValueMessageTyped(const FieldDescriptor *map_field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/reflection_ops.cc:237
google::protobuf::Reflection::HasExtensionSet
bool HasExtensionSet(const Message &) const
Definition: protobuf/src/google/protobuf/message.h:1141
count
int * count
Definition: bloaty/third_party/googletest/googlemock/test/gmock_stress_test.cc:96
google::protobuf::Reflection::MutableRepeatedMessage
Message * MutableRepeatedMessage(Message *message, const FieldDescriptor *field, int index) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:1616
google::protobuf.internal::MapFieldBase::IsMapValid
bool IsMapValid() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.cc:72
index
int index
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:1184
profile_analyzer.fields
list fields
Definition: profile_analyzer.py:266
fix_build_deps.r
r
Definition: fix_build_deps.py:491
testing::internal::Double
FloatingPoint< double > Double
Definition: bloaty/third_party/googletest/googletest/include/gtest/internal/gtest-internal.h:397
google::protobuf::Message::Clear
void Clear() override
Definition: bloaty/third_party/protobuf/src/google/protobuf/message.cc:113
prefix
static const char prefix[]
Definition: head_of_line_blocking.cc:28
google::protobuf::Descriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:231
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::ReflectionOps::Copy
static void Copy(const Message &from, Message *to)
Definition: bloaty/third_party/protobuf/src/google/protobuf/reflection_ops.cc:65
internal
Definition: benchmark/test/output_test_helper.cc:20
GOOGLE_CHECK_NE
#define GOOGLE_CHECK_NE(A, B)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:157
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::Reflection::GetMapData
const internal::MapFieldBase * GetMapData(const Message &message, const FieldDescriptor *field) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:2219
google::protobuf.internal::ReflectionOps::IsInitialized
static bool IsInitialized(const Message &message)
Definition: bloaty/third_party/protobuf/src/google/protobuf/reflection_ops.cc:176
autogen_x86imm.tmp
tmp
Definition: autogen_x86imm.py:12
size
voidpf void uLong size
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
google::protobuf::MapIterator
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.h:712
regress.m
m
Definition: regress/regress.py:25
GOOGLE_LOG
#define GOOGLE_LOG(LEVEL)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:146
descriptor
static const char descriptor[1336]
Definition: certs.upbdefs.c:16
google::protobuf::Reflection::ListFields
void ListFields(const Message &message, std::vector< const FieldDescriptor * > *output) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:1029
google::protobuf::FieldDescriptor::cpp_type
CppType cpp_type() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:2139
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::ReflectionOps::Clear
static void Clear(Message *message)
Definition: bloaty/third_party/protobuf/src/google/protobuf/reflection_ops.cc:164
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
google::protobuf::Reflection::GetRepeatedMessage
const Message & GetRepeatedMessage(const Message &message, const FieldDescriptor *field, int index) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:1596
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


grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:01