OLD | NEW |
1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
4 // | 4 // |
5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
7 // met: | 7 // met: |
8 // | 8 // |
9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
(...skipping 29 matching lines...) Expand all Loading... |
40 namespace google { | 40 namespace google { |
41 namespace protobuf { | 41 namespace protobuf { |
42 namespace python { | 42 namespace python { |
43 | 43 |
44 extern PyTypeObject PyMessageDescriptor_Type; | 44 extern PyTypeObject PyMessageDescriptor_Type; |
45 extern PyTypeObject PyFieldDescriptor_Type; | 45 extern PyTypeObject PyFieldDescriptor_Type; |
46 extern PyTypeObject PyEnumDescriptor_Type; | 46 extern PyTypeObject PyEnumDescriptor_Type; |
47 extern PyTypeObject PyEnumValueDescriptor_Type; | 47 extern PyTypeObject PyEnumValueDescriptor_Type; |
48 extern PyTypeObject PyFileDescriptor_Type; | 48 extern PyTypeObject PyFileDescriptor_Type; |
49 extern PyTypeObject PyOneofDescriptor_Type; | 49 extern PyTypeObject PyOneofDescriptor_Type; |
50 extern PyTypeObject PyServiceDescriptor_Type; | |
51 extern PyTypeObject PyMethodDescriptor_Type; | |
52 | 50 |
53 // Wraps a Descriptor in a Python object. | 51 // Wraps a Descriptor in a Python object. |
54 // The C++ pointer is usually borrowed from the global DescriptorPool. | 52 // The C++ pointer is usually borrowed from the global DescriptorPool. |
55 // In any case, it must stay alive as long as the Python object. | 53 // In any case, it must stay alive as long as the Python object. |
56 // Returns a new reference. | 54 // Returns a new reference. |
57 PyObject* PyMessageDescriptor_FromDescriptor(const Descriptor* descriptor); | 55 PyObject* PyMessageDescriptor_FromDescriptor(const Descriptor* descriptor); |
58 PyObject* PyFieldDescriptor_FromDescriptor(const FieldDescriptor* descriptor); | 56 PyObject* PyFieldDescriptor_FromDescriptor(const FieldDescriptor* descriptor); |
59 PyObject* PyEnumDescriptor_FromDescriptor(const EnumDescriptor* descriptor); | 57 PyObject* PyEnumDescriptor_FromDescriptor(const EnumDescriptor* descriptor); |
60 PyObject* PyEnumValueDescriptor_FromDescriptor( | 58 PyObject* PyEnumValueDescriptor_FromDescriptor( |
61 const EnumValueDescriptor* descriptor); | 59 const EnumValueDescriptor* descriptor); |
62 PyObject* PyOneofDescriptor_FromDescriptor(const OneofDescriptor* descriptor); | 60 PyObject* PyOneofDescriptor_FromDescriptor(const OneofDescriptor* descriptor); |
63 PyObject* PyFileDescriptor_FromDescriptor( | 61 PyObject* PyFileDescriptor_FromDescriptor( |
64 const FileDescriptor* file_descriptor); | 62 const FileDescriptor* file_descriptor); |
65 PyObject* PyServiceDescriptor_FromDescriptor( | |
66 const ServiceDescriptor* descriptor); | |
67 PyObject* PyMethodDescriptor_FromDescriptor( | |
68 const MethodDescriptor* descriptor); | |
69 | 63 |
70 // Alternate constructor of PyFileDescriptor, used when we already have a | 64 // Alternate constructor of PyFileDescriptor, used when we already have a |
71 // serialized FileDescriptorProto that can be cached. | 65 // serialized FileDescriptorProto that can be cached. |
72 // Returns a new reference. | 66 // Returns a new reference. |
73 PyObject* PyFileDescriptor_FromDescriptorWithSerializedPb( | 67 PyObject* PyFileDescriptor_FromDescriptorWithSerializedPb( |
74 const FileDescriptor* file_descriptor, PyObject* serialized_pb); | 68 const FileDescriptor* file_descriptor, PyObject* serialized_pb); |
75 | 69 |
76 // Return the C++ descriptor pointer. | 70 // Return the C++ descriptor pointer. |
77 // This function checks the parameter type; on error, return NULL with a Python | 71 // This function checks the parameter type; on error, return NULL with a Python |
78 // exception set. | 72 // exception set. |
(...skipping 15 matching lines...) Expand all Loading... |
94 // Don't use this function outside descriptor classes. | 88 // Don't use this function outside descriptor classes. |
95 bool _CalledFromGeneratedFile(int stacklevel); | 89 bool _CalledFromGeneratedFile(int stacklevel); |
96 | 90 |
97 bool InitDescriptor(); | 91 bool InitDescriptor(); |
98 | 92 |
99 } // namespace python | 93 } // namespace python |
100 } // namespace protobuf | 94 } // namespace protobuf |
101 | 95 |
102 } // namespace google | 96 } // namespace google |
103 #endif // GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_H__ | 97 #endif // GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_H__ |
OLD | NEW |