diff options
Diffstat (limited to 'python/google/protobuf/pyext/message.h')
-rw-r--r-- | python/google/protobuf/pyext/message.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/python/google/protobuf/pyext/message.h b/python/google/protobuf/pyext/message.h index f147d433..1ff82e2f 100644 --- a/python/google/protobuf/pyext/message.h +++ b/python/google/protobuf/pyext/message.h @@ -49,12 +49,15 @@ class Message; class Reflection; class FieldDescriptor; class Descriptor; +class DescriptorPool; +class MessageFactory; using internal::shared_ptr; namespace python { struct ExtensionDict; +struct PyDescriptorPool; typedef struct CMessage { PyObject_HEAD; @@ -220,6 +223,16 @@ PyObject* FindInitializationErrors(CMessage* self); int SetOwner(CMessage* self, const shared_ptr<Message>& new_owner); int AssureWritable(CMessage* self); + +// Returns the "best" DescriptorPool for the given message. +// This is often equivalent to message.DESCRIPTOR.pool, but not always, when +// the message class was created from a MessageFactory using a custom pool which +// uses the generated pool as an underlay. +// +// The returned pool is suitable for finding fields and building submessages, +// even in the case of extensions. +PyDescriptorPool* GetDescriptorPoolForMessage(CMessage* message); + } // namespace cmessage |