aboutsummaryrefslogtreecommitdiff
path: root/python/google/protobuf/pyext/extension_dict.h
diff options
context:
space:
mode:
Diffstat (limited to 'python/google/protobuf/pyext/extension_dict.h')
-rw-r--r--python/google/protobuf/pyext/extension_dict.h20
1 files changed, 3 insertions, 17 deletions
diff --git a/python/google/protobuf/pyext/extension_dict.h b/python/google/protobuf/pyext/extension_dict.h
index 0de2c4ee..d800d479 100644
--- a/python/google/protobuf/pyext/extension_dict.h
+++ b/python/google/protobuf/pyext/extension_dict.h
@@ -37,6 +37,7 @@
#include <Python.h>
#include <memory>
+#include <hash_map>
#include <google/protobuf/pyext/message.h>
@@ -51,23 +52,8 @@ namespace python {
typedef struct ExtensionDict {
PyObject_HEAD;
- // This is the top-level C++ Message object that owns the whole
- // proto tree. Every Python container class holds a
- // reference to it in order to keep it alive as long as there's a
- // Python object that references any part of the tree.
- CMessage::OwnerRef owner;
-
- // Weak reference to parent message. Used to make sure
- // the parent is writable when an extension field is modified.
+ // Strong, owned reference to the parent message. Never NULL.
CMessage* parent;
-
- // Pointer to the C++ Message that this ExtensionDict extends.
- // Not owned by us.
- Message* message;
-
- // A dict of child messages, indexed by Extension descriptors.
- // Similar to CMessage::composite_fields.
- PyObject* values;
} ExtensionDict;
extern PyTypeObject ExtensionDict_Type;
@@ -80,6 +66,6 @@ ExtensionDict* NewExtensionDict(CMessage *parent);
} // namespace extension_dict
} // namespace python
} // namespace protobuf
-
} // namespace google
+
#endif // GOOGLE_PROTOBUF_PYTHON_CPP_EXTENSION_DICT_H__