aboutsummaryrefslogtreecommitdiff
path: root/python/google/protobuf/pyext/extension_dict.h
diff options
context:
space:
mode:
authorFeng Xiao <xfxyjwf@gmail.com>2018-08-08 17:00:41 -0700
committerFeng Xiao <xfxyjwf@gmail.com>2018-08-08 17:00:41 -0700
commit6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3 (patch)
treee575738adf52d24b883cca5e8928a5ded31caba1 /python/google/protobuf/pyext/extension_dict.h
parente7746f487cb9cca685ffb1b3d7dccc5554b618a4 (diff)
downloadprotobuf-6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3.tar.gz
protobuf-6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3.tar.bz2
protobuf-6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3.zip
Down-integrate from google3.
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__