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; |
50 | 52 |
51 // Wraps a Descriptor in a Python object. | 53 // Wraps a Descriptor in a Python object. |
52 // The C++ pointer is usually borrowed from the global DescriptorPool. | 54 // The C++ pointer is usually borrowed from the global DescriptorPool. |
53 // In any case, it must stay alive as long as the Python object. | 55 // In any case, it must stay alive as long as the Python object. |
54 // Returns a new reference. | 56 // Returns a new reference. |
55 PyObject* PyMessageDescriptor_FromDescriptor(const Descriptor* descriptor); | 57 PyObject* PyMessageDescriptor_FromDescriptor(const Descriptor* descriptor); |
56 PyObject* PyFieldDescriptor_FromDescriptor(const FieldDescriptor* descriptor); | 58 PyObject* PyFieldDescriptor_FromDescriptor(const FieldDescriptor* descriptor); |
57 PyObject* PyEnumDescriptor_FromDescriptor(const EnumDescriptor* descriptor); | 59 PyObject* PyEnumDescriptor_FromDescriptor(const EnumDescriptor* descriptor); |
58 PyObject* PyEnumValueDescriptor_FromDescriptor( | 60 PyObject* PyEnumValueDescriptor_FromDescriptor( |
59 const EnumValueDescriptor* descriptor); | 61 const EnumValueDescriptor* descriptor); |
60 PyObject* PyOneofDescriptor_FromDescriptor(const OneofDescriptor* descriptor); | 62 PyObject* PyOneofDescriptor_FromDescriptor(const OneofDescriptor* descriptor); |
61 PyObject* PyFileDescriptor_FromDescriptor( | 63 PyObject* PyFileDescriptor_FromDescriptor( |
62 const FileDescriptor* file_descriptor); | 64 const FileDescriptor* file_descriptor); |
| 65 PyObject* PyServiceDescriptor_FromDescriptor( |
| 66 const ServiceDescriptor* descriptor); |
| 67 PyObject* PyMethodDescriptor_FromDescriptor( |
| 68 const MethodDescriptor* descriptor); |
63 | 69 |
64 // Alternate constructor of PyFileDescriptor, used when we already have a | 70 // Alternate constructor of PyFileDescriptor, used when we already have a |
65 // serialized FileDescriptorProto that can be cached. | 71 // serialized FileDescriptorProto that can be cached. |
66 // Returns a new reference. | 72 // Returns a new reference. |
67 PyObject* PyFileDescriptor_FromDescriptorWithSerializedPb( | 73 PyObject* PyFileDescriptor_FromDescriptorWithSerializedPb( |
68 const FileDescriptor* file_descriptor, PyObject* serialized_pb); | 74 const FileDescriptor* file_descriptor, PyObject* serialized_pb); |
69 | 75 |
70 // Return the C++ descriptor pointer. | 76 // Return the C++ descriptor pointer. |
71 // This function checks the parameter type; on error, return NULL with a Python | 77 // This function checks the parameter type; on error, return NULL with a Python |
72 // exception set. | 78 // exception set. |
(...skipping 15 matching lines...) Expand all Loading... |
88 // Don't use this function outside descriptor classes. | 94 // Don't use this function outside descriptor classes. |
89 bool _CalledFromGeneratedFile(int stacklevel); | 95 bool _CalledFromGeneratedFile(int stacklevel); |
90 | 96 |
91 bool InitDescriptor(); | 97 bool InitDescriptor(); |
92 | 98 |
93 } // namespace python | 99 } // namespace python |
94 } // namespace protobuf | 100 } // namespace protobuf |
95 | 101 |
96 } // namespace google | 102 } // namespace google |
97 #endif // GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_H__ | 103 #endif // GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_H__ |
OLD | NEW |