• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc.  All rights reserved.
3 //
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file or at
6 // https://developers.google.com/open-source/licenses/bsd
7 
8 #ifndef GOOGLE_PROTOBUF_PYTHON_CPP_FIELD_H__
9 #define GOOGLE_PROTOBUF_PYTHON_CPP_FIELD_H__
10 
11 #define PY_SSIZE_T_CLEAN
12 #include <Python.h>
13 
14 namespace google {
15 namespace protobuf {
16 
17 class FieldDescriptor;
18 
19 namespace python {
20 
21 // A data descriptor that represents a field in a Message class.
22 struct PyMessageFieldProperty {
23   PyObject_HEAD;
24 
25   // This pointer is owned by the same pool as the Message class it belongs to.
26   const FieldDescriptor* field_descriptor;
27 };
28 
29 extern PyTypeObject* CFieldProperty_Type;
30 
31 PyObject* NewFieldProperty(const FieldDescriptor* field_descriptor);
32 
33 }  // namespace python
34 }  // namespace protobuf
35 }  // namespace google
36 
37 #endif  // GOOGLE_PROTOBUF_PYTHON_CPP_FIELD_H__
38