67 PyModule_AddObjectRef(
83 PyModule_AddObjectRef(
89 PyModule_AddObjectRef(
100 "Base class to define iterators.\n"
102 ".. method:: __init__()\n"
104 " Default constructor.\n");
107 static const char *kwlist[] = {
nullptr};
109 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"", (
char **)kwlist)) {
119 Py_TYPE(
self)->tp_free((PyObject *)
self);
124 return PyUnicode_FromFormat(
"type: %s - address: %p", Py_TYPE(
self)->tp_name,
self->it);
129 Iterator_increment_doc,
130 ".. method:: increment()\n"
132 " Makes the iterator point the next element.\n");
135 if (
self->it->isEnd()) {
136 PyErr_SetString(PyExc_RuntimeError,
"cannot increment any more");
139 self->it->increment();
145 Iterator_decrement_doc,
146 ".. method:: decrement()\n"
148 " Makes the iterator point the previous element.\n");
151 if (
self->it->isBegin()) {
152 PyErr_SetString(PyExc_RuntimeError,
"cannot decrement any more");
155 self->it->decrement();
161# pragma clang diagnostic push
162# pragma clang diagnostic ignored "-Wcast-function-type"
164# pragma GCC diagnostic push
165# pragma GCC diagnostic ignored "-Wcast-function-type"
172 {
nullptr,
nullptr, 0,
nullptr},
177# pragma clang diagnostic pop
179# pragma GCC diagnostic pop
188 "The string of the name of this iterator.\n"
193 return PyUnicode_FromString(Py_TYPE(
self)->tp_name);
198 Iterator_is_begin_doc,
199 "True if the iterator points to the first element.\n"
210 "True if the iterator points to the last element.\n"
219 {
"name", (getter)
Iterator_name_get, (setter)
nullptr, Iterator_name_doc,
nullptr},
222 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
228 PyVarObject_HEAD_INIT(
nullptr, 0)
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 PyGetSetDef BPy_Iterator_getseters[]
static PyObject * Iterator_increment(BPy_Iterator *self)
static PyObject * Iterator_is_end_get(BPy_Iterator *self, void *)
static PyMethodDef BPy_Iterator_methods[]
static void Iterator_dealloc(BPy_Iterator *self)
static PyObject * Iterator_is_begin_get(BPy_Iterator *self, void *)
PyDoc_STRVAR(Iterator_doc, "Base class to define iterators.\n" "\n" ".. method:: __init__()\n" "\n" " Default constructor.\n")
static int Iterator_init(BPy_Iterator *self, PyObject *args, PyObject *kwds)
PyTypeObject Iterator_Type
int Iterator_Init(PyObject *module)
static PyObject * Iterator_repr(BPy_Iterator *self)
static PyObject * Iterator_decrement(BPy_Iterator *self)
static PyObject * Iterator_name_get(BPy_Iterator *self, void *)
PyTypeObject SVertexIterator_Type
PyTypeObject StrokeVertexIterator_Type
PyTypeObject ViewEdgeIterator_Type
PyTypeObject orientedViewEdgeIterator_Type
static struct PyModuleDef module