PythonMonkey   v1.0.0 (dev)
Loading...
Searching...
No Matches
JSObjectKeysProxy.hh
Go to the documentation of this file.
1
11#ifndef PythonMonkey_JSObjectKeysProxy_
12#define PythonMonkey_JSObjectKeysProxy_
13
14#include <jsapi.h>
15
16#include <Python.h>
17
18
23typedef struct {
24 _PyDictViewObject dv;
26
32public:
39
48 static int JSObjectKeysProxy_traverse(JSObjectKeysProxy *self, visitproc visit, void *arg);
49
57
64 static Py_ssize_t JSObjectKeysProxy_length(JSObjectKeysProxy *self);
65
73 static int JSObjectKeysProxy_contains(JSObjectKeysProxy *self, PyObject *key);
74
83 static PyObject *JSObjectKeysProxy_richcompare(JSObjectKeysProxy *self, PyObject *other, int op);
84
91 static PyObject *JSObjectKeysProxy_iter(JSObjectKeysProxy *self);
92
99 static PyObject *JSObjectKeysProxy_repr(JSObjectKeysProxy *self);
100
108 static PyObject *JSObjectKeysProxy_intersect(JSObjectKeysProxy *self, PyObject *other);
109
117 static PyObject *JSObjectKeysProxy_isDisjoint(JSObjectKeysProxy *self, PyObject *other);
118
126
134 static PyObject *JSObjectKeysProxy_mapping(PyObject *self, void *Py_UNUSED(ignored));
135};
136
141static PySequenceMethods JSObjectKeysProxy_sequence_methods = {
144};
145
146static PyNumberMethods JSObjectKeysProxy_number_methods = {
147 // .nb_subtract = default is fine
149 // .nb_xor = default is fine
150 // .nb_or = default is fine
151};
152
153PyDoc_STRVAR(isdisjoint_doc,
154 "Return True if the view and the given iterable have a null intersection.");
155
156PyDoc_STRVAR(reversed_keys_doc,
157 "Return a reverse iterator over the dict keys.");
158
163static PyMethodDef JSObjectKeysProxy_methods[] = {
164 {"isdisjoint", (PyCFunction)JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_isDisjoint, METH_O, isdisjoint_doc},
165 {"__reversed__", (PyCFunction)JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_iter_reverse, METH_NOARGS, reversed_keys_doc},
166 {NULL, NULL} /* sentinel */
167};
168
169static PyGetSetDef JSObjectKeysProxy_getset[] = {
170 {"mapping", JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_mapping, (setter)NULL, "dictionary that this view refers to", NULL},
171 {0}
172};
173
177extern PyTypeObject JSObjectKeysProxyType;
178
179#endif
PyDoc_STRVAR(isdisjoint_doc, "Return True if the view and the given iterable have a null intersection.")
PyTypeObject JSObjectKeysProxyType
Struct for the JSObjectKeysProxyType, used by all JSObjectKeysProxy objects.
Definition pythonmonkey.cc:243
This struct is a bundle of methods used by the JSObjectKeysProxy type.
Definition JSObjectKeysProxy.hh:31
static PyObject * JSObjectKeysProxy_repr(JSObjectKeysProxy *self)
Compute a string representation of the JSObjectKeysProxy.
Definition JSObjectKeysProxy.cc:202
static void JSObjectKeysProxy_dealloc(JSObjectKeysProxy *self)
Deallocation method (.tp_dealloc), removes the reference to the underlying JSObject before freeing th...
Definition JSObjectKeysProxy.cc:28
static int JSObjectKeysProxy_traverse(JSObjectKeysProxy *self, visitproc visit, void *arg)
.tp_traverse method
Definition JSObjectKeysProxy.cc:51
static Py_ssize_t JSObjectKeysProxy_length(JSObjectKeysProxy *self)
Length method (.sq_length), returns the number of key-value pairs in the JSObject,...
Definition JSObjectKeysProxy.cc:35
static PyObject * JSObjectKeysProxy_mapping(PyObject *self, void *Py_UNUSED(ignored))
mapping method
Definition JSObjectKeysProxy.cc:383
static int JSObjectKeysProxy_clear(JSObjectKeysProxy *self)
.tp_clear method
Definition JSObjectKeysProxy.cc:56
static PyObject * JSObjectKeysProxy_iter_reverse(JSObjectKeysProxy *self)
reverse iterator method
Definition JSObjectKeysProxy.cc:183
static PyObject * JSObjectKeysProxy_intersect(JSObjectKeysProxy *self, PyObject *other)
Set intersect operation.
Definition JSObjectKeysProxy.cc:233
static PyObject * JSObjectKeysProxy_iter(JSObjectKeysProxy *self)
Return an iterator object to make JSObjectKeysProxy iterable, emitting (key, value) tuples.
Definition JSObjectKeysProxy.cc:164
static PyObject * JSObjectKeysProxy_richcompare(JSObjectKeysProxy *self, PyObject *other, int op)
Comparison method (.tp_richcompare), returns appropriate boolean given a comparison operator and othe...
Definition JSObjectKeysProxy.cc:92
static PyObject * JSObjectKeysProxy_isDisjoint(JSObjectKeysProxy *self, PyObject *other)
Set disjoint method.
Definition JSObjectKeysProxy.cc:319
static int JSObjectKeysProxy_contains(JSObjectKeysProxy *self, PyObject *key)
Test method (.sq_contains), returns whether a key exists, used by the in operator.
Definition JSObjectKeysProxy.cc:43
The typedef for the backing store that will be used by JSObjectKeysProxy objects.
Definition JSObjectKeysProxy.hh:23
_PyDictViewObject dv
Definition JSObjectKeysProxy.hh:24