53 UnaryPredicate0D___doc__,
54 "Base class for unary predicates that work on\n"
55 ":class:`Interface0DIterator`. A UnaryPredicate0D is a functor that\n"
56 "evaluates a condition on an Interface0DIterator and returns true or\n"
57 "false depending on whether this condition is satisfied or not. The\n"
58 "UnaryPredicate0D is used by invoking its __call__() method. Any\n"
59 "inherited class must overload the __call__() method.\n"
61 ".. method:: __init__()\n"
63 " Default constructor.\n"
65 ".. method:: __call__(it)\n"
67 " Must be overload by inherited classes.\n"
69 " :arg it: The Interface0DIterator pointing onto the Interface0D at\n"
70 " which we wish to evaluate the predicate.\n"
71 " :type it: :class:`Interface0DIterator`\n"
72 " :return: True if the condition is satisfied, false otherwise.\n"
77 static const char *kwlist[] = {
nullptr};
79 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"", (
char **)kwlist)) {
83 self->up0D->py_up0D = (PyObject *)
self;
90 Py_TYPE(
self)->tp_free((PyObject *)
self);
95 return PyUnicode_FromFormat(
"type: %s - address: %p", Py_TYPE(
self)->tp_name,
self->up0D);
102 static const char *kwlist[] = {
"it",
nullptr};
103 PyObject *py_if0D_it;
105 if (!PyArg_ParseTupleAndKeywords(
114 string class_name(Py_TYPE(
self)->tp_name);
115 PyErr_SetString(PyExc_RuntimeError, (class_name +
" has no Interface0DIterator").c_str());
119 PyErr_SetString(PyExc_TypeError,
"__call__ method not properly overridden");
122 if (
self->up0D->operator()(*if0D_it) < 0) {
123 if (!PyErr_Occurred()) {
124 string class_name(Py_TYPE(
self)->tp_name);
125 PyErr_SetString(PyExc_RuntimeError, (class_name +
" __call__ method failed").c_str());
136 UnaryPredicate0D_name_doc,
137 "The name of the unary 0D predicate.\n"
143 return PyUnicode_FromString(Py_TYPE(
self)->tp_name);
150 UnaryPredicate0D_name_doc,
152 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
158 PyVarObject_HEAD_INIT(
nullptr, 0)
177 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
178 UnaryPredicate0D___doc__,
PyObject * PyBool_from_bool(bool b)
PyTypeObject FalseUP0D_Type
PyTypeObject Interface0DIterator_Type
PyTypeObject TrueUP0D_Type
static PyObject * UnaryPredicate0D_name_get(BPy_UnaryPredicate0D *self, void *)
int UnaryPredicate0D_Init(PyObject *module)
PyTypeObject UnaryPredicate0D_Type
PyDoc_STRVAR(UnaryPredicate0D___doc__, "Base class for unary predicates that work on\n" ":class:`Interface0DIterator`. A UnaryPredicate0D is a functor that\n" "evaluates a condition on an Interface0DIterator and returns true or\n" "false depending on whether this condition is satisfied or not. The\n" "UnaryPredicate0D is used by invoking its __call__() method. Any\n" "inherited class must overload the __call__() method.\n" "\n" ".. method:: __init__()\n" "\n" " Default constructor.\n" "\n" ".. method:: __call__(it)\n" "\n" " Must be overload by inherited classes.\n" "\n" " :arg it: The Interface0DIterator pointing onto the Interface0D at\n" " which we wish to evaluate the predicate.\n" " :type it: :class:`Interface0DIterator`\n" " :return: True if the condition is satisfied, false otherwise.\n" " :rtype: bool\n")
static PyObject * UnaryPredicate0D___repr__(BPy_UnaryPredicate0D *self)
static void UnaryPredicate0D___dealloc__(BPy_UnaryPredicate0D *self)
static int UnaryPredicate0D___init__(BPy_UnaryPredicate0D *self, PyObject *args, PyObject *kwds)
static PyObject * UnaryPredicate0D___call__(BPy_UnaryPredicate0D *self, PyObject *args, PyObject *kwds)
static PyGetSetDef BPy_UnaryPredicate0D_getseters[]
static struct PyModuleDef module