Classes | Functions | Variables
upb/python/map.c File Reference
#include "python/map.h"
#include "python/convert.h"
#include "python/message.h"
#include "python/protobuf.h"
Include dependency graph for upb/python/map.c:

Go to the source code of this file.

Classes

struct  PyUpb_MapContainer
 
struct  PyUpb_MapIterator
 

Functions

static PyObject * GetMutableMappingBase (void)
 
int PyUpb_CMessage_InitMapAttributes (PyObject *map, PyObject *value, const upb_FieldDef *f)
 
bool PyUpb_Map_Init (PyObject *m)
 
int PyUpb_MapContainer_AssignSubscript (PyObject *_self, PyObject *key, PyObject *val)
 
PyUpb_MapContainerPyUpb_MapContainer_Check (PyObject *_self)
 
PyObject * PyUpb_MapContainer_Clear (PyObject *_self, PyObject *key)
 
PyObject * PyUpb_MapContainer_Contains (PyObject *_self, PyObject *key)
 
static void PyUpb_MapContainer_Dealloc (void *_self)
 
upb_MapPyUpb_MapContainer_EnsureReified (PyObject *_self)
 
static PyObject * PyUpb_MapContainer_Get (PyObject *_self, PyObject *args, PyObject *kwargs)
 
PyTypeObject * PyUpb_MapContainer_GetClass (const upb_FieldDef *f)
 
static PyObject * PyUpb_MapContainer_GetEntryClass (PyObject *_self, PyObject *arg)
 
static const upb_FieldDefPyUpb_MapContainer_GetField (PyUpb_MapContainer *self)
 
static upb_MapPyUpb_MapContainer_GetIfReified (PyUpb_MapContainer *self)
 
PyObject * PyUpb_MapContainer_GetOrCreateWrapper (upb_Map *map, const upb_FieldDef *f, PyObject *arena)
 
void PyUpb_MapContainer_Invalidate (PyObject *obj)
 
static bool PyUpb_MapContainer_IsStub (PyUpb_MapContainer *self)
 
Py_ssize_t PyUpb_MapContainer_Length (PyObject *_self)
 
static PyObject * PyUpb_MapContainer_MergeFrom (PyObject *_self, PyObject *_arg)
 
PyObject * PyUpb_MapContainer_NewStub (PyObject *parent, const upb_FieldDef *f, PyObject *arena)
 
void PyUpb_MapContainer_Reify (PyObject *_self, upb_Map *map)
 
static PyObject * PyUpb_MapContainer_Repr (PyObject *_self)
 
PyObject * PyUpb_MapContainer_Subscript (PyObject *_self, PyObject *key)
 
static void PyUpb_MapIterator_Dealloc (void *_self)
 
PyObject * PyUpb_MapIterator_IterNext (PyObject *_self)
 
static PyObject * PyUpb_MapIterator_New (PyUpb_MapContainer *map)
 

Variables

static PyType_Slot PyUpb_MapIterator_Slots []
 
static PyType_Spec PyUpb_MapIterator_Spec
 
static PyMethodDef PyUpb_MessageMapContainer_Methods []
 
static PyType_Slot PyUpb_MessageMapContainer_Slots []
 
static PyType_Spec PyUpb_MessageMapContainer_Spec
 
static PyMethodDef PyUpb_ScalarMapContainer_Methods []
 
static PyType_Slot PyUpb_ScalarMapContainer_Slots []
 
static PyType_Spec PyUpb_ScalarMapContainer_Spec
 

Function Documentation

◆ GetMutableMappingBase()

static PyObject* GetMutableMappingBase ( void  )
static

Definition at line 478 of file upb/python/map.c.

◆ PyUpb_CMessage_InitMapAttributes()

int PyUpb_CMessage_InitMapAttributes ( PyObject *  map,
PyObject *  value,
const upb_FieldDef f 
)

Definition at line 338 of file upb/python/message.c.

◆ PyUpb_Map_Init()

bool PyUpb_Map_Init ( PyObject *  m)

Definition at line 491 of file upb/python/map.c.

◆ PyUpb_MapContainer_AssignSubscript()

int PyUpb_MapContainer_AssignSubscript ( PyObject *  _self,
PyObject *  key,
PyObject *  val 
)

Definition at line 148 of file upb/python/map.c.

◆ PyUpb_MapContainer_Check()

PyUpb_MapContainer* PyUpb_MapContainer_Check ( PyObject *  _self)

Definition at line 260 of file upb/python/map.c.

◆ PyUpb_MapContainer_Clear()

PyObject* PyUpb_MapContainer_Clear ( PyObject *  _self,
PyObject *  key 
)

Definition at line 211 of file upb/python/map.c.

◆ PyUpb_MapContainer_Contains()

PyObject* PyUpb_MapContainer_Contains ( PyObject *  _self,
PyObject *  key 
)

Definition at line 195 of file upb/python/map.c.

◆ PyUpb_MapContainer_Dealloc()

static void PyUpb_MapContainer_Dealloc ( void *  _self)
static

Definition at line 70 of file upb/python/map.c.

◆ PyUpb_MapContainer_EnsureReified()

upb_Map* PyUpb_MapContainer_EnsureReified ( PyObject *  _self)

Definition at line 129 of file upb/python/map.c.

◆ PyUpb_MapContainer_Get()

static PyObject* PyUpb_MapContainer_Get ( PyObject *  _self,
PyObject *  args,
PyObject *  kwargs 
)
static

Definition at line 217 of file upb/python/map.c.

◆ PyUpb_MapContainer_GetClass()

PyTypeObject* PyUpb_MapContainer_GetClass ( const upb_FieldDef f)

Definition at line 83 of file upb/python/map.c.

◆ PyUpb_MapContainer_GetEntryClass()

static PyObject* PyUpb_MapContainer_GetEntryClass ( PyObject *  _self,
PyObject *  arg 
)
static

Definition at line 246 of file upb/python/map.c.

◆ PyUpb_MapContainer_GetField()

static const upb_FieldDef* PyUpb_MapContainer_GetField ( PyUpb_MapContainer self)
static

Definition at line 65 of file upb/python/map.c.

◆ PyUpb_MapContainer_GetIfReified()

static upb_Map* PyUpb_MapContainer_GetIfReified ( PyUpb_MapContainer self)
static

Definition at line 61 of file upb/python/map.c.

◆ PyUpb_MapContainer_GetOrCreateWrapper()

PyObject* PyUpb_MapContainer_GetOrCreateWrapper ( upb_Map map,
const upb_FieldDef f,
PyObject *  arena 
)

Definition at line 319 of file upb/python/map.c.

◆ PyUpb_MapContainer_Invalidate()

void PyUpb_MapContainer_Invalidate ( PyObject *  obj)

Definition at line 124 of file upb/python/map.c.

◆ PyUpb_MapContainer_IsStub()

static bool PyUpb_MapContainer_IsStub ( PyUpb_MapContainer self)
static

Definition at line 55 of file upb/python/map.c.

◆ PyUpb_MapContainer_Length()

Py_ssize_t PyUpb_MapContainer_Length ( PyObject *  _self)

Definition at line 254 of file upb/python/map.c.

◆ PyUpb_MapContainer_MergeFrom()

static PyObject* PyUpb_MapContainer_MergeFrom ( PyObject *  _self,
PyObject *  _arg 
)
static

Definition at line 273 of file upb/python/map.c.

◆ PyUpb_MapContainer_NewStub()

PyObject* PyUpb_MapContainer_NewStub ( PyObject *  parent,
const upb_FieldDef f,
PyObject *  arena 
)

Definition at line 90 of file upb/python/map.c.

◆ PyUpb_MapContainer_Reify()

void PyUpb_MapContainer_Reify ( PyObject *  _self,
upb_Map map 
)

Definition at line 106 of file upb/python/map.c.

◆ PyUpb_MapContainer_Repr()

static PyObject* PyUpb_MapContainer_Repr ( PyObject *  _self)
static

Definition at line 288 of file upb/python/map.c.

◆ PyUpb_MapContainer_Subscript()

PyObject* PyUpb_MapContainer_Subscript ( PyObject *  _self,
PyObject *  key 
)

Definition at line 172 of file upb/python/map.c.

◆ PyUpb_MapIterator_Dealloc()

static void PyUpb_MapIterator_Dealloc ( void *  _self)
static

Definition at line 443 of file upb/python/map.c.

◆ PyUpb_MapIterator_IterNext()

PyObject* PyUpb_MapIterator_IterNext ( PyObject *  _self)

Definition at line 449 of file upb/python/map.c.

◆ PyUpb_MapIterator_New()

static PyObject * PyUpb_MapIterator_New ( PyUpb_MapContainer map)
static

Definition at line 432 of file upb/python/map.c.

Variable Documentation

◆ PyUpb_MapIterator_Slots

PyType_Slot PyUpb_MapIterator_Slots[]
static
Initial value:
= {
{Py_tp_dealloc, PyUpb_MapIterator_Dealloc},
{Py_tp_iter, PyObject_SelfIter},
{Py_tp_iternext, PyUpb_MapIterator_IterNext},
{0, NULL}}

Definition at line 464 of file upb/python/map.c.

◆ PyUpb_MapIterator_Spec

PyType_Spec PyUpb_MapIterator_Spec
static
Initial value:
= {
PYUPB_MODULE_NAME ".MapIterator", sizeof(PyUpb_MapIterator), 0,
Py_TPFLAGS_DEFAULT, PyUpb_MapIterator_Slots}

Definition at line 470 of file upb/python/map.c.

◆ PyUpb_MessageMapContainer_Methods

PyMethodDef PyUpb_MessageMapContainer_Methods[]
static
Initial value:
= {
{"__contains__", PyUpb_MapContainer_Contains, METH_O,
"Tests whether the map contains this element."},
{"clear", PyUpb_MapContainer_Clear, METH_NOARGS,
"Removes all elements from the map."},
{"get", (PyCFunction)PyUpb_MapContainer_Get, METH_VARARGS | METH_KEYWORDS,
"Gets the value for the given key if present, or otherwise a default"},
{"get_or_create", PyUpb_MapContainer_Subscript, METH_O,
"Alias for getitem, useful to make explicit that the map is mutated."},
{"GetEntryClass", PyUpb_MapContainer_GetEntryClass, METH_NOARGS,
"Return the class used to build Entries of (key, value) pairs."},
{"MergeFrom", PyUpb_MapContainer_MergeFrom, METH_O,
"Merges a map into the current map."},
{NULL, NULL},
}

Definition at line 384 of file upb/python/map.c.

◆ PyUpb_MessageMapContainer_Slots

PyType_Slot PyUpb_MessageMapContainer_Slots[]
static
Initial value:
= {
{Py_tp_dealloc, PyUpb_MapContainer_Dealloc},
{Py_mp_length, PyUpb_MapContainer_Length},
{Py_mp_subscript, PyUpb_MapContainer_Subscript},
{Py_mp_ass_subscript, PyUpb_MapContainer_AssignSubscript},
{Py_tp_iter, PyUpb_MapIterator_New},
{Py_tp_repr, PyUpb_MapContainer_Repr},
{Py_tp_hash, PyObject_HashNotImplemented},
{0, NULL}}

Definition at line 406 of file upb/python/map.c.

◆ PyUpb_MessageMapContainer_Spec

PyType_Spec PyUpb_MessageMapContainer_Spec
static
Initial value:
= {
PYUPB_MODULE_NAME ".MessageMapContainer", sizeof(PyUpb_MapContainer), 0,
Py_TPFLAGS_DEFAULT, PyUpb_MessageMapContainer_Slots}

Definition at line 417 of file upb/python/map.c.

◆ PyUpb_ScalarMapContainer_Methods

PyMethodDef PyUpb_ScalarMapContainer_Methods[]
static
Initial value:
= {
{"__contains__", PyUpb_MapContainer_Contains, METH_O,
"Tests whether a key is a member of the map."},
{"clear", PyUpb_MapContainer_Clear, METH_NOARGS,
"Removes all elements from the map."},
{"get", (PyCFunction)PyUpb_MapContainer_Get, METH_VARARGS | METH_KEYWORDS,
"Gets the value for the given key if present, or otherwise a default"},
{"GetEntryClass", PyUpb_MapContainer_GetEntryClass, METH_NOARGS,
"Return the class used to build Entries of (key, value) pairs."},
{"MergeFrom", PyUpb_MapContainer_MergeFrom, METH_O,
"Merges a map into the current map."},
{NULL, NULL},
}

Definition at line 340 of file upb/python/map.c.

◆ PyUpb_ScalarMapContainer_Slots

PyType_Slot PyUpb_ScalarMapContainer_Slots[]
static
Initial value:
= {
{Py_tp_dealloc, PyUpb_MapContainer_Dealloc},
{Py_mp_length, PyUpb_MapContainer_Length},
{Py_mp_subscript, PyUpb_MapContainer_Subscript},
{Py_mp_ass_subscript, PyUpb_MapContainer_AssignSubscript},
{Py_tp_iter, PyUpb_MapIterator_New},
{Py_tp_repr, PyUpb_MapContainer_Repr},
{Py_tp_hash, PyObject_HashNotImplemented},
{0, NULL},
}

Definition at line 360 of file upb/python/map.c.

◆ PyUpb_ScalarMapContainer_Spec

PyType_Spec PyUpb_ScalarMapContainer_Spec
static
Initial value:
= {
PYUPB_MODULE_NAME ".ScalarMapContainer",
0,
Py_TPFLAGS_DEFAULT,
}

Definition at line 372 of file upb/python/map.c.

PyUpb_MapIterator
Definition: upb/python/map.c:425
PyUpb_MapContainer_GetEntryClass
static PyObject * PyUpb_MapContainer_GetEntryClass(PyObject *_self, PyObject *arg)
Definition: upb/python/map.c:246
PyUpb_MapIterator_IterNext
PyObject * PyUpb_MapIterator_IterNext(PyObject *_self)
Definition: upb/python/map.c:449
PyUpb_MapContainer_Length
Py_ssize_t PyUpb_MapContainer_Length(PyObject *_self)
Definition: upb/python/map.c:254
PyUpb_MapContainer_Dealloc
static void PyUpb_MapContainer_Dealloc(void *_self)
Definition: upb/python/map.c:70
PyUpb_MapIterator_Dealloc
static void PyUpb_MapIterator_Dealloc(void *_self)
Definition: upb/python/map.c:443
PyUpb_ScalarMapContainer_Methods
static PyMethodDef PyUpb_ScalarMapContainer_Methods[]
Definition: upb/python/map.c:340
PyUpb_MapIterator_New
static PyObject * PyUpb_MapIterator_New(PyUpb_MapContainer *map)
Definition: upb/python/map.c:432
PyUpb_MessageMapContainer_Methods
static PyMethodDef PyUpb_MessageMapContainer_Methods[]
Definition: upb/python/map.c:384
PyUpb_MapContainer_MergeFrom
static PyObject * PyUpb_MapContainer_MergeFrom(PyObject *_self, PyObject *_arg)
Definition: upb/python/map.c:273
PyUpb_MapContainer_Repr
static PyObject * PyUpb_MapContainer_Repr(PyObject *_self)
Definition: upb/python/map.c:288
PyUpb_MapContainer_AssignSubscript
int PyUpb_MapContainer_AssignSubscript(PyObject *_self, PyObject *key, PyObject *val)
Definition: upb/python/map.c:148
PyUpb_MessageMapContainer_Slots
static PyType_Slot PyUpb_MessageMapContainer_Slots[]
Definition: upb/python/map.c:406
PyUpb_MapContainer_Subscript
PyObject * PyUpb_MapContainer_Subscript(PyObject *_self, PyObject *key)
Definition: upb/python/map.c:172
PyUpb_MapContainer_Get
static PyObject * PyUpb_MapContainer_Get(PyObject *_self, PyObject *args, PyObject *kwargs)
Definition: upb/python/map.c:217
PyUpb_MapContainer_Clear
PyObject * PyUpb_MapContainer_Clear(PyObject *_self, PyObject *key)
Definition: upb/python/map.c:211
PYUPB_MODULE_NAME
#define PYUPB_MODULE_NAME
Definition: upb/python/protobuf.h:43
PyUpb_ScalarMapContainer_Slots
static PyType_Slot PyUpb_ScalarMapContainer_Slots[]
Definition: upb/python/map.c:360
PyUpb_MapContainer
Definition: upb/python/map.c:38
PyUpb_MapContainer_Contains
PyObject * PyUpb_MapContainer_Contains(PyObject *_self, PyObject *key)
Definition: upb/python/map.c:195
PyUpb_MapIterator_Slots
static PyType_Slot PyUpb_MapIterator_Slots[]
Definition: upb/python/map.c:464


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:22