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_composite_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_composite_container.h')
-rw-r--r-- | python/google/protobuf/pyext/repeated_composite_container.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/python/google/protobuf/pyext/repeated_composite_container.h b/python/google/protobuf/pyext/repeated_composite_container.h index 898ef5a7..a76a5d6a 100644 --- a/python/google/protobuf/pyext/repeated_composite_container.h +++ b/python/google/protobuf/pyext/repeated_composite_container.h @@ -55,7 +55,6 @@ using internal::shared_ptr; namespace python { struct CMessage; -struct CFieldDescriptor; // A RepeatedCompositeContainer can be in one of two states: attached // or released. @@ -66,7 +65,7 @@ struct CFieldDescriptor; // 'child_messages' are owner by the 'owner'. // // When in the released state 'message', 'owner', 'parent', and -// 'parent_field' are NULL. +// 'parent_field_descriptor' are NULL. typedef struct RepeatedCompositeContainer { PyObject_HEAD; @@ -82,7 +81,8 @@ typedef struct RepeatedCompositeContainer { CMessage* parent; // A descriptor used to modify the underlying 'message'. - CFieldDescriptor* parent_field; + // The pointer is owned by the global DescriptorPool. + const google::protobuf::FieldDescriptor* parent_field_descriptor; // Pointer to the C++ Message that contains this container. The // RepeatedCompositeContainer does not own this pointer. @@ -102,6 +102,13 @@ extern PyTypeObject RepeatedCompositeContainer_Type; namespace repeated_composite_container { +// Builds a RepeatedCompositeContainer object, from a parent message and a +// field descriptor. +PyObject *NewContainer( + CMessage* parent, + const google::protobuf::FieldDescriptor* parent_field_descriptor, + PyObject *concrete_class); + // Returns the number of items in this repeated composite container. static Py_ssize_t Length(RepeatedCompositeContainer* self); |