123 "Base class to define iterators.\n"
125 ".. method:: __init__()\n"
127 " Default constructor.");
131 static const char *kwlist[] = {
nullptr};
133 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"", (
char **)kwlist)) {
143 Py_TYPE(
self)->tp_free((PyObject *)
self);
148 return PyUnicode_FromFormat(
"type: %s - address: %p", Py_TYPE(
self)->tp_name,
self->it);
152 ".. method:: increment()\n"
154 " Makes the iterator point the next element.");
158 if (
self->it->isEnd()) {
159 PyErr_SetString(PyExc_RuntimeError,
"cannot increment any more");
162 self->it->increment();
167 ".. method:: decrement()\n"
169 " Makes the iterator point the previous element.");
173 if (
self->it->isBegin()) {
174 PyErr_SetString(PyExc_RuntimeError,
"cannot decrement any more");
177 self->it->decrement();
184 {
nullptr,
nullptr, 0,
nullptr},
190 "The string of the name of this iterator.\n"
196 return PyUnicode_FromString(Py_TYPE(
self)->tp_name);
200 "True if the iterator points to the first element.\n"
210 "True if the iterator points to the last element.\n"
220 {
"name", (getter)
Iterator_name_get, (setter)
nullptr, Iterator_name_doc,
nullptr},
223 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
229 PyVarObject_HEAD_INIT(
nullptr, 0)
"Iterator",
247 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