diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2014-11-10 17:34:54 -0800 |
---|---|---|
committer | Feng Xiao <xfxyjwf@gmail.com> | 2014-11-10 17:34:54 -0800 |
commit | 6ef984af4b0c63c1c33127a12dcfc8e6359f0c9e (patch) | |
tree | d17c61ff9f3ae28224fbddac6d26bfc59e2cf755 /python/google/protobuf/pyext/repeated_scalar_container.h | |
parent | baca1a8a1aa180c42de6278d3b8286c4496c6a10 (diff) | |
download | protobuf-6ef984af4b0c63c1c33127a12dcfc8e6359f0c9e.tar.gz protobuf-6ef984af4b0c63c1c33127a12dcfc8e6359f0c9e.tar.bz2 protobuf-6ef984af4b0c63c1c33127a12dcfc8e6359f0c9e.zip |
Down-integrate from internal code base.
Diffstat (limited to 'python/google/protobuf/pyext/repeated_scalar_container.h')
-rw-r--r-- | python/google/protobuf/pyext/repeated_scalar_container.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/python/google/protobuf/pyext/repeated_scalar_container.h b/python/google/protobuf/pyext/repeated_scalar_container.h index 69d15d5c..513bfe48 100644 --- a/python/google/protobuf/pyext/repeated_scalar_container.h +++ b/python/google/protobuf/pyext/repeated_scalar_container.h @@ -41,6 +41,7 @@ #include <google/protobuf/stubs/shared_ptr.h> #endif +#include <google/protobuf/descriptor.h> namespace google { namespace protobuf { @@ -51,7 +52,6 @@ using internal::shared_ptr; namespace python { -struct CFieldDescriptor; struct CMessage; typedef struct RepeatedScalarContainer { @@ -73,16 +73,22 @@ typedef struct RepeatedScalarContainer { // modifying the container. CMessage* parent; - // Weak reference to the parent's descriptor that describes this + // Pointer to the parent's descriptor that describes this // field. Used together with the parent's message when making a // default message instance mutable. - CFieldDescriptor* parent_field; + // The pointer is owned by the global DescriptorPool. + const google::protobuf::FieldDescriptor* parent_field_descriptor; } RepeatedScalarContainer; extern PyTypeObject RepeatedScalarContainer_Type; namespace repeated_scalar_container { +// Builds a RepeatedScalarContainer object, from a parent message and a +// field descriptor. +extern PyObject *NewContainer( + CMessage* parent, const google::protobuf::FieldDescriptor* parent_field_descriptor); + // Appends the scalar 'item' to the end of the container 'self'. // // Returns None if successful; returns NULL and sets an exception if |