diff options
Diffstat (limited to 'python/google/protobuf/pyext/descriptor_pool.h')
-rw-r--r-- | python/google/protobuf/pyext/descriptor_pool.h | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/python/google/protobuf/pyext/descriptor_pool.h b/python/google/protobuf/pyext/descriptor_pool.h index 6f6c5cdb..541d920b 100644 --- a/python/google/protobuf/pyext/descriptor_pool.h +++ b/python/google/protobuf/pyext/descriptor_pool.h @@ -72,14 +72,6 @@ typedef struct PyDescriptorPool { typedef hash_map<const Descriptor*, PyObject*> ClassesByMessageMap; ClassesByMessageMap* classes_by_descriptor; - // Store interned descriptors, so that the same C++ descriptor yields the same - // Python object. Objects are not immortal: this map does not own the - // references, and items are deleted when the last reference to the object is - // released. - // This is enough to support the "is" operator on live objects. - // All descriptors are stored here. - hash_map<const void*, PyObject*>* interned_descriptors; - // Cache the options for any kind of descriptor. // Descriptor pointers are owned by the DescriptorPool above. // Python objects are owned by the map. @@ -91,9 +83,6 @@ extern PyTypeObject PyDescriptorPool_Type; namespace cdescriptor_pool { -// Builds a new DescriptorPool. Normally called only once per process. -PyDescriptorPool* NewDescriptorPool(); - // Looks up a message by name. // Returns a message Descriptor, or NULL if not found. const Descriptor* FindMessageTypeByName(PyDescriptorPool* self, @@ -150,6 +139,10 @@ PyObject* FindOneofByName(PyDescriptorPool* self, PyObject* arg); // Returns a *borrowed* reference. PyDescriptorPool* GetDescriptorPool(); +// Retrieve the python descriptor pool owning a C++ descriptor pool. +// Returns a *borrowed* reference. +PyDescriptorPool* GetDescriptorPool_FromPool(const DescriptorPool* pool); + // Initialize objects used by this module. bool InitDescriptorPool(); |