PythonMonkey   v0.8.2 (dev)
Loading...
Searching...
No Matches
JSArrayIterProxy.hh
Go to the documentation of this file.
1
12#ifndef PythonMonkey_JSArrayIterProxy_
13#define PythonMonkey_JSArrayIterProxy_
14
15
16#include <jsapi.h>
17
18#include <Python.h>
19
20
21// redeclare hidden type
22typedef struct {
23 PyObject_HEAD
26 PyListObject *it_seq; /* Set to NULL when iterator is exhausted */
28
33typedef struct {
36
42public:
49
58 static int JSArrayIterProxy_traverse(JSArrayIterProxy *self, visitproc visit, void *arg);
59
67
74 static PyObject *JSArrayIterProxy_iter(JSArrayIterProxy *self);
75
82 static PyObject *JSArrayIterProxy_next(JSArrayIterProxy *self);
83
90 static PyObject *JSArrayIterProxy_len(JSArrayIterProxy *self);
91};
92
93
94PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it)).");
95
100static PyMethodDef JSArrayIterProxy_methods[] = {
101 {"__length_hint__", (PyCFunction)JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_len, METH_NOARGS, length_hint_doc},
102 {NULL, NULL} /* sentinel */
103};
104
108extern PyTypeObject JSArrayIterProxyType;
109
110#endif
PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it)).")
PyTypeObject JSArrayIterProxyType
Struct for the JSArrayProxyType, used by all JSArrayProxy objects.
Definition pythonmonkey.cc:209
This struct is a bundle of methods used by the JSArrayProxy type.
Definition JSArrayIterProxy.hh:41
static PyObject * JSArrayIterProxy_len(JSArrayIterProxy *self)
length method
Definition JSArrayIterProxy.cc:73
static PyObject * JSArrayIterProxy_next(JSArrayIterProxy *self)
.tp_next method
Definition JSArrayIterProxy.cc:47
static void JSArrayIterProxy_dealloc(JSArrayIterProxy *self)
Deallocation method (.tp_dealloc), removes the reference to the underlying JSObject before freeing th...
Definition JSArrayIterProxy.cc:25
static int JSArrayIterProxy_clear(JSArrayIterProxy *self)
.tp_clear method
Definition JSArrayIterProxy.cc:37
static PyObject * JSArrayIterProxy_iter(JSArrayIterProxy *self)
.tp_iter method
Definition JSArrayIterProxy.cc:42
static int JSArrayIterProxy_traverse(JSArrayIterProxy *self, visitproc visit, void *arg)
.tp_traverse method
Definition JSArrayIterProxy.cc:32
The typedef for the backing store that will be used by JSArrayIterProxy objects.
Definition JSArrayIterProxy.hh:33
PyListIterObject it
Definition JSArrayIterProxy.hh:34
Definition JSArrayIterProxy.hh:22
PyListObject * it_seq
Definition JSArrayIterProxy.hh:26
PyObject_HEAD int it_index
Definition JSArrayIterProxy.hh:24
bool reversed
Definition JSArrayIterProxy.hh:25