protobuf/python/google/protobuf/pyext/descriptor.h
Go to the documentation of this file.
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above
12 // copyright notice, this list of conditions and the following disclaimer
13 // in the documentation and/or other materials provided with the
14 // distribution.
15 // * Neither the name of Google Inc. nor the names of its
16 // contributors may be used to endorse or promote products derived from
17 // this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 // Author: petar@google.com (Petar Petrov)
32 
33 #ifndef GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_H__
34 #define GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_H__
35 
36 #define PY_SSIZE_T_CLEAN
37 #include <Python.h>
38 
39 #include <google/protobuf/descriptor.h>
40 
41 namespace google {
42 namespace protobuf {
43 namespace python {
44 
45 // Should match the type of ConstStringParam.
47 
48 extern PyTypeObject PyMessageDescriptor_Type;
49 extern PyTypeObject PyFieldDescriptor_Type;
50 extern PyTypeObject PyEnumDescriptor_Type;
51 extern PyTypeObject PyEnumValueDescriptor_Type;
52 extern PyTypeObject PyFileDescriptor_Type;
53 extern PyTypeObject PyOneofDescriptor_Type;
54 extern PyTypeObject PyServiceDescriptor_Type;
55 extern PyTypeObject PyMethodDescriptor_Type;
56 
57 // Wraps a Descriptor in a Python object.
58 // The C++ pointer is usually borrowed from the global DescriptorPool.
59 // In any case, it must stay alive as long as the Python object.
60 // Returns a new reference.
68  const FileDescriptor* file_descriptor);
73 
74 // Alternate constructor of PyFileDescriptor, used when we already have a
75 // serialized FileDescriptorProto that can be cached.
76 // Returns a new reference.
78  const FileDescriptor* file_descriptor, PyObject* serialized_pb);
79 
80 // Return the C++ descriptor pointer.
81 // This function checks the parameter type; on error, return NULL with a Python
82 // exception set.
88 
89 // Returns the raw C++ pointer.
90 const void* PyDescriptor_AsVoidPtr(PyObject* obj);
91 
92 // Check that the calling Python code is the global scope of a _pb2.py module.
93 // This function is used to support the current code generated by the proto
94 // compiler, which insists on modifying descriptors after they have been
95 // created.
96 //
97 // stacklevel indicates which Python frame should be the _pb2.py module.
98 //
99 // Don't use this function outside descriptor classes.
100 bool _CalledFromGeneratedFile(int stacklevel);
101 
102 bool InitDescriptor();
103 
104 } // namespace python
105 } // namespace protobuf
106 } // namespace google
107 
108 #endif // GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_H__
obj
OPENSSL_EXPORT const ASN1_OBJECT * obj
Definition: x509.h:1671
google::protobuf::python::PyServiceDescriptor_Type
PyTypeObject PyServiceDescriptor_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1731
google::protobuf::FieldDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:515
google::protobuf::python::PyEnumValueDescriptor_Type
PyTypeObject PyEnumValueDescriptor_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1278
google::protobuf::python::PyServiceDescriptor_FromDescriptor
PyObject * PyServiceDescriptor_FromDescriptor(const ServiceDescriptor *service_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1765
google::protobuf::python::PyFieldDescriptor_AsDescriptor
const FieldDescriptor * PyFieldDescriptor_AsDescriptor(PyObject *obj)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1043
google::protobuf::python::PyMethodDescriptor_FromDescriptor
PyObject * PyMethodDescriptor_FromDescriptor(const MethodDescriptor *method_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1877
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
google::protobuf::python::PyEnumValueDescriptor_FromDescriptor
PyObject * PyEnumValueDescriptor_FromDescriptor(const EnumValueDescriptor *enumvalue_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1312
google::protobuf
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:12
google::protobuf::OneofDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:843
google::protobuf::python::PyEnumDescriptor_FromDescriptor
PyObject * PyEnumDescriptor_FromDescriptor(const EnumDescriptor *enum_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1192
google::protobuf::python::PyFieldDescriptor_FromDescriptor
PyObject * PyFieldDescriptor_FromDescriptor(const FieldDescriptor *field_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1037
google::protobuf::python::PyMessageDescriptor_FromDescriptor
PyObject * PyMessageDescriptor_FromDescriptor(const Descriptor *message_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:722
google::protobuf::python::PyFileDescriptor_Type
PyTypeObject PyFileDescriptor_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1454
google::protobuf::ServiceDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1152
google::protobuf::python::PyMessageDescriptor_AsDescriptor
const Descriptor * PyMessageDescriptor_AsDescriptor(PyObject *obj)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:728
google::protobuf::python::PyEnumDescriptor_Type
PyTypeObject PyEnumDescriptor_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1158
google::protobuf::MethodDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1234
google::protobuf::python::PyMessageDescriptor_Type
PyTypeObject PyMessageDescriptor_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:688
google::protobuf::python::PyFieldDescriptor_Type
PyTypeObject PyFieldDescriptor_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1003
google::protobuf::python::PyFileDescriptor_FromDescriptor
PyObject * PyFileDescriptor_FromDescriptor(const FileDescriptor *file_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1496
google::protobuf::python::InitDescriptor
bool InitDescriptor()
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1909
google::protobuf::python::PyFileDescriptor_AsDescriptor
const FileDescriptor * PyFileDescriptor_AsDescriptor(PyObject *obj)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1522
google::protobuf::python::PyOneofDescriptor_FromDescriptor
PyObject * PyOneofDescriptor_FromDescriptor(const OneofDescriptor *oneof_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1647
google::protobuf::python::PyDescriptor_AsVoidPtr
const void * PyDescriptor_AsVoidPtr(PyObject *obj)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:456
google::protobuf::python::PyEnumDescriptor_AsDescriptor
const EnumDescriptor * PyEnumDescriptor_AsDescriptor(PyObject *obj)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1198
google::protobuf::python::PyFileDescriptor_FromDescriptorWithSerializedPb
PyObject * PyFileDescriptor_FromDescriptorWithSerializedPb(const FileDescriptor *file_descriptor, PyObject *serialized_pb)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1502
google::protobuf::python::PyServiceDescriptor_AsDescriptor
const ServiceDescriptor * PyServiceDescriptor_AsDescriptor(PyObject *obj)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1771
google::protobuf::python::PyOneofDescriptor_Type
PyTypeObject PyOneofDescriptor_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1613
google::protobuf::python::_CalledFromGeneratedFile
bool _CalledFromGeneratedFile(int stacklevel)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:99
google::protobuf::python::StringParam
std::string StringParam
Definition: protobuf/python/google/protobuf/pyext/descriptor.h:46
google::protobuf::EnumValueDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1075
google::protobuf::Descriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:231
google::protobuf::FileDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1320
google::protobuf::python::PyMethodDescriptor_Type
PyTypeObject PyMethodDescriptor_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1843
google::protobuf::EnumDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:918
descriptor
static const char descriptor[1336]
Definition: certs.upbdefs.c:16
google
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:11


grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:11