protobuf/python/google/protobuf/pyext/descriptor_containers.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 // Mappings and Sequences of descriptors.
32 // Used by Descriptor.fields_by_name, EnumDescriptor.values...
33 //
34 // They avoid the allocation of a full dictionary or a full list: they simply
35 // store a pointer to the parent descriptor, use the C++ Descriptor methods (see
36 // net/proto2/public/descriptor.h) to retrieve other descriptors, and create
37 // Python objects on the fly.
38 //
39 // The containers fully conform to abc.Mapping and abc.Sequence, and behave just
40 // like read-only dictionaries and lists.
41 //
42 // Because the interface of C++ Descriptors is quite regular, this file actually
43 // defines only three types, the exact behavior of a container is controlled by
44 // a DescriptorContainerDef structure, which contains functions that uses the
45 // public Descriptor API.
46 //
47 // Note: This DescriptorContainerDef is similar to the "virtual methods table"
48 // that a C++ compiler generates for a class. We have to make it explicit
49 // because the Python API is based on C, and does not play well with C++
50 // inheritance.
51 
52 #define PY_SSIZE_T_CLEAN
53 #include <Python.h>
54 
55 #include <google/protobuf/descriptor.h>
56 #include <google/protobuf/pyext/descriptor_containers.h>
57 #include <google/protobuf/pyext/descriptor_pool.h>
58 #include <google/protobuf/pyext/descriptor.h>
59 #include <google/protobuf/pyext/scoped_pyobject_ptr.h>
60 
61 #define PyString_AsStringAndSize(ob, charpp, sizep) \
62  (PyUnicode_Check(ob) ? ((*(charpp) = const_cast<char*>( \
63  PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL \
64  ? -1 \
65  : 0) \
66  : PyBytes_AsStringAndSize(ob, (charpp), (sizep)))
67 
68 namespace google {
69 namespace protobuf {
70 namespace python {
71 
72 struct PyContainer;
73 
74 typedef int (*CountMethod)(PyContainer* self);
75 typedef const void* (*GetByIndexMethod)(PyContainer* self, int index);
76 typedef const void* (*GetByNameMethod)(PyContainer* self,
78 typedef const void* (*GetByCamelcaseNameMethod)(PyContainer* self,
80 typedef const void* (*GetByNumberMethod)(PyContainer* self, int index);
81 typedef PyObject* (*NewObjectFromItemMethod)(const void* descriptor);
82 typedef const std::string& (*GetItemNameMethod)(const void* descriptor);
83 typedef const std::string& (*GetItemCamelcaseNameMethod)(
84  const void* descriptor);
85 typedef int (*GetItemNumberMethod)(const void* descriptor);
86 typedef int (*GetItemIndexMethod)(const void* descriptor);
87 
88 struct DescriptorContainerDef {
89  const char* mapping_name;
90  // Returns the number of items in the container.
92  // Retrieve item by index (usually the order of declaration in the proto file)
93  // Used by sequences, but also iterators. 0 <= index < Count().
95  // Retrieve item by name (usually a call to some 'FindByName' method).
96  // Used by "by_name" mappings.
98  // Retrieve item by camelcase name (usually a call to some
99  // 'FindByCamelcaseName' method). Used by "by_camelcase_name" mappings.
101  // Retrieve item by declared number (field tag, or enum value).
102  // Used by "by_number" mappings.
104  // Converts a item C++ descriptor to a Python object. Returns a new reference.
106  // Retrieve the name of an item. Used by iterators on "by_name" mappings.
108  // Retrieve the camelcase name of an item. Used by iterators on
109  // "by_camelcase_name" mappings.
111  // Retrieve the number of an item. Used by iterators on "by_number" mappings.
113  // Retrieve the index of an item for the container type.
114  // Used by "__contains__".
115  // If not set, "x in sequence" will do a linear search.
117 };
118 
119 struct PyContainer {
120  PyObject_HEAD
121 
122  // The proto2 descriptor this container belongs to the global DescriptorPool.
123  const void* descriptor;
124 
125  // A pointer to a static structure with function pointers that control the
126  // behavior of the container. Very similar to the table of virtual functions
127  // of a C++ class.
128  const DescriptorContainerDef* container_def;
129 
130  // The kind of container: list, or dict by name or value.
133  KIND_BYNAME,
136  } kind;
137 };
138 
139 struct PyContainerIterator {
140  PyObject_HEAD
141 
142  // The container we are iterating over. Own a reference.
143  PyContainer* container;
144 
145  // The current index in the iterator.
146  int index;
147 
148  // The kind of container: list, or dict by name or value.
149  enum IterKind {
150  KIND_ITERKEY,
153  KIND_ITERVALUE_REVERSED, // For sequences
154  } kind;
155 };
156 
157 namespace descriptor {
158 
159 // Returns the C++ item descriptor for a given Python key.
160 // When the descriptor is found, return true and set *item.
161 // When the descriptor is not found, return true, but set *item to NULL.
162 // On error, returns false with an exception set.
163 static bool _GetItemByKey(PyContainer* self, PyObject* key, const void** item) {
164  switch (self->kind) {
166  {
167  char* name;
168  Py_ssize_t name_size;
169  if (PyString_AsStringAndSize(key, &name, &name_size) < 0) {
170  if (PyErr_ExceptionMatches(PyExc_TypeError)) {
171  // Not a string, cannot be in the container.
172  PyErr_Clear();
173  *item = NULL;
174  return true;
175  }
176  return false;
177  }
178  *item = self->container_def->get_by_name_fn(
179  self, StringParam(name, name_size));
180  return true;
181  }
183  {
184  char* camelcase_name;
185  Py_ssize_t name_size;
186  if (PyString_AsStringAndSize(key, &camelcase_name, &name_size) < 0) {
187  if (PyErr_ExceptionMatches(PyExc_TypeError)) {
188  // Not a string, cannot be in the container.
189  PyErr_Clear();
190  *item = NULL;
191  return true;
192  }
193  return false;
194  }
195  *item = self->container_def->get_by_camelcase_name_fn(
196  self, StringParam(camelcase_name, name_size));
197  return true;
198  }
200  {
201  Py_ssize_t number = PyNumber_AsSsize_t(key, NULL);
202  if (number == -1 && PyErr_Occurred()) {
203  if (PyErr_ExceptionMatches(PyExc_TypeError)) {
204  // Not a number, cannot be in the container.
205  PyErr_Clear();
206  *item = NULL;
207  return true;
208  }
209  return false;
210  }
211  *item = self->container_def->get_by_number_fn(self, number);
212  return true;
213  }
214  default:
215  PyErr_SetNone(PyExc_NotImplementedError);
216  return false;
217  }
218 }
219 
220 // Returns the key of the object at the given index.
221 // Used when iterating over mappings.
222 static PyObject* _NewKey_ByIndex(PyContainer* self, Py_ssize_t index) {
223  const void* item = self->container_def->get_by_index_fn(self, index);
224  switch (self->kind) {
226  {
227  const std::string& name(self->container_def->get_item_name_fn(item));
228  return PyUnicode_FromStringAndSize(name.c_str(), name.size());
229  }
231  {
232  const std::string& name(
233  self->container_def->get_item_camelcase_name_fn(item));
234  return PyUnicode_FromStringAndSize(name.c_str(), name.size());
235  }
237  {
238  int value = self->container_def->get_item_number_fn(item);
239  return PyLong_FromLong(value);
240  }
241  default:
242  PyErr_SetNone(PyExc_NotImplementedError);
243  return NULL;
244  }
245 }
246 
247 // Returns the object at the given index.
248 // Also used when iterating over mappings.
249 static PyObject* _NewObj_ByIndex(PyContainer* self, Py_ssize_t index) {
250  return self->container_def->new_object_from_item_fn(
251  self->container_def->get_by_index_fn(self, index));
252 }
253 
254 static Py_ssize_t Length(PyContainer* self) {
255  return self->container_def->count_fn(self);
256 }
257 
258 // The DescriptorMapping type.
259 
260 static PyObject* Subscript(PyContainer* self, PyObject* key) {
261  const void* item = NULL;
262  if (!_GetItemByKey(self, key, &item)) {
263  return NULL;
264  }
265  if (!item) {
266  PyErr_SetObject(PyExc_KeyError, key);
267  return NULL;
268  }
269  return self->container_def->new_object_from_item_fn(item);
270 }
271 
272 static int AssSubscript(PyContainer* self, PyObject* key, PyObject* value) {
273  if (_CalledFromGeneratedFile(0)) {
274  return 0;
275  }
276  PyErr_Format(PyExc_TypeError,
277  "'%.200s' object does not support item assignment",
278  Py_TYPE(self)->tp_name);
279  return -1;
280 }
281 
282 static PyMappingMethods MappingMappingMethods = {
283  (lenfunc)Length, // mp_length
284  (binaryfunc)Subscript, // mp_subscript
285  (objobjargproc)AssSubscript, // mp_ass_subscript
286 };
287 
288 static int Contains(PyContainer* self, PyObject* key) {
289  const void* item = NULL;
290  if (!_GetItemByKey(self, key, &item)) {
291  return -1;
292  }
293  if (item) {
294  return 1;
295  } else {
296  return 0;
297  }
298 }
299 
300 static PyObject* ContainerRepr(PyContainer* self) {
301  const char* kind = "";
302  switch (self->kind) {
304  kind = "sequence";
305  break;
307  kind = "mapping by name";
308  break;
310  kind = "mapping by camelCase name";
311  break;
313  kind = "mapping by number";
314  break;
315  }
316  return PyUnicode_FromFormat("<%s %s>", self->container_def->mapping_name,
317  kind);
318 }
319 
320 extern PyTypeObject DescriptorMapping_Type;
321 extern PyTypeObject DescriptorSequence_Type;
322 
323 // A sequence container can only be equal to another sequence container, or (for
324 // backward compatibility) to a list containing the same items.
325 // Returns 1 if equal, 0 if unequal, -1 on error.
326 static int DescriptorSequence_Equal(PyContainer* self, PyObject* other) {
327  // Check the identity of C++ pointers.
328  if (PyObject_TypeCheck(other, &DescriptorSequence_Type)) {
329  PyContainer* other_container = reinterpret_cast<PyContainer*>(other);
330  if (self->descriptor == other_container->descriptor &&
331  self->container_def == other_container->container_def &&
332  self->kind == other_container->kind) {
333  return 1;
334  } else {
335  return 0;
336  }
337  }
338 
339  // If other is a list
340  if (PyList_Check(other)) {
341  // return list(self) == other
342  int size = Length(self);
343  if (size != PyList_Size(other)) {
344  return false;
345  }
346  for (int index = 0; index < size; index++) {
347  ScopedPyObjectPtr value1(_NewObj_ByIndex(self, index));
348  if (value1 == NULL) {
349  return -1;
350  }
351  PyObject* value2 = PyList_GetItem(other, index);
352  if (value2 == NULL) {
353  return -1;
354  }
355  int cmp = PyObject_RichCompareBool(value1.get(), value2, Py_EQ);
356  if (cmp != 1) // error or not equal
357  return cmp;
358  }
359  // All items were found and equal
360  return 1;
361  }
362 
363  // Any other object is different.
364  return 0;
365 }
366 
367 // A mapping container can only be equal to another mapping container, or (for
368 // backward compatibility) to a dict containing the same items.
369 // Returns 1 if equal, 0 if unequal, -1 on error.
370 static int DescriptorMapping_Equal(PyContainer* self, PyObject* other) {
371  // Check the identity of C++ pointers.
372  if (PyObject_TypeCheck(other, &DescriptorMapping_Type)) {
373  PyContainer* other_container = reinterpret_cast<PyContainer*>(other);
374  if (self->descriptor == other_container->descriptor &&
375  self->container_def == other_container->container_def &&
376  self->kind == other_container->kind) {
377  return 1;
378  } else {
379  return 0;
380  }
381  }
382 
383  // If other is a dict
384  if (PyDict_Check(other)) {
385  // equivalent to dict(self.items()) == other
386  int size = Length(self);
387  if (size != PyDict_Size(other)) {
388  return false;
389  }
390  for (int index = 0; index < size; index++) {
392  if (key == NULL) {
393  return -1;
394  }
395  ScopedPyObjectPtr value1(_NewObj_ByIndex(self, index));
396  if (value1 == NULL) {
397  return -1;
398  }
399  PyObject* value2 = PyDict_GetItem(other, key.get());
400  if (value2 == NULL) {
401  // Not found in the other dictionary
402  return 0;
403  }
404  int cmp = PyObject_RichCompareBool(value1.get(), value2, Py_EQ);
405  if (cmp != 1) // error or not equal
406  return cmp;
407  }
408  // All items were found and equal
409  return 1;
410  }
411 
412  // Any other object is different.
413  return 0;
414 }
415 
416 static PyObject* RichCompare(PyContainer* self, PyObject* other, int opid) {
417  if (opid != Py_EQ && opid != Py_NE) {
418  Py_INCREF(Py_NotImplemented);
419  return Py_NotImplemented;
420  }
421 
422  int result;
423 
424  if (self->kind == PyContainer::KIND_SEQUENCE) {
425  result = DescriptorSequence_Equal(self, other);
426  } else {
427  result = DescriptorMapping_Equal(self, other);
428  }
429  if (result < 0) {
430  return NULL;
431  }
432  if (result ^ (opid == Py_NE)) {
433  Py_RETURN_TRUE;
434  } else {
435  Py_RETURN_FALSE;
436  }
437 }
438 
439 static PySequenceMethods MappingSequenceMethods = {
440  0, // sq_length
441  0, // sq_concat
442  0, // sq_repeat
443  0, // sq_item
444  0, // sq_slice
445  0, // sq_ass_item
446  0, // sq_ass_slice
447  (objobjproc)Contains, // sq_contains
448 };
449 
450 static PyObject* Get(PyContainer* self, PyObject* args) {
451  PyObject* key;
452  PyObject* default_value = Py_None;
453  if (!PyArg_UnpackTuple(args, "get", 1, 2, &key, &default_value)) {
454  return NULL;
455  }
456 
457  const void* item;
458  if (!_GetItemByKey(self, key, &item)) {
459  return NULL;
460  }
461  if (item == NULL) {
462  Py_INCREF(default_value);
463  return default_value;
464  }
465  return self->container_def->new_object_from_item_fn(item);
466 }
467 
468 static PyObject* Keys(PyContainer* self, PyObject* args) {
469  Py_ssize_t count = Length(self);
470  ScopedPyObjectPtr list(PyList_New(count));
471  if (list == NULL) {
472  return NULL;
473  }
474  for (Py_ssize_t index = 0; index < count; ++index) {
475  PyObject* key = _NewKey_ByIndex(self, index);
476  if (key == NULL) {
477  return NULL;
478  }
479  PyList_SET_ITEM(list.get(), index, key);
480  }
481  return list.release();
482 }
483 
484 static PyObject* Values(PyContainer* self, PyObject* args) {
485  Py_ssize_t count = Length(self);
486  ScopedPyObjectPtr list(PyList_New(count));
487  if (list == NULL) {
488  return NULL;
489  }
490  for (Py_ssize_t index = 0; index < count; ++index) {
491  PyObject* value = _NewObj_ByIndex(self, index);
492  if (value == NULL) {
493  return NULL;
494  }
495  PyList_SET_ITEM(list.get(), index, value);
496  }
497  return list.release();
498 }
499 
500 static PyObject* Items(PyContainer* self, PyObject* args) {
501  Py_ssize_t count = Length(self);
502  ScopedPyObjectPtr list(PyList_New(count));
503  if (list == NULL) {
504  return NULL;
505  }
506  for (Py_ssize_t index = 0; index < count; ++index) {
507  ScopedPyObjectPtr obj(PyTuple_New(2));
508  if (obj == NULL) {
509  return NULL;
510  }
511  PyObject* key = _NewKey_ByIndex(self, index);
512  if (key == NULL) {
513  return NULL;
514  }
515  PyTuple_SET_ITEM(obj.get(), 0, key);
516  PyObject* value = _NewObj_ByIndex(self, index);
517  if (value == NULL) {
518  return NULL;
519  }
520  PyTuple_SET_ITEM(obj.get(), 1, value);
521  PyList_SET_ITEM(list.get(), index, obj.release());
522  }
523  return list.release();
524 }
525 
526 static PyObject* NewContainerIterator(PyContainer* mapping,
528 
529 static PyObject* Iter(PyContainer* self) {
531 }
532 static PyObject* IterKeys(PyContainer* self, PyObject* args) {
534 }
535 static PyObject* IterValues(PyContainer* self, PyObject* args) {
537 }
538 static PyObject* IterItems(PyContainer* self, PyObject* args) {
540 }
541 
542 static PyMethodDef MappingMethods[] = {
543  { "get", (PyCFunction)Get, METH_VARARGS, },
544  { "keys", (PyCFunction)Keys, METH_NOARGS, },
545  { "values", (PyCFunction)Values, METH_NOARGS, },
546  { "items", (PyCFunction)Items, METH_NOARGS, },
547  { "iterkeys", (PyCFunction)IterKeys, METH_NOARGS, },
548  { "itervalues", (PyCFunction)IterValues, METH_NOARGS, },
549  { "iteritems", (PyCFunction)IterItems, METH_NOARGS, },
550  {NULL}
551 };
552 
553 PyTypeObject DescriptorMapping_Type = {
554  PyVarObject_HEAD_INIT(&PyType_Type, 0)
555  "DescriptorMapping", // tp_name
556  sizeof(PyContainer), // tp_basicsize
557  0, // tp_itemsize
558  0, // tp_dealloc
559  0, // tp_print
560  0, // tp_getattr
561  0, // tp_setattr
562  0, // tp_compare
563  (reprfunc)ContainerRepr, // tp_repr
564  0, // tp_as_number
565  &MappingSequenceMethods, // tp_as_sequence
566  &MappingMappingMethods, // tp_as_mapping
567  0, // tp_hash
568  0, // tp_call
569  0, // tp_str
570  0, // tp_getattro
571  0, // tp_setattro
572  0, // tp_as_buffer
573  Py_TPFLAGS_DEFAULT, // tp_flags
574  0, // tp_doc
575  0, // tp_traverse
576  0, // tp_clear
577  (richcmpfunc)RichCompare, // tp_richcompare
578  0, // tp_weaklistoffset
579  (getiterfunc)Iter, // tp_iter
580  0, // tp_iternext
581  MappingMethods, // tp_methods
582  0, // tp_members
583  0, // tp_getset
584  0, // tp_base
585  0, // tp_dict
586  0, // tp_descr_get
587  0, // tp_descr_set
588  0, // tp_dictoffset
589  0, // tp_init
590  0, // tp_alloc
591  0, // tp_new
592  0, // tp_free
593 };
594 
595 // The DescriptorSequence type.
596 
597 static PyObject* GetItem(PyContainer* self, Py_ssize_t index) {
598  if (index < 0) {
599  index += Length(self);
600  }
601  if (index < 0 || index >= Length(self)) {
602  PyErr_SetString(PyExc_IndexError, "index out of range");
603  return NULL;
604  }
605  return _NewObj_ByIndex(self, index);
606 }
607 
608 static PyObject *
609 SeqSubscript(PyContainer* self, PyObject* item) {
610  if (PyIndex_Check(item)) {
611  Py_ssize_t index;
612  index = PyNumber_AsSsize_t(item, PyExc_IndexError);
613  if (index == -1 && PyErr_Occurred())
614  return NULL;
615  return GetItem(self, index);
616  }
617  // Materialize the list and delegate the operation to it.
618  ScopedPyObjectPtr list(PyObject_CallFunctionObjArgs(
619  reinterpret_cast<PyObject*>(&PyList_Type), self, NULL));
620  if (list == NULL) {
621  return NULL;
622  }
623  return Py_TYPE(list.get())->tp_as_mapping->mp_subscript(list.get(), item);
624 }
625 
626 // Returns the position of the item in the sequence, of -1 if not found.
627 // This function never fails.
628 int Find(PyContainer* self, PyObject* item) {
629  // The item can only be in one position: item.index.
630  // Check that self[item.index] == item, it's faster than a linear search.
631  //
632  // This assumes that sequences are only defined by syntax of the .proto file:
633  // a specific item belongs to only one sequence, depending on its position in
634  // the .proto file definition.
635  const void* descriptor_ptr = PyDescriptor_AsVoidPtr(item);
636  if (descriptor_ptr == NULL) {
637  PyErr_Clear();
638  // Not a descriptor, it cannot be in the list.
639  return -1;
640  }
641  if (self->container_def->get_item_index_fn) {
642  int index = self->container_def->get_item_index_fn(descriptor_ptr);
643  if (index < 0 || index >= Length(self)) {
644  // This index is not from this collection.
645  return -1;
646  }
647  if (self->container_def->get_by_index_fn(self, index) != descriptor_ptr) {
648  // The descriptor at this index is not the same.
649  return -1;
650  }
651  // self[item.index] == item, so return the index.
652  return index;
653  } else {
654  // Fall back to linear search.
655  int length = Length(self);
656  for (int index=0; index < length; index++) {
657  if (self->container_def->get_by_index_fn(self, index) == descriptor_ptr) {
658  return index;
659  }
660  }
661  // Not found
662  return -1;
663  }
664 }
665 
666 // Implements list.index(): the position of the item is in the sequence.
667 static PyObject* Index(PyContainer* self, PyObject* item) {
668  int position = Find(self, item);
669  if (position < 0) {
670  // Not found
671  PyErr_SetNone(PyExc_ValueError);
672  return NULL;
673  } else {
674  return PyLong_FromLong(position);
675  }
676 }
677 // Implements "list.__contains__()": is the object in the sequence.
678 static int SeqContains(PyContainer* self, PyObject* item) {
679  int position = Find(self, item);
680  if (position < 0) {
681  return 0;
682  } else {
683  return 1;
684  }
685 }
686 
687 // Implements list.count(): number of occurrences of the item in the sequence.
688 // An item can only appear once in a sequence. If it exists, return 1.
689 static PyObject* Count(PyContainer* self, PyObject* item) {
690  int position = Find(self, item);
691  if (position < 0) {
692  return PyLong_FromLong(0);
693  } else {
694  return PyLong_FromLong(1);
695  }
696 }
697 
698 static PyObject* Append(PyContainer* self, PyObject* args) {
699  if (_CalledFromGeneratedFile(0)) {
700  Py_RETURN_NONE;
701  }
702  PyErr_Format(PyExc_TypeError,
703  "'%.200s' object is not a mutable sequence",
704  Py_TYPE(self)->tp_name);
705  return NULL;
706 }
707 
708 static PyObject* Reversed(PyContainer* self, PyObject* args) {
709  return NewContainerIterator(self,
711 }
712 
713 static PyMethodDef SeqMethods[] = {
714  { "index", (PyCFunction)Index, METH_O, },
715  { "count", (PyCFunction)Count, METH_O, },
716  { "append", (PyCFunction)Append, METH_O, },
717  { "__reversed__", (PyCFunction)Reversed, METH_NOARGS, },
718  {NULL}
719 };
720 
721 static PySequenceMethods SeqSequenceMethods = {
722  (lenfunc)Length, // sq_length
723  0, // sq_concat
724  0, // sq_repeat
725  (ssizeargfunc)GetItem, // sq_item
726  0, // sq_slice
727  0, // sq_ass_item
728  0, // sq_ass_slice
729  (objobjproc)SeqContains, // sq_contains
730 };
731 
732 static PyMappingMethods SeqMappingMethods = {
733  (lenfunc)Length, // mp_length
734  (binaryfunc)SeqSubscript, // mp_subscript
735  0, // mp_ass_subscript
736 };
737 
738 PyTypeObject DescriptorSequence_Type = {
739  PyVarObject_HEAD_INIT(&PyType_Type, 0)
740  "DescriptorSequence", // tp_name
741  sizeof(PyContainer), // tp_basicsize
742  0, // tp_itemsize
743  0, // tp_dealloc
744  0, // tp_print
745  0, // tp_getattr
746  0, // tp_setattr
747  0, // tp_compare
748  (reprfunc)ContainerRepr, // tp_repr
749  0, // tp_as_number
750  &SeqSequenceMethods, // tp_as_sequence
751  &SeqMappingMethods, // tp_as_mapping
752  0, // tp_hash
753  0, // tp_call
754  0, // tp_str
755  0, // tp_getattro
756  0, // tp_setattro
757  0, // tp_as_buffer
758  Py_TPFLAGS_DEFAULT, // tp_flags
759  0, // tp_doc
760  0, // tp_traverse
761  0, // tp_clear
762  (richcmpfunc)RichCompare, // tp_richcompare
763  0, // tp_weaklistoffset
764  0, // tp_iter
765  0, // tp_iternext
766  SeqMethods, // tp_methods
767  0, // tp_members
768  0, // tp_getset
769  0, // tp_base
770  0, // tp_dict
771  0, // tp_descr_get
772  0, // tp_descr_set
773  0, // tp_dictoffset
774  0, // tp_init
775  0, // tp_alloc
776  0, // tp_new
777  0, // tp_free
778 };
779 
780 static PyObject* NewMappingByName(
781  DescriptorContainerDef* container_def, const void* descriptor) {
782  PyContainer* self = PyObject_New(PyContainer, &DescriptorMapping_Type);
783  if (self == NULL) {
784  return NULL;
785  }
786  self->descriptor = descriptor;
787  self->container_def = container_def;
788  self->kind = PyContainer::KIND_BYNAME;
789  return reinterpret_cast<PyObject*>(self);
790 }
791 
792 static PyObject* NewMappingByCamelcaseName(
793  DescriptorContainerDef* container_def, const void* descriptor) {
794  PyContainer* self = PyObject_New(PyContainer, &DescriptorMapping_Type);
795  if (self == NULL) {
796  return NULL;
797  }
798  self->descriptor = descriptor;
799  self->container_def = container_def;
801  return reinterpret_cast<PyObject*>(self);
802 }
803 
804 static PyObject* NewMappingByNumber(
805  DescriptorContainerDef* container_def, const void* descriptor) {
806  if (container_def->get_by_number_fn == NULL ||
807  container_def->get_item_number_fn == NULL) {
808  PyErr_SetNone(PyExc_NotImplementedError);
809  return NULL;
810  }
811  PyContainer* self = PyObject_New(PyContainer, &DescriptorMapping_Type);
812  if (self == NULL) {
813  return NULL;
814  }
815  self->descriptor = descriptor;
816  self->container_def = container_def;
817  self->kind = PyContainer::KIND_BYNUMBER;
818  return reinterpret_cast<PyObject*>(self);
819 }
820 
821 static PyObject* NewSequence(
822  DescriptorContainerDef* container_def, const void* descriptor) {
823  PyContainer* self = PyObject_New(PyContainer, &DescriptorSequence_Type);
824  if (self == NULL) {
825  return NULL;
826  }
827  self->descriptor = descriptor;
828  self->container_def = container_def;
829  self->kind = PyContainer::KIND_SEQUENCE;
830  return reinterpret_cast<PyObject*>(self);
831 }
832 
833 // Implement iterators over PyContainers.
834 
836  Py_CLEAR(self->container);
837  Py_TYPE(self)->tp_free(reinterpret_cast<PyObject*>(self));
838 }
839 
840 static PyObject* Iterator_Next(PyContainerIterator* self) {
841  int count = self->container->container_def->count_fn(self->container);
842  if (self->index >= count) {
843  // Return NULL with no exception to indicate the end.
844  return NULL;
845  }
846  int index = self->index;
847  self->index += 1;
848  switch (self->kind) {
850  return _NewKey_ByIndex(self->container, index);
852  return _NewObj_ByIndex(self->container, index);
854  return _NewObj_ByIndex(self->container, count - index - 1);
856  {
857  PyObject* obj = PyTuple_New(2);
858  if (obj == NULL) {
859  return NULL;
860  }
861  PyObject* key = _NewKey_ByIndex(self->container, index);
862  if (key == NULL) {
863  Py_DECREF(obj);
864  return NULL;
865  }
866  PyTuple_SET_ITEM(obj, 0, key);
867  PyObject* value = _NewObj_ByIndex(self->container, index);
868  if (value == NULL) {
869  Py_DECREF(obj);
870  return NULL;
871  }
872  PyTuple_SET_ITEM(obj, 1, value);
873  return obj;
874  }
875  default:
876  PyErr_SetNone(PyExc_NotImplementedError);
877  return NULL;
878  }
879 }
880 
881 static PyTypeObject ContainerIterator_Type = {
882  PyVarObject_HEAD_INIT(&PyType_Type, 0)
883  "DescriptorContainerIterator", // tp_name
884  sizeof(PyContainerIterator), // tp_basicsize
885  0, // tp_itemsize
886  (destructor)Iterator_Dealloc, // tp_dealloc
887  0, // tp_print
888  0, // tp_getattr
889  0, // tp_setattr
890  0, // tp_compare
891  0, // tp_repr
892  0, // tp_as_number
893  0, // tp_as_sequence
894  0, // tp_as_mapping
895  0, // tp_hash
896  0, // tp_call
897  0, // tp_str
898  0, // tp_getattro
899  0, // tp_setattro
900  0, // tp_as_buffer
901  Py_TPFLAGS_DEFAULT, // tp_flags
902  0, // tp_doc
903  0, // tp_traverse
904  0, // tp_clear
905  0, // tp_richcompare
906  0, // tp_weaklistoffset
907  PyObject_SelfIter, // tp_iter
908  (iternextfunc)Iterator_Next, // tp_iternext
909  0, // tp_methods
910  0, // tp_members
911  0, // tp_getset
912  0, // tp_base
913  0, // tp_dict
914  0, // tp_descr_get
915  0, // tp_descr_set
916  0, // tp_dictoffset
917  0, // tp_init
918  0, // tp_alloc
919  0, // tp_new
920  0, // tp_free
921 };
922 
925  PyContainerIterator* self = PyObject_New(PyContainerIterator,
927  if (self == NULL) {
928  return NULL;
929  }
930  Py_INCREF(container);
931  self->container = container;
932  self->kind = kind;
933  self->index = 0;
934 
935  return reinterpret_cast<PyObject*>(self);
936 }
937 
938 } // namespace descriptor
939 
940 // Now define the real collections!
941 
942 namespace message_descriptor {
943 
944 typedef const Descriptor* ParentDescriptor;
945 
947  return reinterpret_cast<ParentDescriptor>(self->descriptor);
948 }
949 
950 namespace fields {
951 
952 typedef const FieldDescriptor* ItemDescriptor;
953 
954 static int Count(PyContainer* self) {
955  return GetDescriptor(self)->field_count();
956 }
957 
958 static const void* GetByName(PyContainer* self, ConstStringParam name) {
959  return GetDescriptor(self)->FindFieldByName(name);
960 }
961 
962 static const void* GetByCamelcaseName(PyContainer* self,
964  return GetDescriptor(self)->FindFieldByCamelcaseName(name);
965 }
966 
967 static const void* GetByNumber(PyContainer* self, int number) {
968  return GetDescriptor(self)->FindFieldByNumber(number);
969 }
970 
971 static const void* GetByIndex(PyContainer* self, int index) {
972  return GetDescriptor(self)->field(index);
973 }
974 
975 static PyObject* NewObjectFromItem(const void* item) {
976  return PyFieldDescriptor_FromDescriptor(static_cast<ItemDescriptor>(item));
977 }
978 
979 static const std::string& GetItemName(const void* item) {
980  return static_cast<ItemDescriptor>(item)->name();
981 }
982 
983 static const std::string& GetItemCamelcaseName(const void* item) {
984  return static_cast<ItemDescriptor>(item)->camelcase_name();
985 }
986 
987 static int GetItemNumber(const void* item) {
988  return static_cast<ItemDescriptor>(item)->number();
989 }
990 
991 static int GetItemIndex(const void* item) {
992  return static_cast<ItemDescriptor>(item)->index();
993 }
994 
996  "MessageFields",
997  Count,
998  GetByIndex,
999  GetByName,
1001  GetByNumber,
1003  GetItemName,
1005  GetItemNumber,
1006  GetItemIndex,
1007 };
1008 
1009 } // namespace fields
1010 
1013 }
1014 
1017  descriptor);
1018 }
1019 
1022 }
1023 
1026 }
1027 
1028 namespace nested_types {
1029 
1030 typedef const Descriptor* ItemDescriptor;
1031 
1032 static int Count(PyContainer* self) {
1033  return GetDescriptor(self)->nested_type_count();
1034 }
1035 
1036 static const void* GetByName(PyContainer* self, ConstStringParam name) {
1037  return GetDescriptor(self)->FindNestedTypeByName(name);
1038 }
1039 
1040 static const void* GetByIndex(PyContainer* self, int index) {
1041  return GetDescriptor(self)->nested_type(index);
1042 }
1043 
1044 static PyObject* NewObjectFromItem(const void* item) {
1045  return PyMessageDescriptor_FromDescriptor(static_cast<ItemDescriptor>(item));
1046 }
1047 
1048 static const std::string& GetItemName(const void* item) {
1049  return static_cast<ItemDescriptor>(item)->name();
1050 }
1051 
1052 static int GetItemIndex(const void* item) {
1053  return static_cast<ItemDescriptor>(item)->index();
1054 }
1055 
1057  "MessageNestedTypes",
1058  Count,
1059  GetByIndex,
1060  GetByName,
1061  NULL,
1062  NULL,
1064  GetItemName,
1065  NULL,
1066  NULL,
1067  GetItemIndex,
1068 };
1069 
1070 } // namespace nested_types
1071 
1074 }
1075 
1078 }
1079 
1080 namespace enums {
1081 
1082 typedef const EnumDescriptor* ItemDescriptor;
1083 
1084 static int Count(PyContainer* self) {
1085  return GetDescriptor(self)->enum_type_count();
1086 }
1087 
1088 static const void* GetByName(PyContainer* self, ConstStringParam name) {
1089  return GetDescriptor(self)->FindEnumTypeByName(name);
1090 }
1091 
1092 static const void* GetByIndex(PyContainer* self, int index) {
1093  return GetDescriptor(self)->enum_type(index);
1094 }
1095 
1096 static PyObject* NewObjectFromItem(const void* item) {
1097  return PyEnumDescriptor_FromDescriptor(static_cast<ItemDescriptor>(item));
1098 }
1099 
1100 static const std::string& GetItemName(const void* item) {
1101  return static_cast<ItemDescriptor>(item)->name();
1102 }
1103 
1104 static int GetItemIndex(const void* item) {
1105  return static_cast<ItemDescriptor>(item)->index();
1106 }
1107 
1109  "MessageNestedEnums",
1110  Count,
1111  GetByIndex,
1112  GetByName,
1113  NULL,
1114  NULL,
1116  GetItemName,
1117  NULL,
1118  NULL,
1119  GetItemIndex,
1120 };
1121 
1122 } // namespace enums
1123 
1126 }
1127 
1130 }
1131 
1132 namespace enumvalues {
1133 
1134 // This is the "enum_values_by_name" mapping, which collects values from all
1135 // enum types in a message.
1136 //
1137 // Note that the behavior of the C++ descriptor is different: it will search and
1138 // return the first value that matches the name, whereas the Python
1139 // implementation retrieves the last one.
1140 
1141 typedef const EnumValueDescriptor* ItemDescriptor;
1142 
1143 static int Count(PyContainer* self) {
1144  int count = 0;
1145  for (int i = 0; i < GetDescriptor(self)->enum_type_count(); ++i) {
1146  count += GetDescriptor(self)->enum_type(i)->value_count();
1147  }
1148  return count;
1149 }
1150 
1151 static const void* GetByName(PyContainer* self, ConstStringParam name) {
1152  return GetDescriptor(self)->FindEnumValueByName(name);
1153 }
1154 
1155 static const void* GetByIndex(PyContainer* self, int index) {
1156  // This is not optimal, but the number of enums *types* in a given message
1157  // is small. This function is only used when iterating over the mapping.
1158  const EnumDescriptor* enum_type = NULL;
1159  int enum_type_count = GetDescriptor(self)->enum_type_count();
1160  for (int i = 0; i < enum_type_count; ++i) {
1161  enum_type = GetDescriptor(self)->enum_type(i);
1162  int enum_value_count = enum_type->value_count();
1163  if (index < enum_value_count) {
1164  // Found it!
1165  break;
1166  }
1167  index -= enum_value_count;
1168  }
1169  // The next statement cannot overflow, because this function is only called by
1170  // internal iterators which ensure that 0 <= index < Count().
1171  return enum_type->value(index);
1172 }
1173 
1174 static PyObject* NewObjectFromItem(const void* item) {
1176  static_cast<ItemDescriptor>(item));
1177 }
1178 
1179 static const std::string& GetItemName(const void* item) {
1180  return static_cast<ItemDescriptor>(item)->name();
1181 }
1182 
1184  "MessageEnumValues",
1185  Count,
1186  GetByIndex,
1187  GetByName,
1188  NULL,
1189  NULL,
1191  GetItemName,
1192  NULL,
1193  NULL,
1194  NULL,
1195 };
1196 
1197 } // namespace enumvalues
1198 
1201 }
1202 
1203 namespace extensions {
1204 
1205 typedef const FieldDescriptor* ItemDescriptor;
1206 
1207 static int Count(PyContainer* self) {
1208  return GetDescriptor(self)->extension_count();
1209 }
1210 
1211 static const void* GetByName(PyContainer* self, ConstStringParam name) {
1212  return GetDescriptor(self)->FindExtensionByName(name);
1213 }
1214 
1215 static const void* GetByIndex(PyContainer* self, int index) {
1216  return GetDescriptor(self)->extension(index);
1217 }
1218 
1219 static PyObject* NewObjectFromItem(const void* item) {
1220  return PyFieldDescriptor_FromDescriptor(static_cast<ItemDescriptor>(item));
1221 }
1222 
1223 static const std::string& GetItemName(const void* item) {
1224  return static_cast<ItemDescriptor>(item)->name();
1225 }
1226 
1227 static int GetItemIndex(const void* item) {
1228  return static_cast<ItemDescriptor>(item)->index();
1229 }
1230 
1232  "MessageExtensions",
1233  Count,
1234  GetByIndex,
1235  GetByName,
1236  NULL,
1237  NULL,
1239  GetItemName,
1240  NULL,
1241  NULL,
1242  GetItemIndex,
1243 };
1244 
1245 } // namespace extensions
1246 
1249 }
1250 
1253 }
1254 
1255 namespace oneofs {
1256 
1257 typedef const OneofDescriptor* ItemDescriptor;
1258 
1259 static int Count(PyContainer* self) {
1260  return GetDescriptor(self)->oneof_decl_count();
1261 }
1262 
1263 static const void* GetByName(PyContainer* self, ConstStringParam name) {
1264  return GetDescriptor(self)->FindOneofByName(name);
1265 }
1266 
1267 static const void* GetByIndex(PyContainer* self, int index) {
1268  return GetDescriptor(self)->oneof_decl(index);
1269 }
1270 
1271 static PyObject* NewObjectFromItem(const void* item) {
1272  return PyOneofDescriptor_FromDescriptor(static_cast<ItemDescriptor>(item));
1273 }
1274 
1275 static const std::string& GetItemName(const void* item) {
1276  return static_cast<ItemDescriptor>(item)->name();
1277 }
1278 
1279 static int GetItemIndex(const void* item) {
1280  return static_cast<ItemDescriptor>(item)->index();
1281 }
1282 
1284  "MessageOneofs",
1285  Count,
1286  GetByIndex,
1287  GetByName,
1288  NULL,
1289  NULL,
1291  GetItemName,
1292  NULL,
1293  NULL,
1294  GetItemIndex,
1295 };
1296 
1297 } // namespace oneofs
1298 
1301 }
1302 
1305 }
1306 
1307 } // namespace message_descriptor
1308 
1309 namespace enum_descriptor {
1310 
1311 typedef const EnumDescriptor* ParentDescriptor;
1312 
1314  return reinterpret_cast<ParentDescriptor>(self->descriptor);
1315 }
1316 
1317 namespace enumvalues {
1318 
1319 typedef const EnumValueDescriptor* ItemDescriptor;
1320 
1321 static int Count(PyContainer* self) {
1322  return GetDescriptor(self)->value_count();
1323 }
1324 
1325 static const void* GetByIndex(PyContainer* self, int index) {
1326  return GetDescriptor(self)->value(index);
1327 }
1328 
1329 static const void* GetByName(PyContainer* self, ConstStringParam name) {
1330  return GetDescriptor(self)->FindValueByName(name);
1331 }
1332 
1333 static const void* GetByNumber(PyContainer* self, int number) {
1334  return GetDescriptor(self)->FindValueByNumber(number);
1335 }
1336 
1337 static PyObject* NewObjectFromItem(const void* item) {
1339  static_cast<ItemDescriptor>(item));
1340 }
1341 
1342 static const std::string& GetItemName(const void* item) {
1343  return static_cast<ItemDescriptor>(item)->name();
1344 }
1345 
1346 static int GetItemNumber(const void* item) {
1347  return static_cast<ItemDescriptor>(item)->number();
1348 }
1349 
1350 static int GetItemIndex(const void* item) {
1351  return static_cast<ItemDescriptor>(item)->index();
1352 }
1353 
1355  "EnumValues",
1356  Count,
1357  GetByIndex,
1358  GetByName,
1359  NULL,
1360  GetByNumber,
1362  GetItemName,
1363  NULL,
1364  GetItemNumber,
1365  GetItemIndex,
1366 };
1367 
1368 } // namespace enumvalues
1369 
1372 }
1373 
1376 }
1377 
1380 }
1381 
1382 } // namespace enum_descriptor
1383 
1384 namespace oneof_descriptor {
1385 
1386 typedef const OneofDescriptor* ParentDescriptor;
1387 
1389  return reinterpret_cast<ParentDescriptor>(self->descriptor);
1390 }
1391 
1392 namespace fields {
1393 
1394 typedef const FieldDescriptor* ItemDescriptor;
1395 
1396 static int Count(PyContainer* self) {
1397  return GetDescriptor(self)->field_count();
1398 }
1399 
1400 static const void* GetByIndex(PyContainer* self, int index) {
1401  return GetDescriptor(self)->field(index);
1402 }
1403 
1404 static PyObject* NewObjectFromItem(const void* item) {
1405  return PyFieldDescriptor_FromDescriptor(static_cast<ItemDescriptor>(item));
1406 }
1407 
1408 static int GetItemIndex(const void* item) {
1409  return static_cast<ItemDescriptor>(item)->index_in_oneof();
1410 }
1411 
1413  "OneofFields",
1414  Count,
1415  GetByIndex,
1416  NULL,
1417  NULL,
1418  NULL,
1420  NULL,
1421  NULL,
1422  NULL,
1423  GetItemIndex,
1424 };
1425 
1426 } // namespace fields
1427 
1430 }
1431 
1432 } // namespace oneof_descriptor
1433 
1434 namespace service_descriptor {
1435 
1436 typedef const ServiceDescriptor* ParentDescriptor;
1437 
1439  return reinterpret_cast<ParentDescriptor>(self->descriptor);
1440 }
1441 
1442 namespace methods {
1443 
1444 typedef const MethodDescriptor* ItemDescriptor;
1445 
1446 static int Count(PyContainer* self) {
1447  return GetDescriptor(self)->method_count();
1448 }
1449 
1450 static const void* GetByName(PyContainer* self, ConstStringParam name) {
1451  return GetDescriptor(self)->FindMethodByName(name);
1452 }
1453 
1454 static const void* GetByIndex(PyContainer* self, int index) {
1455  return GetDescriptor(self)->method(index);
1456 }
1457 
1458 static PyObject* NewObjectFromItem(const void* item) {
1459  return PyMethodDescriptor_FromDescriptor(static_cast<ItemDescriptor>(item));
1460 }
1461 
1462 static const std::string& GetItemName(const void* item) {
1463  return static_cast<ItemDescriptor>(item)->name();
1464 }
1465 
1466 static int GetItemIndex(const void* item) {
1467  return static_cast<ItemDescriptor>(item)->index();
1468 }
1469 
1471  "ServiceMethods",
1472  Count,
1473  GetByIndex,
1474  GetByName,
1475  NULL,
1476  NULL,
1478  GetItemName,
1479  NULL,
1480  NULL,
1481  GetItemIndex,
1482 };
1483 
1484 } // namespace methods
1485 
1488 }
1489 
1492 }
1493 
1494 } // namespace service_descriptor
1495 
1496 namespace file_descriptor {
1497 
1498 typedef const FileDescriptor* ParentDescriptor;
1499 
1501  return reinterpret_cast<ParentDescriptor>(self->descriptor);
1502 }
1503 
1504 namespace messages {
1505 
1506 typedef const Descriptor* ItemDescriptor;
1507 
1508 static int Count(PyContainer* self) {
1509  return GetDescriptor(self)->message_type_count();
1510 }
1511 
1512 static const void* GetByName(PyContainer* self, ConstStringParam name) {
1513  return GetDescriptor(self)->FindMessageTypeByName(name);
1514 }
1515 
1516 static const void* GetByIndex(PyContainer* self, int index) {
1517  return GetDescriptor(self)->message_type(index);
1518 }
1519 
1520 static PyObject* NewObjectFromItem(const void* item) {
1521  return PyMessageDescriptor_FromDescriptor(static_cast<ItemDescriptor>(item));
1522 }
1523 
1524 static const std::string& GetItemName(const void* item) {
1525  return static_cast<ItemDescriptor>(item)->name();
1526 }
1527 
1528 static int GetItemIndex(const void* item) {
1529  return static_cast<ItemDescriptor>(item)->index();
1530 }
1531 
1533  "FileMessages",
1534  Count,
1535  GetByIndex,
1536  GetByName,
1537  NULL,
1538  NULL,
1540  GetItemName,
1541  NULL,
1542  NULL,
1543  GetItemIndex,
1544 };
1545 
1546 } // namespace messages
1547 
1550 }
1551 
1552 namespace enums {
1553 
1554 typedef const EnumDescriptor* ItemDescriptor;
1555 
1556 static int Count(PyContainer* self) {
1557  return GetDescriptor(self)->enum_type_count();
1558 }
1559 
1560 static const void* GetByName(PyContainer* self, ConstStringParam name) {
1561  return GetDescriptor(self)->FindEnumTypeByName(name);
1562 }
1563 
1564 static const void* GetByIndex(PyContainer* self, int index) {
1565  return GetDescriptor(self)->enum_type(index);
1566 }
1567 
1568 static PyObject* NewObjectFromItem(const void* item) {
1569  return PyEnumDescriptor_FromDescriptor(static_cast<ItemDescriptor>(item));
1570 }
1571 
1572 static const std::string& GetItemName(const void* item) {
1573  return static_cast<ItemDescriptor>(item)->name();
1574 }
1575 
1576 static int GetItemIndex(const void* item) {
1577  return static_cast<ItemDescriptor>(item)->index();
1578 }
1579 
1581  "FileEnums",
1582  Count,
1583  GetByIndex,
1584  GetByName,
1585  NULL,
1586  NULL,
1588  GetItemName,
1589  NULL,
1590  NULL,
1591  GetItemIndex,
1592 };
1593 
1594 } // namespace enums
1595 
1598 }
1599 
1600 namespace extensions {
1601 
1602 typedef const FieldDescriptor* ItemDescriptor;
1603 
1604 static int Count(PyContainer* self) {
1605  return GetDescriptor(self)->extension_count();
1606 }
1607 
1608 static const void* GetByName(PyContainer* self, ConstStringParam name) {
1609  return GetDescriptor(self)->FindExtensionByName(name);
1610 }
1611 
1612 static const void* GetByIndex(PyContainer* self, int index) {
1613  return GetDescriptor(self)->extension(index);
1614 }
1615 
1616 static PyObject* NewObjectFromItem(const void* item) {
1617  return PyFieldDescriptor_FromDescriptor(static_cast<ItemDescriptor>(item));
1618 }
1619 
1620 static const std::string& GetItemName(const void* item) {
1621  return static_cast<ItemDescriptor>(item)->name();
1622 }
1623 
1624 static int GetItemIndex(const void* item) {
1625  return static_cast<ItemDescriptor>(item)->index();
1626 }
1627 
1629  "FileExtensions",
1630  Count,
1631  GetByIndex,
1632  GetByName,
1633  NULL,
1634  NULL,
1636  GetItemName,
1637  NULL,
1638  NULL,
1639  GetItemIndex,
1640 };
1641 
1642 } // namespace extensions
1643 
1646 }
1647 
1648 namespace services {
1649 
1650 typedef const ServiceDescriptor* ItemDescriptor;
1651 
1652 static int Count(PyContainer* self) {
1653  return GetDescriptor(self)->service_count();
1654 }
1655 
1656 static const void* GetByName(PyContainer* self, ConstStringParam name) {
1657  return GetDescriptor(self)->FindServiceByName(name);
1658 }
1659 
1660 static const void* GetByIndex(PyContainer* self, int index) {
1661  return GetDescriptor(self)->service(index);
1662 }
1663 
1664 static PyObject* NewObjectFromItem(const void* item) {
1665  return PyServiceDescriptor_FromDescriptor(static_cast<ItemDescriptor>(item));
1666 }
1667 
1668 static const std::string& GetItemName(const void* item) {
1669  return static_cast<ItemDescriptor>(item)->name();
1670 }
1671 
1672 static int GetItemIndex(const void* item) {
1673  return static_cast<ItemDescriptor>(item)->index();
1674 }
1675 
1677  "FileServices",
1678  Count,
1679  GetByIndex,
1680  GetByName,
1681  NULL,
1682  NULL,
1684  GetItemName,
1685  NULL,
1686  NULL,
1687  GetItemIndex,
1688 };
1689 
1690 } // namespace services
1691 
1694 }
1695 
1696 namespace dependencies {
1697 
1698 typedef const FileDescriptor* ItemDescriptor;
1699 
1700 static int Count(PyContainer* self) {
1701  return GetDescriptor(self)->dependency_count();
1702 }
1703 
1704 static const void* GetByIndex(PyContainer* self, int index) {
1705  return GetDescriptor(self)->dependency(index);
1706 }
1707 
1708 static PyObject* NewObjectFromItem(const void* item) {
1709  return PyFileDescriptor_FromDescriptor(static_cast<ItemDescriptor>(item));
1710 }
1711 
1713  "FileDependencies",
1714  Count,
1715  GetByIndex,
1716  NULL,
1717  NULL,
1718  NULL,
1720  NULL,
1721  NULL,
1722  NULL,
1723  NULL,
1724 };
1725 
1726 } // namespace dependencies
1727 
1728 PyObject* NewFileDependencies(const FileDescriptor* descriptor) {
1730 }
1731 
1732 namespace public_dependencies {
1733 
1734 typedef const FileDescriptor* ItemDescriptor;
1735 
1736 static int Count(PyContainer* self) {
1737  return GetDescriptor(self)->public_dependency_count();
1738 }
1739 
1740 static const void* GetByIndex(PyContainer* self, int index) {
1741  return GetDescriptor(self)->public_dependency(index);
1742 }
1743 
1744 static PyObject* NewObjectFromItem(const void* item) {
1745  return PyFileDescriptor_FromDescriptor(static_cast<ItemDescriptor>(item));
1746 }
1747 
1749  "FilePublicDependencies",
1750  Count,
1751  GetByIndex,
1752  NULL,
1753  NULL,
1754  NULL,
1756  NULL,
1757  NULL,
1758  NULL,
1759  NULL,
1760 };
1761 
1762 } // namespace public_dependencies
1763 
1766  descriptor);
1767 }
1768 
1769 } // namespace file_descriptor
1770 
1771 
1772 // Register all implementations
1773 
1775  if (PyType_Ready(&descriptor::DescriptorMapping_Type) < 0)
1776  return false;
1777  if (PyType_Ready(&descriptor::DescriptorSequence_Type) < 0)
1778  return false;
1779  if (PyType_Ready(&descriptor::ContainerIterator_Type) < 0)
1780  return false;
1781  return true;
1782 }
1783 
1784 } // namespace python
1785 } // namespace protobuf
1786 } // namespace google
google::protobuf::python::message_descriptor::oneofs::NewObjectFromItem
static PyObject * NewObjectFromItem(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1276
google::protobuf::python::message_descriptor::NewMessageExtensionsSeq
PyObject * NewMessageExtensionsSeq(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1256
google::protobuf::python::descriptor::NewMappingByNumber
static PyObject * NewMappingByNumber(DescriptorContainerDef *container_def, const void *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:809
google::protobuf::python::file_descriptor::messages::GetItemName
static const string & GetItemName(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1529
google::protobuf::python::file_descriptor::NewFileDependencies
PyObject * NewFileDependencies(const FileDescriptor *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1733
google::protobuf::python::message_descriptor::NewMessageOneofsSeq
PyObject * NewMessageOneofsSeq(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1308
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
google::protobuf::python::file_descriptor::services::ItemDescriptor
const typedef ServiceDescriptor * ItemDescriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1655
google::protobuf::python::message_descriptor::extensions::ItemDescriptor
const typedef FieldDescriptor * ItemDescriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1210
google::protobuf::python::PyContainerIterator::KIND_ITERITEM
@ KIND_ITERITEM
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:157
obj
OPENSSL_EXPORT const ASN1_OBJECT * obj
Definition: x509.h:1671
google::protobuf::python::message_descriptor::fields::GetItemCamelcaseName
static const string & GetItemCamelcaseName(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:988
google::protobuf::python::file_descriptor::enums::ContainerDef
static DescriptorContainerDef ContainerDef
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1585
google::protobuf::python::file_descriptor::enums::GetByName
static const void * GetByName(PyContainer *self, const string &name)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1565
google::protobuf::python::message_descriptor::nested_types::ItemDescriptor
const typedef Descriptor * ItemDescriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1035
google::protobuf::python::descriptor::Find
int Find(PyContainer *self, PyObject *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:633
google::protobuf::python::descriptor::GetItem
static PyObject * GetItem(PyContainer *self, Py_ssize_t index)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:602
google::protobuf::python::enum_descriptor::enumvalues::GetByName
static const void * GetByName(PyContainer *self, const string &name)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1334
google::protobuf::value
const Descriptor::ReservedRange value
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1954
google::protobuf::FieldDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:515
google::protobuf::python::PyContainerIterator::IterKind
IterKind
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:154
google::protobuf::python::descriptor::SeqContains
static int SeqContains(PyContainer *self, PyObject *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:683
google::protobuf::python::enum_descriptor::enumvalues::ContainerDef
static DescriptorContainerDef ContainerDef
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1359
google::protobuf::python::file_descriptor::NewFileMessageTypesByName
PyObject * NewFileMessageTypesByName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1553
google::protobuf::python::message_descriptor::oneofs::ItemDescriptor
const typedef OneofDescriptor * ItemDescriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1262
google::protobuf::python::PyContainer::descriptor
const PyObject_HEAD void * descriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:128
google::protobuf::python::PyContainerIterator::KIND_ITERVALUE_REVERSED
@ KIND_ITERVALUE_REVERSED
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:158
google::protobuf::python::descriptor::SeqSubscript
static PyObject * SeqSubscript(PyContainer *self, PyObject *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:614
google::protobuf::python::oneof_descriptor::fields::Count
static int Count(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1401
google::protobuf::python::file_descriptor::dependencies::ItemDescriptor
const typedef FileDescriptor * ItemDescriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1703
google::protobuf::python::message_descriptor::fields::GetByName
static const void * GetByName(PyContainer *self, const string &name)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:963
google::protobuf::python::DescriptorContainerDef::get_item_name_fn
GetItemNameMethod get_item_name_fn
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:112
google::protobuf::python::DescriptorContainerDef::get_item_index_fn
GetItemIndexMethod get_item_index_fn
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:121
google::protobuf::python::descriptor::Iterator_Next
static PyObject * Iterator_Next(PyContainerIterator *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:845
google::protobuf::python::message_descriptor::oneofs::GetItemIndex
static int GetItemIndex(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1284
google::protobuf::python::file_descriptor::enums::GetItemIndex
static int GetItemIndex(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1581
google::protobuf::python::message_descriptor::extensions::GetItemIndex
static int GetItemIndex(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1232
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::oneof_descriptor::NewOneofFieldsSeq
PyObject * NewOneofFieldsSeq(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1433
google::protobuf::python::message_descriptor::fields::GetItemIndex
static int GetItemIndex(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:996
google::protobuf::python::GetByNumberMethod
const typedef void *(* GetByNumberMethod)(PyContainer *self, int index)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:86
google::protobuf::python::oneof_descriptor::ParentDescriptor
const typedef OneofDescriptor * ParentDescriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1391
google::protobuf::python::file_descriptor::NewFileEnumTypesByName
PyObject * NewFileEnumTypesByName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1601
google::protobuf::python::file_descriptor::services::GetItemIndex
static int GetItemIndex(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1677
position
intern position
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/array.c:487
google::protobuf::python::message_descriptor::enumvalues::GetByIndex
static const void * GetByIndex(PyContainer *self, int index)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1160
google::protobuf::python::file_descriptor::NewFilePublicDependencies
PyObject * NewFilePublicDependencies(const FileDescriptor *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1769
PyString_AsStringAndSize
#define PyString_AsStringAndSize(ob, charpp, sizep)
Definition: protobuf/python/google/protobuf/pyext/descriptor_containers.cc:61
google::protobuf::python::message_descriptor::enums::GetItemIndex
static int GetItemIndex(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1109
google::protobuf::python::service_descriptor::NewServiceMethodsByName
PyObject * NewServiceMethodsByName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1495
google::protobuf::python::ScopedPythonPtr::get
PyObjectStruct * get() const
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/scoped_pyobject_ptr.h:76
google::protobuf::python::descriptor::Iter
static PyObject * Iter(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:534
google::protobuf::python::descriptor::Reversed
static PyObject * Reversed(PyContainer *self, PyObject *args)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:713
FileDescriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:128
google::protobuf::python::PyMethodDescriptor_FromDescriptor
PyObject * PyMethodDescriptor_FromDescriptor(const MethodDescriptor *method_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1877
google::protobuf::python::descriptor::Get
static PyObject * Get(PyContainer *self, PyObject *args)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:455
google::protobuf::python::message_descriptor::NewMessageNestedTypesSeq
PyObject * NewMessageNestedTypesSeq(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1077
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::descriptor::IterValues
static PyObject * IterValues(PyContainer *self, PyObject *args)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:540
google::protobuf::python::message_descriptor::extensions::GetByIndex
static const void * GetByIndex(PyContainer *self, int index)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1220
google::protobuf::python::DescriptorContainerDef::get_item_camelcase_name_fn
GetItemCamelcaseNameMethod get_item_camelcase_name_fn
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:115
google::protobuf::python::PyEnumValueDescriptor_FromDescriptor
PyObject * PyEnumValueDescriptor_FromDescriptor(const EnumValueDescriptor *enumvalue_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1312
google::protobuf
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:12
google::protobuf::python::descriptor::NewContainerIterator
static PyObject * NewContainerIterator(PyContainer *mapping, PyContainerIterator::IterKind kind)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:928
google::protobuf::python::enum_descriptor::NewEnumValuesByNumber
PyObject * NewEnumValuesByNumber(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1379
google::protobuf::python::message_descriptor::NewMessageExtensionsByName
PyObject * NewMessageExtensionsByName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1252
google::protobuf::python::message_descriptor::oneofs::GetItemName
static const string & GetItemName(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1280
google::protobuf::python::DescriptorContainerDef::new_object_from_item_fn
NewObjectFromItemMethod new_object_from_item_fn
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:110
setup.name
name
Definition: setup.py:542
google::protobuf::python::enum_descriptor::enumvalues::GetItemNumber
static int GetItemNumber(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1351
google::protobuf::python::message_descriptor::fields::GetByCamelcaseName
static const void * GetByCamelcaseName(PyContainer *self, const string &name)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:967
google::protobuf::python::message_descriptor::oneofs::GetByName
static const void * GetByName(PyContainer *self, const string &name)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1268
google::protobuf::python::message_descriptor::NewMessageEnumsByName
PyObject * NewMessageEnumsByName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1129
google::protobuf::python::message_descriptor::NewMessageNestedTypesByName
PyObject * NewMessageNestedTypesByName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1081
google::protobuf::python::descriptor::MappingSequenceMethods
static PySequenceMethods MappingSequenceMethods
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:444
google::protobuf::python::descriptor::Iterator_Dealloc
static void Iterator_Dealloc(PyContainerIterator *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:840
google::protobuf::python::file_descriptor::extensions::Count
static int Count(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1609
google::protobuf::python::ScopedPythonPtr
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/scoped_pyobject_ptr.h:46
google::protobuf::python::enum_descriptor::enumvalues::GetItemName
static const string & GetItemName(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1347
google::protobuf::python::file_descriptor::ParentDescriptor
const typedef FileDescriptor * ParentDescriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1503
google::protobuf::python::oneof_descriptor::fields::GetByIndex
static const void * GetByIndex(PyContainer *self, int index)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1405
google::protobuf::python::DescriptorContainerDef::get_item_number_fn
GetItemNumberMethod get_item_number_fn
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:117
google::protobuf::python::service_descriptor::methods::GetItemIndex
static int GetItemIndex(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1471
google::protobuf::python::file_descriptor::enums::GetByIndex
static const void * GetByIndex(PyContainer *self, int index)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1569
google::protobuf::python::message_descriptor::fields::GetByIndex
static const void * GetByIndex(PyContainer *self, int index)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:976
google::protobuf::python::file_descriptor::services::GetItemName
static const string & GetItemName(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1673
google::protobuf::python::message_descriptor::extensions::GetItemName
static const string & GetItemName(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1228
google::protobuf::python::file_descriptor::messages::NewObjectFromItem
static PyObject * NewObjectFromItem(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1525
google::protobuf::python::file_descriptor::services::ContainerDef
static DescriptorContainerDef ContainerDef
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1681
google::protobuf::python::message_descriptor::enumvalues::GetItemName
static const string & GetItemName(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1184
google::protobuf::python::ScopedPythonPtr::release
PyObjectStruct * release()
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/scoped_pyobject_ptr.h:70
google::protobuf::python::service_descriptor::methods::Count
static int Count(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1451
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::DescriptorContainerDef::count_fn
CountMethod count_fn
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:96
Descriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:121
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::service_descriptor::methods::ContainerDef
static DescriptorContainerDef ContainerDef
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1475
google::protobuf::python::PyContainerIterator::KIND_ITERKEY
@ KIND_ITERKEY
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:155
google::protobuf::python::DescriptorContainerDef::get_by_number_fn
GetByNumberMethod get_by_number_fn
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:108
google::protobuf::python::message_descriptor::fields::GetItemNumber
static int GetItemNumber(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:992
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::GetByIndexMethod
const typedef void *(* GetByIndexMethod)(PyContainer *self, int index)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:82
google::protobuf::python::descriptor::IterKeys
static PyObject * IterKeys(PyContainer *self, PyObject *args)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:537
google::protobuf::python::message_descriptor::fields::GetItemName
static const string & GetItemName(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:984
google::protobuf::python::file_descriptor::enums::ItemDescriptor
const typedef EnumDescriptor * ItemDescriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1559
google::protobuf::python::message_descriptor::nested_types::GetItemIndex
static int GetItemIndex(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1057
google::protobuf::python::descriptor::AssSubscript
static int AssSubscript(PyContainer *self, PyObject *key, PyObject *value)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:277
google::protobuf::python::GetItemIndexMethod
int(* GetItemIndexMethod)(const void *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:91
google::protobuf::python::PyContainerIterator::kind
enum google::protobuf::python::PyContainerIterator::IterKind kind
google::protobuf::ServiceDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1152
google::protobuf::python::oneof_descriptor::fields::ContainerDef
static DescriptorContainerDef ContainerDef
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1417
google::protobuf::python::descriptor::SeqMappingMethods
static PyMappingMethods SeqMappingMethods
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:737
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
google::protobuf::python::service_descriptor::methods::GetItemName
static const string & GetItemName(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1467
google::protobuf::ConstStringParam
const std::string & ConstStringParam
Definition: third_party/protobuf/src/google/protobuf/stubs/port.h:129
xds_interop_client.int
int
Definition: xds_interop_client.py:113
google::protobuf::python::PyContainer
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:124
google::protobuf::python::InitDescriptorMappingTypes
bool InitDescriptorMappingTypes()
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1779
google::protobuf::python::message_descriptor::NewMessageFieldsByNumber
PyObject * NewMessageFieldsByNumber(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1025
google::protobuf::python::message_descriptor::enums::NewObjectFromItem
static PyObject * NewObjectFromItem(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1101
google::protobuf::python::service_descriptor::methods::NewObjectFromItem
static PyObject * NewObjectFromItem(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1463
google::protobuf::python::descriptor::DescriptorSequence_Type
PyTypeObject DescriptorSequence_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:743
google::protobuf::python::message_descriptor::nested_types::GetItemName
static const string & GetItemName(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1053
google::protobuf::python::descriptor::Append
static PyObject * Append(PyContainer *self, PyObject *args)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:703
google::protobuf::python::message_descriptor::extensions::ContainerDef
static DescriptorContainerDef ContainerDef
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1236
google::protobuf::python::GetItemNumberMethod
int(* GetItemNumberMethod)(const void *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:90
google::protobuf::python::message_descriptor::enumvalues::ContainerDef
static DescriptorContainerDef ContainerDef
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1188
google::protobuf::python::NewObjectFromItemMethod
PyObject *(* NewObjectFromItemMethod)(const void *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:87
google::protobuf::python::service_descriptor::methods::GetByName
static const void * GetByName(PyContainer *self, const string &name)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1455
google::protobuf::python::descriptor::NewMappingByName
static PyObject * NewMappingByName(DescriptorContainerDef *container_def, const void *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:785
google::protobuf::python::file_descriptor::extensions::GetItemName
static const string & GetItemName(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1625
google::protobuf::python::file_descriptor::services::Count
static int Count(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1657
google::protobuf::python::file_descriptor::messages::ContainerDef
static DescriptorContainerDef ContainerDef
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1537
google::protobuf::python::service_descriptor::methods::GetByIndex
static const void * GetByIndex(PyContainer *self, int index)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1459
google::protobuf::python::message_descriptor::nested_types::ContainerDef
static DescriptorContainerDef ContainerDef
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1061
google::protobuf::python::descriptor::Keys
static PyObject * Keys(PyContainer *self, PyObject *args)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:473
google::protobuf::python::descriptor::MappingMethods
static PyMethodDef MappingMethods[]
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:547
google::protobuf::python::descriptor::Length
static Py_ssize_t Length(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:259
google::protobuf::python::file_descriptor::public_dependencies::NewObjectFromItem
static PyObject * NewObjectFromItem(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1749
google::protobuf::python::descriptor::ContainerRepr
static PyObject * ContainerRepr(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:305
google::protobuf::python::message_descriptor::enums::ContainerDef
static DescriptorContainerDef ContainerDef
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1113
google::protobuf::python::file_descriptor::enums::Count
static int Count(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1561
google::protobuf::python::message_descriptor::extensions::GetByName
static const void * GetByName(PyContainer *self, const string &name)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1216
google::protobuf::python::file_descriptor::public_dependencies::GetByIndex
static const void * GetByIndex(PyContainer *self, int index)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1745
google::protobuf::python::PyContainerIterator::index
int index
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:151
google::protobuf::python::descriptor::DescriptorMapping_Equal
static int DescriptorMapping_Equal(PyContainer *self, PyObject *other)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:375
google::protobuf::python::file_descriptor::services::GetByName
static const void * GetByName(PyContainer *self, const string &name)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1661
number
int32_t number
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:850
google::protobuf::python::PyContainer::ContainerKind
ContainerKind
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:136
EnumValueDescriptor
Definition: protobuf/php/ext/google/protobuf/def.c:63
google::protobuf::python::enum_descriptor::ParentDescriptor
const typedef EnumDescriptor * ParentDescriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1316
google::protobuf::python::file_descriptor::public_dependencies::Count
static int Count(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1741
google::protobuf::python::file_descriptor::services::GetByIndex
static const void * GetByIndex(PyContainer *self, int index)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1665
google::protobuf::python::file_descriptor::messages::GetItemIndex
static int GetItemIndex(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1533
conf.extensions
list extensions
Definition: doc/python/sphinx/conf.py:54
google::protobuf::python::DescriptorContainerDef::get_by_name_fn
GetByNameMethod get_by_name_fn
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:102
tests.google.protobuf.internal.message_test.cmp
cmp
Definition: bloaty/third_party/protobuf/python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/message_test.py:61
google::protobuf::python::enum_descriptor::NewEnumValuesByName
PyObject * NewEnumValuesByName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1375
google::protobuf::python::message_descriptor::enumvalues::ItemDescriptor
const typedef EnumValueDescriptor * ItemDescriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1146
google::protobuf::python::PyContainer::KIND_SEQUENCE
@ KIND_SEQUENCE
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:137
EnumDescriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:143
google::protobuf::python::file_descriptor::extensions::GetByName
static const void * GetByName(PyContainer *self, const string &name)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1613
google::protobuf::python::PyContainer::KIND_BYNAME
@ KIND_BYNAME
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:138
google::protobuf::python::message_descriptor::enums::GetByName
static const void * GetByName(PyContainer *self, const string &name)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1093
google::protobuf::python::service_descriptor::GetDescriptor
static ParentDescriptor GetDescriptor(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1443
google::protobuf::python::file_descriptor::enums::GetItemName
static const string & GetItemName(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1577
google::protobuf::python::file_descriptor::GetDescriptor
static ParentDescriptor GetDescriptor(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1505
google::protobuf::python::message_descriptor::enums::ItemDescriptor
const typedef EnumDescriptor * ItemDescriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1087
google::protobuf::MethodDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1234
google::protobuf::python::file_descriptor::dependencies::GetByIndex
static const void * GetByIndex(PyContainer *self, int index)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1709
google::protobuf::python::message_descriptor::enums::GetByIndex
static const void * GetByIndex(PyContainer *self, int index)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1097
google::protobuf::python::descriptor::Items
static PyObject * Items(PyContainer *self, PyObject *args)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:505
google::protobuf::python::file_descriptor::messages::ItemDescriptor
const typedef Descriptor * ItemDescriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1511
google::protobuf::python::DescriptorContainerDef::get_by_index_fn
GetByIndexMethod get_by_index_fn
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:99
google::protobuf::python::message_descriptor::nested_types::NewObjectFromItem
static PyObject * NewObjectFromItem(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1049
google::protobuf::python::enum_descriptor::enumvalues::GetByIndex
static const void * GetByIndex(PyContainer *self, int index)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1330
google::protobuf::python::file_descriptor::dependencies::Count
static int Count(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1705
google::protobuf::python::file_descriptor::extensions::GetByIndex
static const void * GetByIndex(PyContainer *self, int index)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1617
google::protobuf::python::message_descriptor::NewMessageFieldsByName
PyObject * NewMessageFieldsByName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1016
google::protobuf::python::message_descriptor::NewMessageFieldsSeq
PyObject * NewMessageFieldsSeq(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1029
google::protobuf::python::message_descriptor::fields::ContainerDef
static DescriptorContainerDef ContainerDef
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1000
google::protobuf::python::DescriptorContainerDef::mapping_name
const char * mapping_name
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:94
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::descriptor::ContainerIterator_Type
static PyTypeObject ContainerIterator_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:886
greeter_client.services
services
Definition: no_codegen/greeter_client.py:34
google::protobuf::python::enum_descriptor::enumvalues::ItemDescriptor
const typedef EnumValueDescriptor * ItemDescriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1324
google::protobuf::python::file_descriptor::enums::NewObjectFromItem
static PyObject * NewObjectFromItem(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1573
google::protobuf::python::enum_descriptor::enumvalues::GetByNumber
static const void * GetByNumber(PyContainer *self, int number)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1338
google::protobuf::python::GetByNameMethod
const typedef void *(* GetByNameMethod)(PyContainer *self, const string &name)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:83
google::protobuf::python::message_descriptor::enums::Count
static int Count(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1089
google::protobuf::python::file_descriptor::extensions::ContainerDef
static DescriptorContainerDef ContainerDef
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1633
google::protobuf::python::PyContainerIterator
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:144
google::protobuf::python::file_descriptor::dependencies::NewObjectFromItem
static PyObject * NewObjectFromItem(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1713
google::protobuf::python::message_descriptor::fields::Count
static int Count(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:959
google::protobuf::python::file_descriptor::extensions::ItemDescriptor
const typedef FieldDescriptor * ItemDescriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1607
google::protobuf::python::oneof_descriptor::fields::ItemDescriptor
const typedef FieldDescriptor * ItemDescriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1399
google::protobuf::python::descriptor::NewMappingByCamelcaseName
static PyObject * NewMappingByCamelcaseName(DescriptorContainerDef *container_def, const void *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:797
key
const char * key
Definition: hpack_parser_table.cc:164
google::protobuf::python::message_descriptor::nested_types::GetByName
static const void * GetByName(PyContainer *self, const string &name)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1041
google::protobuf::python::file_descriptor::public_dependencies::ContainerDef
static DescriptorContainerDef ContainerDef
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1753
google::protobuf::python::DescriptorContainerDef::get_by_camelcase_name_fn
GetByCamelcaseNameMethod get_by_camelcase_name_fn
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:105
google::protobuf::python::file_descriptor::messages::GetByName
static const void * GetByName(PyContainer *self, const string &name)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1517
google::protobuf::python::descriptor::RichCompare
static PyObject * RichCompare(PyContainer *self, PyObject *other, int opid)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:421
count
int * count
Definition: bloaty/third_party/googletest/googlemock/test/gmock_stress_test.cc:96
OneofDescriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:138
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::GetItemCamelcaseNameMethod
const typedef string &(* GetItemCamelcaseNameMethod)(const void *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:89
google::protobuf::python::PyDescriptor_AsVoidPtr
const void * PyDescriptor_AsVoidPtr(PyObject *obj)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:456
google::protobuf::python::file_descriptor::dependencies::ContainerDef
static DescriptorContainerDef ContainerDef
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1717
google::protobuf::python::enum_descriptor::enumvalues::NewObjectFromItem
static PyObject * NewObjectFromItem(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1342
google::protobuf::python::message_descriptor::extensions::NewObjectFromItem
static PyObject * NewObjectFromItem(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1224
google::protobuf::python::descriptor::_NewObj_ByIndex
static PyObject * _NewObj_ByIndex(PyContainer *self, Py_ssize_t index)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:254
index
int index
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:1184
google::protobuf::python::PyContainer::KIND_BYNUMBER
@ KIND_BYNUMBER
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:140
google::protobuf::python::descriptor::Contains
static int Contains(PyContainer *self, PyObject *key)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:293
profile_analyzer.fields
list fields
Definition: profile_analyzer.py:266
google::protobuf::python::descriptor::_GetItemByKey
static bool _GetItemByKey(PyContainer *self, PyObject *key, const void **item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:168
google::protobuf::python::enum_descriptor::GetDescriptor
static ParentDescriptor GetDescriptor(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1318
google::protobuf::python::_CalledFromGeneratedFile
bool _CalledFromGeneratedFile(int stacklevel)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:99
google::protobuf::python::StringParam
std::string StringParam
Definition: protobuf/python/google/protobuf/pyext/descriptor.h:46
google::protobuf::EnumValueDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1075
google::protobuf::Descriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:231
google::protobuf::python::PyContainer::kind
enum google::protobuf::python::PyContainer::ContainerKind kind
google::protobuf::python::descriptor::DescriptorMapping_Type
PyTypeObject DescriptorMapping_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:558
google::protobuf::python::file_descriptor::NewFileExtensionsByName
PyObject * NewFileExtensionsByName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1649
google::protobuf::python::oneof_descriptor::GetDescriptor
static ParentDescriptor GetDescriptor(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1393
google::protobuf::python::descriptor::Values
static PyObject * Values(PyContainer *self, PyObject *args)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:489
google::protobuf::python::descriptor::Subscript
static PyObject * Subscript(PyContainer *self, PyObject *key)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:265
google::protobuf::python::message_descriptor::enums::GetItemName
static const string & GetItemName(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1105
google::protobuf::python::enum_descriptor::enumvalues::Count
static int Count(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1326
google::protobuf::python::message_descriptor::NewMessageOneofsByName
PyObject * NewMessageOneofsByName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1304
google::protobuf::python::PyContainer::container_def
const DescriptorContainerDef * container_def
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:133
google::protobuf::python::message_descriptor::fields::ItemDescriptor
const typedef FieldDescriptor * ItemDescriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:957
google::protobuf::python::message_descriptor::fields::GetByNumber
static const void * GetByNumber(PyContainer *self, int number)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:972
google::protobuf::FileDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1320
google::protobuf::python::message_descriptor::extensions::Count
static int Count(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1212
google::protobuf::python::DescriptorContainerDef
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:93
google::protobuf::python::GetItemNameMethod
const typedef string &(* GetItemNameMethod)(const void *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:88
google::protobuf::python::message_descriptor::fields::NewObjectFromItem
static PyObject * NewObjectFromItem(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:980
google::protobuf::python::file_descriptor::extensions::NewObjectFromItem
static PyObject * NewObjectFromItem(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1621
google::protobuf::python::file_descriptor::public_dependencies::ItemDescriptor
const typedef FileDescriptor * ItemDescriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1739
google::protobuf::python::descriptor::SeqMethods
static PyMethodDef SeqMethods[]
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:718
PyVarObject_HEAD_INIT
#define PyVarObject_HEAD_INIT(type, size)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:161
google::protobuf::python::message_descriptor::oneofs::Count
static int Count(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1264
google::protobuf::python::PyContainerIterator::KIND_ITERVALUE
@ KIND_ITERVALUE
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:156
google::protobuf::python::message_descriptor::ParentDescriptor
const typedef Descriptor * ParentDescriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:949
google::protobuf::python::enum_descriptor::enumvalues::GetItemIndex
static int GetItemIndex(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1355
google::protobuf::python::descriptor::SeqSequenceMethods
static PySequenceMethods SeqSequenceMethods
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:726
Py_TYPE
#define Py_TYPE(ob)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:164
google::protobuf::python::GetByCamelcaseNameMethod
const typedef void *(* GetByCamelcaseNameMethod)(PyContainer *self, const string &name)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:84
google::protobuf::python::message_descriptor::oneofs::GetByIndex
static const void * GetByIndex(PyContainer *self, int index)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1272
google::protobuf::python::message_descriptor::enumvalues::Count
static int Count(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1148
google::protobuf::python::service_descriptor::ParentDescriptor
const typedef ServiceDescriptor * ParentDescriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1441
google::protobuf::python::PyContainer::KIND_BYCAMELCASENAME
@ KIND_BYCAMELCASENAME
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:139
google::protobuf::python::message_descriptor::enumvalues::GetByName
static const void * GetByName(PyContainer *self, const string &name)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1156
google::protobuf::python::descriptor::Index
static PyObject * Index(PyContainer *self, PyObject *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:672
google::protobuf::python::file_descriptor::NewFileServicesByName
PyObject * NewFileServicesByName(const FileDescriptor *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1697
google::protobuf::python::descriptor::NewSequence
static PyObject * NewSequence(DescriptorContainerDef *container_def, const void *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:826
size
voidpf void uLong size
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
length
std::size_t length
Definition: abseil-cpp/absl/time/internal/test_util.cc:57
google::protobuf::python::message_descriptor::NewMessageEnumValuesByName
PyObject * NewMessageEnumValuesByName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1204
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::python::service_descriptor::NewServiceMethodsSeq
PyObject * NewServiceMethodsSeq(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1491
google::protobuf::python::message_descriptor::NewMessageFieldsByCamelcaseName
PyObject * NewMessageFieldsByCamelcaseName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1020
google::protobuf::EnumDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:918
enum_descriptor
VALUE enum_descriptor(VALUE self)
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/message.c:794
google::protobuf::python::CountMethod
int(* CountMethod)(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:81
google::protobuf::python::message_descriptor::oneofs::ContainerDef
static DescriptorContainerDef ContainerDef
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1288
phone_pb2.enum_type
enum_type
Definition: phone_pb2.py:198
google::protobuf::python::file_descriptor::messages::GetByIndex
static const void * GetByIndex(PyContainer *self, int index)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1521
google::protobuf::python::descriptor::Count
static PyObject * Count(PyContainer *self, PyObject *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:694
descriptor
static const char descriptor[1336]
Definition: certs.upbdefs.c:16
google::protobuf::python::descriptor::MappingMappingMethods
static PyMappingMethods MappingMappingMethods
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:287
google::protobuf::python::file_descriptor::extensions::GetItemIndex
static int GetItemIndex(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1629
google::protobuf::python::PyContainerIterator::container
PyObject_HEAD PyContainer * container
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:148
grpc::protobuf::ServiceDescriptor
GRPC_CUSTOM_SERVICEDESCRIPTOR ServiceDescriptor
Definition: include/grpcpp/impl/codegen/config_protobuf.h:88
google::protobuf::python::file_descriptor::messages::Count
static int Count(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1513
google::protobuf::python::file_descriptor::services::NewObjectFromItem
static PyObject * NewObjectFromItem(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1669
google
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:11
google::protobuf::python::message_descriptor::NewMessageEnumsSeq
PyObject * NewMessageEnumsSeq(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1133
google::protobuf::python::descriptor::IterItems
static PyObject * IterItems(PyContainer *self, PyObject *args)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:543
google::protobuf::python::oneof_descriptor::fields::GetItemIndex
static int GetItemIndex(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1413
google::protobuf::python::descriptor::DescriptorSequence_Equal
static int DescriptorSequence_Equal(PyContainer *self, PyObject *other)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:331
google::protobuf::python::message_descriptor::GetDescriptor
static ParentDescriptor GetDescriptor(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:951
container
static struct async_container * container
Definition: benchmark-million-async.c:33
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
google::protobuf::python::message_descriptor::nested_types::GetByIndex
static const void * GetByIndex(PyContainer *self, int index)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1045
google::protobuf::python::descriptor::_NewKey_ByIndex
static PyObject * _NewKey_ByIndex(PyContainer *self, Py_ssize_t index)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:227
google::protobuf::python::message_descriptor::enumvalues::NewObjectFromItem
static PyObject * NewObjectFromItem(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1179
google::protobuf::python::enum_descriptor::NewEnumValuesSeq
PyObject * NewEnumValuesSeq(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1383
google::protobuf::python::message_descriptor::nested_types::Count
static int Count(PyContainer *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1037
google::protobuf::python::oneof_descriptor::fields::NewObjectFromItem
static PyObject * NewObjectFromItem(const void *item)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1409
google::protobuf::python::service_descriptor::methods::ItemDescriptor
const typedef MethodDescriptor * ItemDescriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1449


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