109 "Base class to define iterators.\n"
111 ".. method:: __init__()\n"
113 " Default constructor.");
117 static const char *kwlist[] = {
nullptr};
119 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"", (
char **)kwlist)) {
129 Py_TYPE(
self)->tp_free((PyObject *)
self);
134 return PyUnicode_FromFormat(
"type: %s - address: %p", Py_TYPE(
self)->tp_name,
self->it);
138 ".. method:: increment()\n"
140 " Makes the iterator point the next element.");
144 if (
self->it->isEnd()) {
145 PyErr_SetString(PyExc_RuntimeError,
"cannot increment any more");
148 self->it->increment();
153 ".. method:: decrement()\n"
155 " Makes the iterator point the previous element.");
159 if (
self->it->isBegin()) {
160 PyErr_SetString(PyExc_RuntimeError,
"cannot decrement any more");
163 self->it->decrement();
170 {
nullptr,
nullptr, 0,
nullptr},
176 "The string of the name of this iterator.\n"
182 return PyUnicode_FromString(Py_TYPE(
self)->tp_name);
186 "True if the iterator points to the first element.\n"
196 "True if the iterator points to the last element.\n"
206 {
"name", (getter)
Iterator_name_get, (setter)
nullptr, Iterator_name_doc,
nullptr},
209 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
215 PyVarObject_HEAD_INIT(
nullptr, 0)
"Iterator",
233 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
PyTypeObject AdjacencyIterator_Type
PyTypeObject ChainPredicateIterator_Type
PyTypeObject ChainSilhouetteIterator_Type
PyTypeObject ChainingIterator_Type
PyObject * PyBool_from_bool(bool b)
PyTypeObject CurvePointIterator_Type
PyTypeObject Interface0DIterator_Type
static PyObject * Iterator_name_get(BPy_Iterator *self, void *UNUSED(closure))
static PyObject * Iterator_decrement(BPy_Iterator *self)
static PyGetSetDef BPy_Iterator_getseters[]
static PyObject * Iterator_repr(BPy_Iterator *self)
static PyObject * Iterator_is_end_get(BPy_Iterator *self, void *UNUSED(closure))
static PyMethodDef BPy_Iterator_methods[]
static void Iterator_dealloc(BPy_Iterator *self)
static PyObject * Iterator_is_begin_get(BPy_Iterator *self, void *UNUSED(closure))
static PyObject * Iterator_increment(BPy_Iterator *self)
static int Iterator_init(BPy_Iterator *self, PyObject *args, PyObject *kwds)
PyTypeObject Iterator_Type
int Iterator_Init(PyObject *module)
PyDoc_STRVAR(Iterator_doc, "Base class to define iterators.\n" "\n" ".. method:: __init__()\n" "\n" " Default constructor.")
PyTypeObject SVertexIterator_Type
PyTypeObject StrokeVertexIterator_Type
PyTypeObject ViewEdgeIterator_Type
PyTypeObject orientedViewEdgeIterator_Type
static struct PyModuleDef module