protobuf/python/google/protobuf/pyext/descriptor_pool.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 // Implements the DescriptorPool, which collects all descriptors.
32 
33 #include <unordered_map>
34 
35 #define PY_SSIZE_T_CLEAN
36 #include <Python.h>
37 
38 #include <google/protobuf/descriptor.pb.h>
39 #include <google/protobuf/pyext/descriptor.h>
40 #include <google/protobuf/pyext/descriptor_database.h>
41 #include <google/protobuf/pyext/descriptor_pool.h>
42 #include <google/protobuf/pyext/message.h>
43 #include <google/protobuf/pyext/message_factory.h>
44 #include <google/protobuf/pyext/scoped_pyobject_ptr.h>
45 #include <google/protobuf/stubs/hash.h>
46 
47 #define PyString_AsStringAndSize(ob, charpp, sizep) \
48  (PyUnicode_Check(ob) ? ((*(charpp) = const_cast<char*>( \
49  PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL \
50  ? -1 \
51  : 0) \
52  : PyBytes_AsStringAndSize(ob, (charpp), (sizep)))
53 
54 namespace google {
55 namespace protobuf {
56 namespace python {
57 
58 // A map to cache Python Pools per C++ pointer.
59 // Pointers are not owned here, and belong to the PyDescriptorPool.
60 static std::unordered_map<const DescriptorPool*, PyDescriptorPool*>*
62 
63 namespace cdescriptor_pool {
64 
65 // Collects errors that occur during proto file building to allow them to be
66 // propagated in the python exception instead of only living in ERROR logs.
67 class BuildFileErrorCollector : public DescriptorPool::ErrorCollector {
68  public:
70 
72  const Message* descriptor, ErrorLocation location,
73  const std::string& message) override {
74  // Replicates the logging behavior that happens in the C++ implementation
75  // when an error collector is not passed in.
76  if (!had_errors_) {
77  error_message +=
78  ("Invalid proto descriptor for file \"" + filename + "\":\n");
79  had_errors_ = true;
80  }
81  // As this only happens on failure and will result in the program not
82  // running at all, no effort is made to optimize this string manipulation.
83  error_message += (" " + element_name + ": " + message + "\n");
84  }
85 
86  void Clear() {
87  had_errors_ = false;
88  error_message = "";
89  }
90 
92 
93  private:
94  bool had_errors_;
95 };
96 
97 // Create a Python DescriptorPool object, but does not fill the "pool"
98 // attribute.
100  PyDescriptorPool* cpool = PyObject_GC_New(
102  if (cpool == NULL) {
103  return NULL;
104  }
105 
106  cpool->error_collector = nullptr;
107  cpool->underlay = NULL;
108  cpool->database = NULL;
109  cpool->is_owned = false;
110  cpool->is_mutable = false;
111 
112  cpool->descriptor_options = new std::unordered_map<const void*, PyObject*>();
113 
115  &PyMessageFactory_Type, cpool);
116  if (cpool->py_message_factory == NULL) {
117  Py_DECREF(cpool);
118  return NULL;
119  }
120 
121  PyObject_GC_Track(cpool);
122 
123  return cpool;
124 }
125 
126 // Create a Python DescriptorPool, using the given pool as an underlay:
127 // new messages will be added to a custom pool, not to the underlay.
128 //
129 // Ownership of the underlay is not transferred, its pointer should
130 // stay alive.
132  const DescriptorPool* underlay) {
134  if (cpool == NULL) {
135  return NULL;
136  }
137  cpool->pool = new DescriptorPool(underlay);
138  cpool->is_owned = true;
139  cpool->is_mutable = true;
140  cpool->underlay = underlay;
141 
142  if (!descriptor_pool_map->insert(
143  std::make_pair(cpool->pool, cpool)).second) {
144  // Should never happen -- would indicate an internal error / bug.
145  PyErr_SetString(PyExc_ValueError, "DescriptorPool already registered");
146  return NULL;
147  }
148 
149  return cpool;
150 }
151 
155  if (cpool == NULL) {
156  return NULL;
157  }
158  if (database != NULL) {
160  cpool->pool = new DescriptorPool(database, cpool->error_collector);
161  cpool->is_mutable = false;
162  cpool->database = database;
163  } else {
164  cpool->pool = new DescriptorPool();
165  cpool->is_mutable = true;
166  }
167  cpool->is_owned = true;
168 
169  if (!descriptor_pool_map->insert(std::make_pair(cpool->pool, cpool)).second) {
170  // Should never happen -- would indicate an internal error / bug.
171  PyErr_SetString(PyExc_ValueError, "DescriptorPool already registered");
172  return NULL;
173  }
174 
175  return cpool;
176 }
177 
178 // The public DescriptorPool constructor.
179 static PyObject* New(PyTypeObject* type,
180  PyObject* args, PyObject* kwargs) {
181  static const char* kwlist[] = {"descriptor_db", 0};
182  PyObject* py_database = NULL;
183  if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O",
184  const_cast<char**>(kwlist), &py_database)) {
185  return NULL;
186  }
188  if (py_database && py_database != Py_None) {
189  database = new PyDescriptorDatabase(py_database);
190  }
191  return reinterpret_cast<PyObject*>(
193 }
194 
195 static void Dealloc(PyObject* pself) {
196  PyDescriptorPool* self = reinterpret_cast<PyDescriptorPool*>(pself);
197  descriptor_pool_map->erase(self->pool);
198  Py_CLEAR(self->py_message_factory);
200  self->descriptor_options->begin();
201  it != self->descriptor_options->end(); ++it) {
202  Py_DECREF(it->second);
203  }
204  delete self->descriptor_options;
205  delete self->database;
206  if (self->is_owned) {
207  delete self->pool;
208  }
209  delete self->error_collector;
210  Py_TYPE(self)->tp_free(pself);
211 }
212 
213 static int GcTraverse(PyObject* pself, visitproc visit, void* arg) {
214  PyDescriptorPool* self = reinterpret_cast<PyDescriptorPool*>(pself);
215  Py_VISIT(self->py_message_factory);
216  return 0;
217 }
218 
219 static int GcClear(PyObject* pself) {
220  PyDescriptorPool* self = reinterpret_cast<PyDescriptorPool*>(pself);
221  Py_CLEAR(self->py_message_factory);
222  return 0;
223 }
224 
225 PyObject* SetErrorFromCollector(DescriptorPool::ErrorCollector* self,
226  const char* name, const char* error_type) {
227  BuildFileErrorCollector* error_collector =
228  reinterpret_cast<BuildFileErrorCollector*>(self);
229  if (error_collector && !error_collector->error_message.empty()) {
230  PyErr_Format(PyExc_KeyError, "Couldn't build file for %s %.200s\n%s",
231  error_type, name, error_collector->error_message.c_str());
232  error_collector->Clear();
233  return NULL;
234  }
235  PyErr_Format(PyExc_KeyError, "Couldn't find %s %.200s", error_type, name);
236  return NULL;
237 }
238 
239 static PyObject* FindMessageByName(PyObject* self, PyObject* arg) {
240  Py_ssize_t name_size;
241  char* name;
242  if (PyString_AsStringAndSize(arg, &name, &name_size) < 0) {
243  return NULL;
244  }
245 
246  const Descriptor* message_descriptor =
247  reinterpret_cast<PyDescriptorPool*>(self)->pool->FindMessageTypeByName(
248  StringParam(name, name_size));
249 
250  if (message_descriptor == NULL) {
251  return SetErrorFromCollector(
252  reinterpret_cast<PyDescriptorPool*>(self)->error_collector, name,
253  "message");
254  }
255 
256 
257  return PyMessageDescriptor_FromDescriptor(message_descriptor);
258 }
259 
260 
261 
262 
263 static PyObject* FindFileByName(PyObject* self, PyObject* arg) {
264  Py_ssize_t name_size;
265  char* name;
266  if (PyString_AsStringAndSize(arg, &name, &name_size) < 0) {
267  return NULL;
268  }
269 
270  PyDescriptorPool* py_pool = reinterpret_cast<PyDescriptorPool*>(self);
271  const FileDescriptor* file_descriptor =
272  py_pool->pool->FindFileByName(StringParam(name, name_size));
273 
274  if (file_descriptor == NULL) {
275  return SetErrorFromCollector(py_pool->error_collector, name, "file");
276  }
277  return PyFileDescriptor_FromDescriptor(file_descriptor);
278 }
279 
280 PyObject* FindFieldByName(PyDescriptorPool* self, PyObject* arg) {
281  Py_ssize_t name_size;
282  char* name;
283  if (PyString_AsStringAndSize(arg, &name, &name_size) < 0) {
284  return NULL;
285  }
286 
287  const FieldDescriptor* field_descriptor =
288  self->pool->FindFieldByName(StringParam(name, name_size));
289  if (field_descriptor == NULL) {
290  return SetErrorFromCollector(self->error_collector, name, "field");
291  }
292 
293 
294  return PyFieldDescriptor_FromDescriptor(field_descriptor);
295 }
296 
297 static PyObject* FindFieldByNameMethod(PyObject* self, PyObject* arg) {
298  return FindFieldByName(reinterpret_cast<PyDescriptorPool*>(self), arg);
299 }
300 
301 PyObject* FindExtensionByName(PyDescriptorPool* self, PyObject* arg) {
302  Py_ssize_t name_size;
303  char* name;
304  if (PyString_AsStringAndSize(arg, &name, &name_size) < 0) {
305  return NULL;
306  }
307 
308  const FieldDescriptor* field_descriptor =
309  self->pool->FindExtensionByName(StringParam(name, name_size));
310  if (field_descriptor == NULL) {
311  return SetErrorFromCollector(self->error_collector, name,
312  "extension field");
313  }
314 
315 
316  return PyFieldDescriptor_FromDescriptor(field_descriptor);
317 }
318 
319 static PyObject* FindExtensionByNameMethod(PyObject* self, PyObject* arg) {
320  return FindExtensionByName(reinterpret_cast<PyDescriptorPool*>(self), arg);
321 }
322 
323 PyObject* FindEnumTypeByName(PyDescriptorPool* self, PyObject* arg) {
324  Py_ssize_t name_size;
325  char* name;
326  if (PyString_AsStringAndSize(arg, &name, &name_size) < 0) {
327  return NULL;
328  }
329 
331  self->pool->FindEnumTypeByName(StringParam(name, name_size));
332  if (enum_descriptor == NULL) {
333  return SetErrorFromCollector(self->error_collector, name, "enum");
334  }
335 
336 
338 }
339 
340 static PyObject* FindEnumTypeByNameMethod(PyObject* self, PyObject* arg) {
341  return FindEnumTypeByName(reinterpret_cast<PyDescriptorPool*>(self), arg);
342 }
343 
344 PyObject* FindOneofByName(PyDescriptorPool* self, PyObject* arg) {
345  Py_ssize_t name_size;
346  char* name;
347  if (PyString_AsStringAndSize(arg, &name, &name_size) < 0) {
348  return NULL;
349  }
350 
351  const OneofDescriptor* oneof_descriptor =
352  self->pool->FindOneofByName(StringParam(name, name_size));
353  if (oneof_descriptor == NULL) {
354  return SetErrorFromCollector(self->error_collector, name, "oneof");
355  }
356 
357 
358  return PyOneofDescriptor_FromDescriptor(oneof_descriptor);
359 }
360 
361 static PyObject* FindOneofByNameMethod(PyObject* self, PyObject* arg) {
362  return FindOneofByName(reinterpret_cast<PyDescriptorPool*>(self), arg);
363 }
364 
365 static PyObject* FindServiceByName(PyObject* self, PyObject* arg) {
366  Py_ssize_t name_size;
367  char* name;
368  if (PyString_AsStringAndSize(arg, &name, &name_size) < 0) {
369  return NULL;
370  }
371 
372  const ServiceDescriptor* service_descriptor =
373  reinterpret_cast<PyDescriptorPool*>(self)->pool->FindServiceByName(
374  StringParam(name, name_size));
375  if (service_descriptor == NULL) {
376  return SetErrorFromCollector(
377  reinterpret_cast<PyDescriptorPool*>(self)->error_collector, name,
378  "service");
379  }
380 
381 
382  return PyServiceDescriptor_FromDescriptor(service_descriptor);
383 }
384 
385 static PyObject* FindMethodByName(PyObject* self, PyObject* arg) {
386  Py_ssize_t name_size;
387  char* name;
388  if (PyString_AsStringAndSize(arg, &name, &name_size) < 0) {
389  return NULL;
390  }
391 
392  const MethodDescriptor* method_descriptor =
393  reinterpret_cast<PyDescriptorPool*>(self)->pool->FindMethodByName(
394  StringParam(name, name_size));
395  if (method_descriptor == NULL) {
396  return SetErrorFromCollector(
397  reinterpret_cast<PyDescriptorPool*>(self)->error_collector, name,
398  "method");
399  }
400 
401 
402  return PyMethodDescriptor_FromDescriptor(method_descriptor);
403 }
404 
405 static PyObject* FindFileContainingSymbol(PyObject* self, PyObject* arg) {
406  Py_ssize_t name_size;
407  char* name;
408  if (PyString_AsStringAndSize(arg, &name, &name_size) < 0) {
409  return NULL;
410  }
411 
412  const FileDescriptor* file_descriptor =
413  reinterpret_cast<PyDescriptorPool*>(self)->pool->FindFileContainingSymbol(
414  StringParam(name, name_size));
415  if (file_descriptor == NULL) {
416  return SetErrorFromCollector(
417  reinterpret_cast<PyDescriptorPool*>(self)->error_collector, name,
418  "symbol");
419  }
420 
421 
422  return PyFileDescriptor_FromDescriptor(file_descriptor);
423 }
424 
425 static PyObject* FindExtensionByNumber(PyObject* self, PyObject* args) {
426  PyObject* message_descriptor;
427  int number;
428  if (!PyArg_ParseTuple(args, "Oi", &message_descriptor, &number)) {
429  return NULL;
430  }
432  message_descriptor);
433  if (descriptor == NULL) {
434  return NULL;
435  }
436 
437  const FieldDescriptor* extension_descriptor =
438  reinterpret_cast<PyDescriptorPool*>(self)->pool->FindExtensionByNumber(
439  descriptor, number);
440  if (extension_descriptor == NULL) {
441  BuildFileErrorCollector* error_collector =
442  reinterpret_cast<BuildFileErrorCollector*>(
443  reinterpret_cast<PyDescriptorPool*>(self)->error_collector);
444  if (error_collector && !error_collector->error_message.empty()) {
445  PyErr_Format(PyExc_KeyError, "Couldn't build file for Extension %.d\n%s",
446  number, error_collector->error_message.c_str());
447  error_collector->Clear();
448  return NULL;
449  }
450  PyErr_Format(PyExc_KeyError, "Couldn't find Extension %d", number);
451  return NULL;
452  }
453 
454 
455  return PyFieldDescriptor_FromDescriptor(extension_descriptor);
456 }
457 
458 static PyObject* FindAllExtensions(PyObject* self, PyObject* arg) {
460  if (descriptor == NULL) {
461  return NULL;
462  }
463 
464  std::vector<const FieldDescriptor*> extensions;
465  reinterpret_cast<PyDescriptorPool*>(self)->pool->FindAllExtensions(
467 
468  ScopedPyObjectPtr result(PyList_New(extensions.size()));
469  if (result == NULL) {
470  return NULL;
471  }
472  for (int i = 0; i < extensions.size(); i++) {
474  if (extension == NULL) {
475  return NULL;
476  }
477  PyList_SET_ITEM(result.get(), i, extension); // Steals the reference.
478  }
479  return result.release();
480 }
481 
482 // These functions should not exist -- the only valid way to create
483 // descriptors is to call Add() or AddSerializedFile().
484 // But these AddDescriptor() functions were created in Python and some people
485 // call them, so we support them for now for compatibility.
486 // However we do check that the existing descriptor already exists in the pool,
487 // which appears to always be true for existing calls -- but then why do people
488 // call a function that will just be a no-op?
489 // TODO(amauryfa): Need to investigate further.
490 
491 static PyObject* AddFileDescriptor(PyObject* self, PyObject* descriptor) {
492  const FileDescriptor* file_descriptor =
494  if (!file_descriptor) {
495  return NULL;
496  }
497  if (file_descriptor !=
498  reinterpret_cast<PyDescriptorPool*>(self)->pool->FindFileByName(
499  file_descriptor->name())) {
500  PyErr_Format(PyExc_ValueError,
501  "The file descriptor %s does not belong to this pool",
502  file_descriptor->name().c_str());
503  return NULL;
504  }
505  Py_RETURN_NONE;
506 }
507 
508 static PyObject* AddDescriptor(PyObject* self, PyObject* descriptor) {
509  const Descriptor* message_descriptor =
511  if (!message_descriptor) {
512  return NULL;
513  }
514  if (message_descriptor !=
515  reinterpret_cast<PyDescriptorPool*>(self)->pool->FindMessageTypeByName(
516  message_descriptor->full_name())) {
517  PyErr_Format(PyExc_ValueError,
518  "The message descriptor %s does not belong to this pool",
519  message_descriptor->full_name().c_str());
520  return NULL;
521  }
522  Py_RETURN_NONE;
523 }
524 
525 static PyObject* AddEnumDescriptor(PyObject* self, PyObject* descriptor) {
528  if (!enum_descriptor) {
529  return NULL;
530  }
531  if (enum_descriptor !=
532  reinterpret_cast<PyDescriptorPool*>(self)->pool->FindEnumTypeByName(
533  enum_descriptor->full_name())) {
534  PyErr_Format(PyExc_ValueError,
535  "The enum descriptor %s does not belong to this pool",
536  enum_descriptor->full_name().c_str());
537  return NULL;
538  }
539  Py_RETURN_NONE;
540 }
541 
542 static PyObject* AddExtensionDescriptor(PyObject* self, PyObject* descriptor) {
543  const FieldDescriptor* extension_descriptor =
545  if (!extension_descriptor) {
546  return NULL;
547  }
548  if (extension_descriptor !=
549  reinterpret_cast<PyDescriptorPool*>(self)->pool->FindExtensionByName(
550  extension_descriptor->full_name())) {
551  PyErr_Format(PyExc_ValueError,
552  "The extension descriptor %s does not belong to this pool",
553  extension_descriptor->full_name().c_str());
554  return NULL;
555  }
556  Py_RETURN_NONE;
557 }
558 
559 static PyObject* AddServiceDescriptor(PyObject* self, PyObject* descriptor) {
560  const ServiceDescriptor* service_descriptor =
562  if (!service_descriptor) {
563  return NULL;
564  }
565  if (service_descriptor !=
566  reinterpret_cast<PyDescriptorPool*>(self)->pool->FindServiceByName(
567  service_descriptor->full_name())) {
568  PyErr_Format(PyExc_ValueError,
569  "The service descriptor %s does not belong to this pool",
570  service_descriptor->full_name().c_str());
571  return NULL;
572  }
573  Py_RETURN_NONE;
574 }
575 
576 // The code below loads new Descriptors from a serialized FileDescriptorProto.
577 static PyObject* AddSerializedFile(PyObject* pself, PyObject* serialized_pb) {
578  PyDescriptorPool* self = reinterpret_cast<PyDescriptorPool*>(pself);
579  char* message_type;
580  Py_ssize_t message_len;
581 
582  if (self->database != NULL) {
583  PyErr_SetString(
584  PyExc_ValueError,
585  "Cannot call Add on a DescriptorPool that uses a DescriptorDatabase. "
586  "Add your file to the underlying database.");
587  return NULL;
588  }
589  if (!self->is_mutable) {
590  PyErr_SetString(
591  PyExc_ValueError,
592  "This DescriptorPool is not mutable and cannot add new definitions.");
593  return nullptr;
594  }
595 
596  if (PyBytes_AsStringAndSize(serialized_pb, &message_type, &message_len) < 0) {
597  return NULL;
598  }
599 
600  FileDescriptorProto file_proto;
601  if (!file_proto.ParseFromArray(message_type, message_len)) {
602  PyErr_SetString(PyExc_TypeError, "Couldn't parse file content!");
603  return NULL;
604  }
605 
606  // If the file was already part of a C++ library, all its descriptors are in
607  // the underlying pool. No need to do anything else.
608  const FileDescriptor* generated_file = NULL;
609  if (self->underlay) {
610  generated_file = self->underlay->FindFileByName(file_proto.name());
611  }
612  if (generated_file != NULL) {
614  generated_file, serialized_pb);
615  }
616 
617  BuildFileErrorCollector error_collector;
618  const FileDescriptor* descriptor =
619  // Pool is mutable, we can remove the "const".
620  const_cast<DescriptorPool*>(self->pool)
621  ->BuildFileCollectingErrors(file_proto, &error_collector);
622  if (descriptor == NULL) {
623  PyErr_Format(PyExc_TypeError,
624  "Couldn't build proto file into descriptor pool!\n%s",
625  error_collector.error_message.c_str());
626  return NULL;
627  }
628 
629 
631  descriptor, serialized_pb);
632 }
633 
634 static PyObject* Add(PyObject* self, PyObject* file_descriptor_proto) {
635  ScopedPyObjectPtr serialized_pb(
636  PyObject_CallMethod(file_descriptor_proto, "SerializeToString", NULL));
637  if (serialized_pb == NULL) {
638  return NULL;
639  }
640  return AddSerializedFile(self, serialized_pb.get());
641 }
642 
643 static PyMethodDef Methods[] = {
644  { "Add", Add, METH_O,
645  "Adds the FileDescriptorProto and its types to this pool." },
646  { "AddSerializedFile", AddSerializedFile, METH_O,
647  "Adds a serialized FileDescriptorProto to this pool." },
648 
649  // TODO(amauryfa): Understand why the Python implementation differs from
650  // this one, ask users to use another API and deprecate these functions.
651  { "AddFileDescriptor", AddFileDescriptor, METH_O,
652  "No-op. Add() must have been called before." },
653  { "AddDescriptor", AddDescriptor, METH_O,
654  "No-op. Add() must have been called before." },
655  { "AddEnumDescriptor", AddEnumDescriptor, METH_O,
656  "No-op. Add() must have been called before." },
657  { "AddExtensionDescriptor", AddExtensionDescriptor, METH_O,
658  "No-op. Add() must have been called before." },
659  { "AddServiceDescriptor", AddServiceDescriptor, METH_O,
660  "No-op. Add() must have been called before." },
661 
662  { "FindFileByName", FindFileByName, METH_O,
663  "Searches for a file descriptor by its .proto name." },
664  { "FindMessageTypeByName", FindMessageByName, METH_O,
665  "Searches for a message descriptor by full name." },
666  { "FindFieldByName", FindFieldByNameMethod, METH_O,
667  "Searches for a field descriptor by full name." },
668  { "FindExtensionByName", FindExtensionByNameMethod, METH_O,
669  "Searches for extension descriptor by full name." },
670  { "FindEnumTypeByName", FindEnumTypeByNameMethod, METH_O,
671  "Searches for enum type descriptor by full name." },
672  { "FindOneofByName", FindOneofByNameMethod, METH_O,
673  "Searches for oneof descriptor by full name." },
674  { "FindServiceByName", FindServiceByName, METH_O,
675  "Searches for service descriptor by full name." },
676  { "FindMethodByName", FindMethodByName, METH_O,
677  "Searches for method descriptor by full name." },
678 
679  { "FindFileContainingSymbol", FindFileContainingSymbol, METH_O,
680  "Gets the FileDescriptor containing the specified symbol." },
681  { "FindExtensionByNumber", FindExtensionByNumber, METH_VARARGS,
682  "Gets the extension descriptor for the given number." },
683  { "FindAllExtensions", FindAllExtensions, METH_O,
684  "Gets all known extensions of the given message descriptor." },
685  {NULL}
686 };
687 
688 } // namespace cdescriptor_pool
689 
690 PyTypeObject PyDescriptorPool_Type = {
691  PyVarObject_HEAD_INIT(&PyType_Type, 0) FULL_MODULE_NAME
692  ".DescriptorPool", // tp_name
693  sizeof(PyDescriptorPool), // tp_basicsize
694  0, // tp_itemsize
695  cdescriptor_pool::Dealloc, // tp_dealloc
696  0, // tp_print
697  0, // tp_getattr
698  0, // tp_setattr
699  0, // tp_compare
700  0, // tp_repr
701  0, // tp_as_number
702  0, // tp_as_sequence
703  0, // tp_as_mapping
704  0, // tp_hash
705  0, // tp_call
706  0, // tp_str
707  0, // tp_getattro
708  0, // tp_setattro
709  0, // tp_as_buffer
710  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, // tp_flags
711  "A Descriptor Pool", // tp_doc
712  cdescriptor_pool::GcTraverse, // tp_traverse
713  cdescriptor_pool::GcClear, // tp_clear
714  0, // tp_richcompare
715  0, // tp_weaklistoffset
716  0, // tp_iter
717  0, // tp_iternext
718  cdescriptor_pool::Methods, // tp_methods
719  0, // tp_members
720  0, // tp_getset
721  0, // tp_base
722  0, // tp_dict
723  0, // tp_descr_get
724  0, // tp_descr_set
725  0, // tp_dictoffset
726  0, // tp_init
727  0, // tp_alloc
728  cdescriptor_pool::New, // tp_new
729  PyObject_GC_Del, // tp_free
730 };
731 
732 // This is the DescriptorPool which contains all the definitions from the
733 // generated _pb2.py modules.
735 
736 bool InitDescriptorPool() {
737  if (PyType_Ready(&PyDescriptorPool_Type) < 0)
738  return false;
739 
740  // The Pool of messages declared in Python libraries.
741  // generated_pool() contains all messages already linked in C++ libraries, and
742  // is used as underlay.
744  new std::unordered_map<const DescriptorPool*, PyDescriptorPool*>;
747  if (python_generated_pool == NULL) {
748  delete descriptor_pool_map;
749  return false;
750  }
751 
752  // Register this pool to be found for C++-generated descriptors.
753  descriptor_pool_map->insert(
754  std::make_pair(DescriptorPool::generated_pool(),
756 
757  return true;
758 }
759 
760 // The default DescriptorPool used everywhere in this module.
761 // Today it's the python_generated_pool.
762 // TODO(amauryfa): Remove all usages of this function: the pool should be
763 // derived from the context.
765  return python_generated_pool;
766 }
767 
769  // Fast path for standard descriptors.
770  if (pool == python_generated_pool->pool ||
772  return python_generated_pool;
773  }
775  descriptor_pool_map->find(pool);
776  if (it == descriptor_pool_map->end()) {
777  PyErr_SetString(PyExc_KeyError, "Unknown descriptor pool");
778  return NULL;
779  }
780  return it->second;
781 }
782 
785  if (existing_pool != nullptr) {
786  Py_INCREF(existing_pool);
787  return reinterpret_cast<PyObject*>(existing_pool);
788  } else {
789  PyErr_Clear();
790  }
791 
793  if (cpool == nullptr) {
794  return nullptr;
795  }
796  cpool->pool = const_cast<DescriptorPool*>(pool);
797  cpool->is_owned = false;
798  cpool->is_mutable = false;
799  cpool->underlay = nullptr;
800 
801  if (!descriptor_pool_map->insert(std::make_pair(cpool->pool, cpool)).second) {
802  // Should never happen -- We already checked the existence above.
803  PyErr_SetString(PyExc_ValueError, "DescriptorPool already registered");
804  return nullptr;
805  }
806 
807  return reinterpret_cast<PyObject*>(cpool);
808 }
809 
810 } // namespace python
811 } // namespace protobuf
812 } // namespace google
google::protobuf::Descriptor::full_name
const std::string & full_name() const
FileDescriptorProto::name
const std::string & name() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:7321
google::protobuf::python::cdescriptor_pool::FindEnumTypeByName
PyObject * FindEnumTypeByName(PyDescriptorPool *self, PyObject *arg)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:318
google::protobuf::python::cdescriptor_pool::AddEnumDescriptor
static PyObject * AddEnumDescriptor(PyObject *self, PyObject *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:520
google::protobuf::DescriptorPool::FindFileByName
const FileDescriptor * FindFileByName(const std::string &name) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.cc:1369
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
google::protobuf::python::cdescriptor_pool::BuildFileErrorCollector::AddError
void AddError(const std::string &filename, const std::string &element_name, const Message *descriptor, ErrorLocation location, const std::string &message) override
Definition: protobuf/python/google/protobuf/pyext/descriptor_pool.cc:71
google::protobuf::python::cdescriptor_pool::_CreateDescriptorPool
static PyDescriptorPool * _CreateDescriptorPool()
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:104
filename
const char * filename
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:135
google::protobuf::python::cdescriptor_pool::FindOneofByName
PyObject * FindOneofByName(PyDescriptorPool *self, PyObject *arg)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:339
regen-readme.it
it
Definition: regen-readme.py:15
google::protobuf::FieldDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:515
google::protobuf::python::cdescriptor_pool::FindMessageByName
static PyObject * FindMessageByName(PyObject *self, PyObject *arg)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:234
google::protobuf::extension
const Descriptor::ReservedRange const EnumValueDescriptor const MethodDescriptor extension
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:2001
google::protobuf::python::cdescriptor_pool::FindFileByName
static PyObject * FindFileByName(PyObject *self, PyObject *arg)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:258
element_name
std::string element_name
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.cc:3096
google::protobuf::FieldDescriptor::full_name
const std::string & full_name() const
false
#define false
Definition: setup_once.h:323
google::protobuf::python::PyServiceDescriptor_FromDescriptor
PyObject * PyServiceDescriptor_FromDescriptor(const ServiceDescriptor *service_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1765
google::protobuf::python::GetDefaultDescriptorPool
PyDescriptorPool * GetDefaultDescriptorPool()
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:751
phone_pb2.message_type
message_type
Definition: phone_pb2.py:200
google::protobuf::python::ScopedPythonPtr::get
PyObjectStruct * get() const
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/scoped_pyobject_ptr.h:76
google::protobuf::ServiceDescriptor::full_name
const std::string & full_name() const
google::protobuf::python::PyFieldDescriptor_AsDescriptor
const FieldDescriptor * PyFieldDescriptor_AsDescriptor(PyObject *obj)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1043
google::protobuf::python::PyMethodDescriptor_FromDescriptor
PyObject * PyMethodDescriptor_FromDescriptor(const MethodDescriptor *method_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1877
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
google::protobuf::python::PyDescriptorPool
struct google::protobuf::python::PyDescriptorPool PyDescriptorPool
google::protobuf::python::cdescriptor_pool::FindEnumTypeByNameMethod
static PyObject * FindEnumTypeByNameMethod(PyObject *self, PyObject *arg)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:335
google::protobuf::python::cdescriptor_pool::AddServiceDescriptor
static PyObject * AddServiceDescriptor(PyObject *self, PyObject *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:554
New
T * New(Args &&... args)
Definition: third_party/boringssl-with-bazel/src/ssl/internal.h:195
google::protobuf
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:12
google::protobuf::OneofDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:843
setup.name
name
Definition: setup.py:542
FULL_MODULE_NAME
#define FULL_MODULE_NAME
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.h:331
grpc::protobuf::DescriptorPool
GRPC_CUSTOM_DESCRIPTORPOOL DescriptorPool
Definition: include/grpcpp/impl/codegen/config_protobuf.h:82
google::protobuf::python::PyDescriptorPool_FromPool
PyObject * PyDescriptorPool_FromPool(const DescriptorPool *pool)
Definition: protobuf/python/google/protobuf/pyext/descriptor_pool.cc:783
google::protobuf::python::cdescriptor_pool::Add
static PyObject * Add(PyObject *self, PyObject *file_descriptor_proto)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:621
google::protobuf::python::cdescriptor_pool::PyDescriptorPool_NewWithDatabase
static PyDescriptorPool * PyDescriptorPool_NewWithDatabase(DescriptorDatabase *database)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:153
google::protobuf::python::ScopedPythonPtr
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/scoped_pyobject_ptr.h:46
google::protobuf::python::PyDescriptorPool
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.h:56
iterator
const typedef MCPhysReg * iterator
Definition: MCRegisterInfo.h:27
message
char * message
Definition: libuv/docs/code/tty-gravity/main.c:12
google::protobuf::python::cdescriptor_pool::FindServiceByName
static PyObject * FindServiceByName(PyObject *self, PyObject *arg)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:360
google::protobuf::python::cdescriptor_pool::AddSerializedFile
static PyObject * AddSerializedFile(PyObject *pself, PyObject *serialized_pb)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:572
google::protobuf::python::PyEnumDescriptor_FromDescriptor
PyObject * PyEnumDescriptor_FromDescriptor(const EnumDescriptor *enum_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1192
google::protobuf::python::PyFieldDescriptor_FromDescriptor
PyObject * PyFieldDescriptor_FromDescriptor(const FieldDescriptor *field_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1037
google::protobuf::python::PyMessageDescriptor_FromDescriptor
PyObject * PyMessageDescriptor_FromDescriptor(const Descriptor *message_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:722
google::protobuf::python::cdescriptor_pool::AddFileDescriptor
static PyObject * AddFileDescriptor(PyObject *self, PyObject *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:486
google::protobuf::python::cdescriptor_pool::GcClear
static int GcClear(PyObject *pself)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:214
google::protobuf::ServiceDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1152
google::protobuf::python::cdescriptor_pool::FindFileContainingSymbol
static PyObject * FindFileContainingSymbol(PyObject *self, PyObject *arg)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:400
google::protobuf::python::python_generated_pool
static PyDescriptorPool * python_generated_pool
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:721
google::protobuf::python::cdescriptor_pool::FindExtensionByNameMethod
static PyObject * FindExtensionByNameMethod(PyObject *self, PyObject *arg)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:314
google::protobuf::python::cdescriptor_pool::FindExtensionByNumber
static PyObject * FindExtensionByNumber(PyObject *self, PyObject *args)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:420
google::protobuf::python::GetDescriptorPool_FromPool
PyDescriptorPool * GetDescriptorPool_FromPool(const DescriptorPool *pool)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:755
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
google::protobuf::python::PyMessageDescriptor_AsDescriptor
const Descriptor * PyMessageDescriptor_AsDescriptor(PyObject *obj)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:728
google::protobuf::python::cdescriptor_pool::FindFieldByName
PyObject * FindFieldByName(PyDescriptorPool *self, PyObject *arg)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:275
google::protobuf::python::cdescriptor_pool::FindFieldByNameMethod
static PyObject * FindFieldByNameMethod(PyObject *self, PyObject *arg)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:292
google::protobuf::python::cdescriptor_pool::FindExtensionByName
PyObject * FindExtensionByName(PyDescriptorPool *self, PyObject *arg)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:296
PyString_AsStringAndSize
#define PyString_AsStringAndSize(ob, charpp, sizep)
Definition: protobuf/python/google/protobuf/pyext/descriptor_pool.cc:47
google::protobuf::python::PyDescriptorPool::py_message_factory
PyMessageFactory * py_message_factory
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.h:77
google::protobuf::python::cdescriptor_pool::New
static PyObject * New(PyTypeObject *type, PyObject *args, PyObject *kwargs)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:177
google::protobuf::DescriptorPool::ErrorCollector::ErrorLocation
ErrorLocation
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1638
google::protobuf::python::cdescriptor_pool::SetErrorFromCollector
PyObject * SetErrorFromCollector(DescriptorPool::ErrorCollector *self, char *name, char *error_type)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:220
google::protobuf::DescriptorPool
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1539
arg
Definition: cmdline.cc:40
number
int32_t number
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:850
google::protobuf::python::PyDescriptorDatabase
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_database.h:42
database
database
Definition: benchmark/.ycm_extra_conf.py:35
google::protobuf::python::cdescriptor_pool::AddDescriptor
static PyObject * AddDescriptor(PyObject *self, PyObject *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:503
conf.extensions
list extensions
Definition: doc/python/sphinx/conf.py:54
google::protobuf::python::cdescriptor_pool::Methods
static PyMethodDef Methods[]
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:630
google::protobuf::python::cdescriptor_pool::FindOneofByNameMethod
static PyObject * FindOneofByNameMethod(PyObject *self, PyObject *arg)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:356
FileDescriptorProto
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:501
google::protobuf::python::cdescriptor_pool::BuildFileErrorCollector::Clear
void Clear()
Definition: protobuf/python/google/protobuf/pyext/descriptor_pool.cc:86
google::protobuf::python::PyDescriptorPool::is_mutable
bool is_mutable
Definition: protobuf/python/google/protobuf/pyext/descriptor_pool.h:68
google::protobuf::python::cdescriptor_pool::GcTraverse
static int GcTraverse(PyObject *pself, visitproc visit, void *arg)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:208
google::protobuf::python::PyMessageFactory_Type
PyTypeObject PyMessageFactory_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message_factory.cc:251
google::protobuf::MethodDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1234
google::protobuf::DescriptorDatabase
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor_database.h:71
google::protobuf::python::PyDescriptorPool::is_owned
bool is_owned
Definition: protobuf/python/google/protobuf/pyext/descriptor_pool.h:64
google::protobuf::python::cdescriptor_pool::BuildFileErrorCollector::error_message
string error_message
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:96
google::protobuf::python::PyDescriptorPool_Type
PyTypeObject PyDescriptorPool_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:677
google::protobuf::python::PyFileDescriptor_FromDescriptor
PyObject * PyFileDescriptor_FromDescriptor(const FileDescriptor *file_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1496
google::protobuf::python::PyDescriptorPool::descriptor_options
std::unordered_map< const void *, PyObject * > * descriptor_options
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.h:82
google::protobuf::FileDescriptor::name
const std::string & name() const
google::protobuf::python::PyDescriptorPool::underlay
const DescriptorPool * underlay
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.h:68
google::protobuf::Message
Definition: bloaty/third_party/protobuf/src/google/protobuf/message.h:205
google::protobuf::python::PyFileDescriptor_AsDescriptor
const FileDescriptor * PyFileDescriptor_AsDescriptor(PyObject *obj)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1522
google::protobuf::python::PyOneofDescriptor_FromDescriptor
PyObject * PyOneofDescriptor_FromDescriptor(const OneofDescriptor *oneof_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1647
google::protobuf::python::descriptor_pool_map
static std::unordered_map< const DescriptorPool *, PyDescriptorPool * > * descriptor_pool_map
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:66
google::protobuf::python::PyDescriptorPool::database
const DescriptorDatabase * database
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.h:72
google::protobuf::python::cdescriptor_pool::PyDescriptorPool_NewWithUnderlay
static PyDescriptorPool * PyDescriptorPool_NewWithUnderlay(const DescriptorPool *underlay)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:134
google::protobuf::python::message_factory::NewMessageFactory
PyMessageFactory * NewMessageFactory(PyTypeObject *type, PyDescriptorPool *pool)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message_factory.cc:59
google::protobuf::python::PyEnumDescriptor_AsDescriptor
const EnumDescriptor * PyEnumDescriptor_AsDescriptor(PyObject *obj)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1198
google::protobuf::python::PyFileDescriptor_FromDescriptorWithSerializedPb
PyObject * PyFileDescriptor_FromDescriptorWithSerializedPb(const FileDescriptor *file_descriptor, PyObject *serialized_pb)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1502
google::protobuf::python::InitDescriptorPool
bool InitDescriptorPool()
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:723
google::protobuf::python::cdescriptor_pool::BuildFileErrorCollector::error_message
std::string error_message
Definition: protobuf/python/google/protobuf/pyext/descriptor_pool.cc:91
google::protobuf::python::PyServiceDescriptor_AsDescriptor
const ServiceDescriptor * PyServiceDescriptor_AsDescriptor(PyObject *obj)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1771
google::protobuf::python::PyDescriptorPool::pool
PyObject_HEAD DescriptorPool * pool
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.h:60
google::protobuf::DescriptorPool::generated_pool
static const DescriptorPool * generated_pool()
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.cc:1326
google::protobuf::python::StringParam
std::string StringParam
Definition: protobuf/python/google/protobuf/pyext/descriptor.h:46
A
Definition: miscompile_with_no_unique_address_test.cc:23
google::protobuf::python::cdescriptor_pool::FindAllExtensions
static PyObject * FindAllExtensions(PyObject *self, PyObject *arg)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:453
google::protobuf::Descriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:231
google::protobuf::python::PyDescriptorPool::error_collector
DescriptorPool::ErrorCollector * error_collector
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.h:64
google::protobuf::python::cdescriptor_pool::AddExtensionDescriptor
static PyObject * AddExtensionDescriptor(PyObject *self, PyObject *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:537
pool
InternalDescriptorPool * pool
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:807
google::protobuf::FileDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1320
PyVarObject_HEAD_INIT
#define PyVarObject_HEAD_INIT(type, size)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:161
google::protobuf::python::cdescriptor_pool::BuildFileErrorCollector::had_errors_
bool had_errors_
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:99
Py_TYPE
#define Py_TYPE(ob)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:164
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
absl::visit
variant_internal::VisitResult< Visitor, Variants... > visit(Visitor &&vis, Variants &&... vars)
Definition: abseil-cpp/absl/types/variant.h:430
google::protobuf::python::cdescriptor_pool::Dealloc
static void Dealloc(PyObject *pself)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:192
google::protobuf::python::cdescriptor_pool::BuildFileErrorCollector::BuildFileErrorCollector
BuildFileErrorCollector()
Definition: protobuf/python/google/protobuf/pyext/descriptor_pool.cc:69
self
PHP_PROTO_OBJECT_FREE_END PHP_PROTO_OBJECT_DTOR_END intern self
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/map.c:543
google::protobuf::EnumDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:918
DescriptorPool
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:110
enum_descriptor
VALUE enum_descriptor(VALUE self)
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/message.c:794
descriptor
static const char descriptor[1336]
Definition: certs.upbdefs.c:16
google
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:11
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
google::protobuf::python::cdescriptor_pool::BuildFileErrorCollector
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:72
google::protobuf::python::cdescriptor_pool::FindMethodByName
static PyObject * FindMethodByName(PyObject *self, PyObject *arg)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:380


grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:15