PythonMonkey   v1.0.0 (dev)
Loading...
Searching...
No Matches
JSObjectValuesProxy.hh
Go to the documentation of this file.
1
11#ifndef PythonMonkey_JSObjectValuesProxy_
12#define PythonMonkey_JSObjectValuesProxy_
13
14#include <jsapi.h>
15
16#include <Python.h>
17
18
23typedef struct {
24 _PyDictViewObject dv;
26
32public:
39
48 static int JSObjectValuesProxy_traverse(JSObjectValuesProxy *self, visitproc visit, void *arg);
49
57
64 static Py_ssize_t JSObjectValuesProxy_length(JSObjectValuesProxy *self);
65
73 static int JSObjectValuesProxy_contains(JSObjectValuesProxy *self, PyObject *key);
74
81 static PyObject *JSObjectValuesProxy_iter(JSObjectValuesProxy *self);
82
89 static PyObject *JSObjectValuesProxy_repr(JSObjectValuesProxy *self);
90
98
106 static PyObject *JSObjectValuesProxy_mapping(PyObject *self, void *Py_UNUSED(ignored));
107};
108
113static PySequenceMethods JSObjectValuesProxy_sequence_methods = {
116};
117
118PyDoc_STRVAR(reversed_values_doc,
119 "Return a reverse iterator over the dict values.");
120
125static PyMethodDef JSObjectValuesProxy_methods[] = {
126 {"__reversed__", (PyCFunction)JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_iter_reverse, METH_NOARGS, reversed_values_doc},
127 {NULL, NULL} /* sentinel */
128};
129
130static PyGetSetDef JSObjectValuesProxy_getset[] = {
131 {"mapping", JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_mapping, (setter)NULL, "dictionary that this view refers to", NULL},
132 {0}
133};
134
138extern PyTypeObject JSObjectValuesProxyType;
139
140#endif
PyTypeObject JSObjectValuesProxyType
Struct for the JSObjectValuesProxyType, used by all JSObjectValuesProxy objects.
Definition pythonmonkey.cc:264
PyDoc_STRVAR(reversed_values_doc, "Return a reverse iterator over the dict values.")
This struct is a bundle of methods used by the JSObjectValuesProxy type.
Definition JSObjectValuesProxy.hh:31
static void JSObjectValuesProxy_dealloc(JSObjectValuesProxy *self)
Deallocation method (.tp_dealloc), removes the reference to the underlying JSObject before freeing th...
Definition JSObjectValuesProxy.cc:28
static int JSObjectValuesProxy_clear(JSObjectValuesProxy *self)
.tp_clear method
Definition JSObjectValuesProxy.cc:56
static int JSObjectValuesProxy_traverse(JSObjectValuesProxy *self, visitproc visit, void *arg)
.tp_traverse method
Definition JSObjectValuesProxy.cc:51
static Py_ssize_t JSObjectValuesProxy_length(JSObjectValuesProxy *self)
Length method (.sq_length), returns the number of key-value pairs in the JSObject,...
Definition JSObjectValuesProxy.cc:35
static PyObject * JSObjectValuesProxy_mapping(PyObject *self, void *Py_UNUSED(ignored))
mapping method
Definition JSObjectValuesProxy.cc:151
static int JSObjectValuesProxy_contains(JSObjectValuesProxy *self, PyObject *key)
Test method (.sq_contains), returns whether a key exists, used by the in operator.
Definition JSObjectValuesProxy.cc:43
static PyObject * JSObjectValuesProxy_iter_reverse(JSObjectValuesProxy *self)
reverse iterator method
Definition JSObjectValuesProxy.cc:111
static PyObject * JSObjectValuesProxy_iter(JSObjectValuesProxy *self)
Return an iterator object to make JSObjectValuesProxy iterable, emitting (key, value) tuples.
Definition JSObjectValuesProxy.cc:92
static PyObject * JSObjectValuesProxy_repr(JSObjectValuesProxy *self)
Compute a string representation of the JSObjectValuesProxy.
Definition JSObjectValuesProxy.cc:130
The typedef for the backing store that will be used by JSObjectValuesProxy objects.
Definition JSObjectValuesProxy.hh:23
_PyDictViewObject dv
Definition JSObjectValuesProxy.hh:24