protobuf/python/google/protobuf/pyext/message.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: anuraag@google.com (Anuraag Agrawal)
32 // Author: tibell@google.com (Johan Tibell)
33 
34 #ifndef GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_H__
35 #define GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_H__
36 
37 #define PY_SSIZE_T_CLEAN
38 #include <Python.h>
39 
40 #include <cstdint>
41 #include <memory>
42 #include <string>
43 #include <unordered_map>
44 
45 #include <google/protobuf/stubs/common.h>
46 
47 namespace google {
48 namespace protobuf {
49 
50 class Message;
51 class Reflection;
52 class FieldDescriptor;
53 class Descriptor;
54 class DescriptorPool;
55 class MessageFactory;
56 
57 namespace python {
58 
59 struct ExtensionDict;
60 struct PyMessageFactory;
61 struct CMessageClass;
62 
63 // Most of the complexity of the Message class comes from the "Release"
64 // behavior:
65 //
66 // When a field is cleared, it is only detached from its message. Existing
67 // references to submessages, to repeated container etc. won't see any change,
68 // as if the data was effectively managed by these containers.
69 //
70 // ExtensionDicts and UnknownFields containers do NOT follow this rule. They
71 // don't store any data, and always refer to their parent message.
72 
73 struct ContainerBase {
75 
76  // Strong reference to a parent message object. For a CMessage there are three
77  // cases:
78  // - For a top-level message, this pointer is NULL.
79  // - For a sub-message, this points to the parent message.
80  // - For a message managed externally, this is a owned reference to Py_None.
81  //
82  // For all other types: repeated containers, maps, it always point to a
83  // valid parent CMessage.
84  struct CMessage* parent;
85 
86  // If this object belongs to a parent message, describes which field it comes
87  // from.
88  // The pointer is owned by the DescriptorPool (which is kept alive
89  // through the message's Python class)
91 
92  PyObject* AsPyObject() { return reinterpret_cast<PyObject*>(this); }
93 
94  // The Three methods below are only used by Repeated containers, and Maps.
95 
96  // This implementation works for all containers which have a parent.
97  PyObject* DeepCopy();
98  // Delete this container object from its parent. Does not work for messages.
99  void RemoveFromParentCache();
100 };
101 
102 typedef struct CMessage : public ContainerBase {
103  // Pointer to the C++ Message object for this CMessage.
104  // - If this object has no parent, we own this pointer.
105  // - If this object has a parent message, the parent owns this pointer.
106  Message* message;
107 
108  // Indicates this submessage is pointing to a default instance of a message.
109  // Submessages are always first created as read only messages and are then
110  // made writable, at which point this field is set to false.
111  bool read_only;
112 
113  // A mapping indexed by field, containing weak references to contained objects
114  // which need to implement the "Release" mechanism:
115  // direct submessages, RepeatedCompositeContainer, RepeatedScalarContainer
116  // and MapContainer.
117  typedef std::unordered_map<const FieldDescriptor*, ContainerBase*>
120 
121  // A mapping containing weak references to indirect child messages, accessed
122  // through containers: repeated messages, and values of message maps.
123  // This avoid the creation of similar maps in each of those containers.
124  typedef std::unordered_map<const Message*, CMessage*> SubMessagesMap;
126 
127  // A reference to PyUnknownFields.
128  PyObject* unknown_field_set;
129 
130  // Implements the "weakref" protocol for this object.
131  PyObject* weakreflist;
132 
133  // Return a *borrowed* reference to the message class.
135  return reinterpret_cast<CMessageClass*>(Py_TYPE(this));
136  }
137 
138  // For container containing messages, return a Python object for the given
139  // pointer to a message.
140  CMessage* BuildSubMessageFromPointer(const FieldDescriptor* field_descriptor,
141  Message* sub_message,
142  CMessageClass* message_class);
143  CMessage* MaybeReleaseSubMessage(Message* sub_message);
144 } CMessage;
145 
146 // The (meta) type of all Messages classes.
147 // It allows us to cache some C++ pointers in the class object itself, they are
148 // faster to extract than from the type's dictionary.
149 
150 struct CMessageClass {
151  // This is how CPython subclasses C structures: the base structure must be
152  // the first member of the object.
153  PyHeapTypeObject super;
154 
155  // C++ descriptor of this message.
157 
158  // Owned reference, used to keep the pointer above alive.
159  // This reference must stay alive until all message pointers are destructed.
160  PyObject* py_message_descriptor;
161 
162  // The Python MessageFactory used to create the class. It is needed to resolve
163  // fields descriptors, including extensions fields; its C++ MessageFactory is
164  // used to instantiate submessages.
165  // This reference must stay alive until all message pointers are destructed.
166  PyMessageFactory* py_message_factory;
167 
168  PyObject* AsPyObject() {
169  return reinterpret_cast<PyObject*>(this);
170  }
171 };
172 
173 extern PyTypeObject* CMessageClass_Type;
174 extern PyTypeObject* CMessage_Type;
175 
176 namespace cmessage {
177 
178 // Internal function to create a new empty Message Python object, but with empty
179 // pointers to the C++ objects.
180 // The caller must fill self->message, self->owner and eventually self->parent.
181 CMessage* NewEmptyMessage(CMessageClass* type);
182 
183 // Retrieves the C++ descriptor of a Python Extension descriptor.
184 // On error, return NULL with an exception set.
186 
187 // Initializes a new CMessage instance for a submessage. Only called once per
188 // submessage as the result is cached in composite_fields.
189 //
190 // Corresponds to reflection api method GetMessage.
192  CMessage* self, const FieldDescriptor* field_descriptor);
193 
194 // Deletes a range of items in a repeated field (following a
195 // removal in a RepeatedCompositeContainer).
196 //
197 // Corresponds to reflection api method RemoveLast.
198 int DeleteRepeatedField(CMessage* self,
199  const FieldDescriptor* field_descriptor,
200  PyObject* slice);
201 
202 // Sets the specified scalar value to the message.
203 int InternalSetScalar(CMessage* self,
204  const FieldDescriptor* field_descriptor,
205  PyObject* value);
206 
207 // Sets the specified scalar value to the message. Requires it is not a Oneof.
209  const FieldDescriptor* field_descriptor,
210  PyObject* arg);
211 
212 // Retrieves the specified scalar value from the message.
213 //
214 // Returns a new python reference.
215 PyObject* InternalGetScalar(const Message* message,
216  const FieldDescriptor* field_descriptor);
217 
219  ContainerBase* value);
220 
221 bool SetSubmessage(CMessage* self, CMessage* submessage);
222 
223 // Clears the message, removing all contained data. Extension dictionary and
224 // submessages are released first if there are remaining external references.
225 //
226 // Corresponds to message api method Clear.
227 PyObject* Clear(CMessage* self);
228 
229 // Clears the data described by the given descriptor.
230 // Returns -1 on error.
231 //
232 // Corresponds to reflection api method ClearField.
234 
235 // Checks if the message has the field described by the descriptor. Used for
236 // extensions (which have no name).
237 // Returns 1 if true, 0 if false, and -1 on error.
238 //
239 // Corresponds to reflection api method HasField
241  const FieldDescriptor* field_descriptor);
242 
243 // Checks if the message has the named field.
244 //
245 // Corresponds to reflection api method HasField.
246 PyObject* HasField(CMessage* self, PyObject* arg);
247 
248 // Initializes values of fields on a newly constructed message.
249 // Note that positional arguments are disallowed: 'args' must be NULL or the
250 // empty tuple.
251 int InitAttributes(CMessage* self, PyObject* args, PyObject* kwargs);
252 
253 PyObject* MergeFrom(CMessage* self, PyObject* arg);
254 
255 // This method does not do anything beyond checking that no other extension
256 // has been registered with the same field number on this class.
257 PyObject* RegisterExtension(PyObject* cls, PyObject* extension_handle);
258 
259 // Get a field from a message.
260 PyObject* GetFieldValue(CMessage* self,
261  const FieldDescriptor* field_descriptor);
262 // Sets the value of a scalar field in a message.
263 // On error, return -1 with an extension set.
264 int SetFieldValue(CMessage* self, const FieldDescriptor* field_descriptor,
265  PyObject* value);
266 
267 PyObject* FindInitializationErrors(CMessage* self);
268 
269 int AssureWritable(CMessage* self);
270 
271 // Returns the message factory for the given message.
272 // This is equivalent to message.MESSAGE_FACTORY
273 //
274 // The returned factory is suitable for finding fields and building submessages,
275 // even in the case of extensions.
276 // Returns a *borrowed* reference, and never fails because we pass a CMessage.
277 PyMessageFactory* GetFactoryForMessage(CMessage* message);
278 
279 PyObject* SetAllowOversizeProtos(PyObject* m, PyObject* arg);
280 
281 } // namespace cmessage
282 
283 
284 /* Is 64bit */
285 #define IS_64BIT (SIZEOF_LONG == 8)
286 
287 #define FIELD_IS_REPEATED(field_descriptor) \
288  ((field_descriptor)->label() == FieldDescriptor::LABEL_REPEATED)
289 
290 #define GOOGLE_CHECK_GET_INT32(arg, value, err) \
291  int32_t value; \
292  if (!CheckAndGetInteger(arg, &value)) { \
293  return err; \
294  }
295 
296 #define GOOGLE_CHECK_GET_INT64(arg, value, err) \
297  int64_t value; \
298  if (!CheckAndGetInteger(arg, &value)) { \
299  return err; \
300  }
301 
302 #define GOOGLE_CHECK_GET_UINT32(arg, value, err) \
303  uint32_t value; \
304  if (!CheckAndGetInteger(arg, &value)) { \
305  return err; \
306  }
307 
308 #define GOOGLE_CHECK_GET_UINT64(arg, value, err) \
309  uint64_t value; \
310  if (!CheckAndGetInteger(arg, &value)) { \
311  return err; \
312  }
313 
314 #define GOOGLE_CHECK_GET_FLOAT(arg, value, err) \
315  float value; \
316  if (!CheckAndGetFloat(arg, &value)) { \
317  return err; \
318  }
319 
320 #define GOOGLE_CHECK_GET_DOUBLE(arg, value, err) \
321  double value; \
322  if (!CheckAndGetDouble(arg, &value)) { \
323  return err; \
324  }
325 
326 #define GOOGLE_CHECK_GET_BOOL(arg, value, err) \
327  bool value; \
328  if (!CheckAndGetBool(arg, &value)) { \
329  return err; \
330  }
331 
332 #define FULL_MODULE_NAME "google.protobuf.pyext._message"
333 
334 void FormatTypeError(PyObject* arg, const char* expected_types);
335 template<class T>
336 bool CheckAndGetInteger(PyObject* arg, T* value);
337 bool CheckAndGetDouble(PyObject* arg, double* value);
338 bool CheckAndGetFloat(PyObject* arg, float* value);
339 bool CheckAndGetBool(PyObject* arg, bool* value);
340 PyObject* CheckString(PyObject* arg, const FieldDescriptor* descriptor);
341 bool CheckAndSetString(
342  PyObject* arg, Message* message,
344  const Reflection* reflection,
345  bool append,
346  int index);
347 PyObject* ToStringObject(const FieldDescriptor* descriptor,
348  const std::string& value);
349 
350 // Check if the passed field descriptor belongs to the given message.
351 // If not, return false and set a Python exception (a KeyError)
352 bool CheckFieldBelongsToMessage(const FieldDescriptor* field_descriptor,
353  const Message* message);
354 
355 extern PyObject* PickleError_class;
356 
357 PyObject* PyMessage_New(const Descriptor* descriptor,
358  PyObject* py_message_factory);
359 const Message* PyMessage_GetMessagePointer(PyObject* msg);
362  PyObject* py_message_factory);
363 
364 bool InitProto2MessageModule(PyObject *m);
365 
366 // These are referenced by repeated_scalar_container, and must
367 // be explicitly instantiated.
368 extern template bool CheckAndGetInteger<int32>(PyObject*, int32*);
369 extern template bool CheckAndGetInteger<int64>(PyObject*, int64*);
370 extern template bool CheckAndGetInteger<uint32>(PyObject*, uint32*);
371 extern template bool CheckAndGetInteger<uint64>(PyObject*, uint64*);
372 
373 } // namespace python
374 } // namespace protobuf
375 } // namespace google
376 
377 #endif // GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_H__
google::protobuf::python::cmessage::GetExtensionDescriptor
const FieldDescriptor * GetExtensionDescriptor(PyObject *extension)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:934
google::protobuf::python::cmessage::Clear
PyObject * Clear(CMessage *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:1643
google::protobuf::value
const Descriptor::ReservedRange value
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1954
google::protobuf::FieldDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:515
google::protobuf::python::PickleError_class
PyObject * PickleError_class
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:543
google::protobuf::python::cmessage::NewEmptyMessage
CMessage * NewEmptyMessage(CMessageClass *type)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:1235
google::protobuf::extension
const Descriptor::ReservedRange const EnumValueDescriptor const MethodDescriptor extension
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:2001
google::protobuf::int64
int64_t int64
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/stubs/port.h:151
google::protobuf::python::cmessage::InitAttributes
int InitAttributes(CMessage *self, PyObject *args, PyObject *kwargs)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:1066
google::protobuf::python::CMessage
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.h:100
google::protobuf::python::ToStringObject
PyObject * ToStringObject(const FieldDescriptor *descriptor, const string &value)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:799
google::protobuf::python::CheckAndGetInteger< uint32 >
template bool CheckAndGetInteger< uint32 >(PyObject *, uint32 *)
google::protobuf::python::cmessage::MergeFrom
PyObject * MergeFrom(CMessage *self, PyObject *arg)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:1829
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::cmessage::HasFieldByDescriptor
int HasFieldByDescriptor(CMessage *self, const FieldDescriptor *field_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:1362
google::protobuf::uint32
uint32_t uint32
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/stubs/port.h:155
google::protobuf::python::CheckAndGetInteger< int64 >
template bool CheckAndGetInteger< int64 >(PyObject *, int64 *)
google::protobuf
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:12
google::protobuf::python::CheckAndGetInteger< uint64 >
template bool CheckAndGetInteger< uint64 >(PyObject *, uint64 *)
google::protobuf::python::PyMessage_New
PyObject * PyMessage_New(const Descriptor *descriptor, PyObject *py_message_factory)
Definition: protobuf/python/google/protobuf/pyext/message.cc:2852
google::protobuf::python::cmessage::InternalGetScalar
PyObject * InternalGetScalar(const Message *message, const FieldDescriptor *field_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:2181
google::protobuf::python::CMessageClass
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.h:148
google::protobuf::python::CMessage::CompositeFieldsMap
std::unordered_map< const FieldDescriptor *, ContainerBase * > CompositeFieldsMap
Definition: protobuf/python/google/protobuf/pyext/message.h:118
message
char * message
Definition: libuv/docs/code/tty-gravity/main.c:12
T
#define T(upbtypeconst, upbtype, ctype, default_value)
google::protobuf::python::CMessage::weakreflist
PyObject * weakreflist
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.h:129
Descriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:121
FieldDescriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:133
google::protobuf::int32
int32_t int32
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/stubs/port.h:150
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
google::protobuf::python::CheckString
PyObject * CheckString(PyObject *arg, const FieldDescriptor *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:728
google::protobuf::python::cmessage::RegisterExtension
PyObject * RegisterExtension(PyObject *cls, PyObject *extension_handle)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:1986
google::protobuf::python::CMessageClass::AsPyObject
PyObject * AsPyObject()
Definition: protobuf/python/google/protobuf/pyext/message.h:168
slice
grpc_slice slice
Definition: src/core/lib/surface/server.cc:467
google::protobuf::python::CMessageClass_Type
PyTypeObject * CMessageClass_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:514
google::protobuf::python::CMessage_Type
PyTypeObject * CMessage_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:2847
google::protobuf::python::ContainerBase::parent_field_descriptor
const FieldDescriptor * parent_field_descriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.h:88
google::protobuf::python::CMessageClass::py_message_descriptor
PyObject * py_message_descriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.h:158
arg
Definition: cmdline.cc:40
google::protobuf::uint64
uint64_t uint64
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/stubs/port.h:156
google::protobuf::python::cmessage::SetCompositeField
bool SetCompositeField(CMessage *self, const FieldDescriptor *field, ContainerBase *value)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:2602
google::protobuf::python::cmessage::SetAllowOversizeProtos
PyObject * SetAllowOversizeProtos(PyObject *m, PyObject *arg)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:1914
google::protobuf::python::ExtensionDict
struct google::protobuf::python::ExtensionDict ExtensionDict
google::protobuf::python::ContainerBase::AsPyObject
PyObject * AsPyObject()
Definition: protobuf/python/google/protobuf/pyext/message.h:92
google::protobuf::python::CMessage::read_only
bool read_only
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.h:109
google::protobuf::python::cmessage::ClearFieldByDescriptor
int ClearFieldByDescriptor(CMessage *self, const FieldDescriptor *field_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:1602
google::protobuf::python::cmessage::FindInitializationErrors
PyObject * FindInitializationErrors(CMessage *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:2127
msg
std::string msg
Definition: client_interceptors_end2end_test.cc:372
google::protobuf::python::ContainerBase::RemoveFromParentCache
void RemoveFromParentCache()
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:2754
google::protobuf::python::CheckAndGetInteger< int32 >
template bool CheckAndGetInteger< int32 >(PyObject *, int32 *)
google::protobuf::python::cmessage::AssureWritable
int AssureWritable(CMessage *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:898
google::protobuf::python::ContainerBase::PyObject_HEAD
PyObject_HEAD
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.h:72
google::protobuf::python::cmessage::SetFieldValue
int SetFieldValue(CMessage *self, const FieldDescriptor *field_descriptor, PyObject *value)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:2705
google::protobuf::python::CMessageClass::message_descriptor
const Descriptor * message_descriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.h:154
google::protobuf::python::cmessage::SetSubmessage
bool SetSubmessage(CMessage *self, CMessage *submessage)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:2611
google::protobuf::python::CheckAndGetFloat
bool CheckAndGetFloat(PyObject *arg, float *value)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:685
google::protobuf::Message
Definition: bloaty/third_party/protobuf/src/google/protobuf/message.h:205
field
const FieldDescriptor * field
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/parser_unittest.cc:2692
google::protobuf::python::CMessage
google::protobuf::python::CMessage CMessage
google::protobuf::python::CMessage::MaybeReleaseSubMessage
CMessage * MaybeReleaseSubMessage(Message *sub_message)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:2788
google::protobuf::python::cmessage::GetFactoryForMessage
PyMessageFactory * GetFactoryForMessage(CMessage *message)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:830
google::protobuf::python::ContainerBase::DeepCopy
PyObject * DeepCopy()
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:2737
google::protobuf::python::CMessageClass::py_message_factory
PyMessageFactory * py_message_factory
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.h:164
google::protobuf::python::CheckFieldBelongsToMessage
bool CheckFieldBelongsToMessage(const FieldDescriptor *field_descriptor, const Message *message)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:817
index
int index
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:1184
google::protobuf::python::cmessage::DeleteRepeatedField
int DeleteRepeatedField(CMessage *self, const FieldDescriptor *field_descriptor, PyObject *slice)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:977
google::protobuf::python::cmessage::InternalSetScalar
int InternalSetScalar(CMessage *self, const FieldDescriptor *field_descriptor, PyObject *arg)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:2356
google::protobuf::python::CMessage::composite_fields
CompositeFieldsMap * composite_fields
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.h:117
google::protobuf::python::cmessage::HasField
PyObject * HasField(CMessage *self, PyObject *arg)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:1431
google::protobuf::Descriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:231
google::protobuf::python::CMessage::SubMessagesMap
std::unordered_map< const Message *, CMessage * > SubMessagesMap
Definition: protobuf/python/google/protobuf/pyext/message.h:124
google::protobuf::python::CMessage::BuildSubMessageFromPointer
CMessage * BuildSubMessageFromPointer(const FieldDescriptor *field_descriptor, Message *sub_message, CMessageClass *message_class)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:2763
google::protobuf::python::CheckAndGetBool
bool CheckAndGetBool(PyObject *arg, bool *value)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:694
google::protobuf::python::ContainerBase::parent
struct CMessage * parent
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.h:82
google::protobuf::python::InitProto2MessageModule
bool InitProto2MessageModule(PyObject *m)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:2943
google::protobuf::python::CheckAndSetString
bool CheckAndSetString(PyObject *arg, Message *message, const FieldDescriptor *descriptor, const Reflection *reflection, bool append, int index)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:770
google::protobuf::python::FormatTypeError
void FormatTypeError(PyObject *arg, char *expected_types)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:547
google::protobuf::python::cmessage::InternalSetNonOneofScalar
int InternalSetNonOneofScalar(Message *message, const FieldDescriptor *field_descriptor, PyObject *arg)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:2276
google::protobuf::python::CMessage::unknown_field_set
PyObject * unknown_field_set
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.h:126
Py_TYPE
#define Py_TYPE(ob)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:164
google::protobuf::python::CheckAndGetDouble
bool CheckAndGetDouble(PyObject *arg, double *value)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:676
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
google::protobuf::python::PyMessage_NewMessageOwnedExternally
PyObject * PyMessage_NewMessageOwnedExternally(Message *message, PyObject *message_factory)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:2904
google::protobuf::python::CMessage::GetMessageClass
CMessageClass * GetMessageClass()
Definition: protobuf/python/google/protobuf/pyext/message.h:134
regress.m
m
Definition: regress/regress.py:25
DescriptorPool
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:110
google::protobuf::python::cmessage::GetFieldValue
PyObject * GetFieldValue(CMessage *self, const FieldDescriptor *field_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:2635
descriptor
static const char descriptor[1336]
Definition: certs.upbdefs.c:16
google::protobuf::python::PyMessage_GetMessagePointer
const Message * PyMessage_GetMessagePointer(PyObject *msg)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:2872
google::protobuf::python::CMessage::child_submessages
SubMessagesMap * child_submessages
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.h:123
google
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:11
google::protobuf::python::cmessage::InternalGetSubMessage
CMessage * InternalGetSubMessage(CMessage *self, const FieldDescriptor *field_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:2248
Message
Definition: protobuf/php/ext/google/protobuf/message.c:53
google::protobuf::python::PyMessage_GetMutableMessagePointer
Message * PyMessage_GetMutableMessagePointer(PyObject *msg)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:2881
google::protobuf::python::CMessage::message
Message * message
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.h:104
google::protobuf::python::CheckAndGetInteger
bool CheckAndGetInteger(PyObject *arg, T *value)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:591
google::protobuf::python::CMessageClass::super
PyHeapTypeObject super
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.h:151


grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:25