9#if PY_VERSION_HEX >= 0x03000000
11#define PyMethod_GET_CLASS(meth) Py_None
20 (
char*)
"cppyy.Double",
21 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
22 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES |
24 (
char*)
"CPyCppyy float object for pass by reference",
25 0, 0, 0, 0, 0, 0, 0, 0, 0,
27 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
28#if PY_VERSION_HEX >= 0x02030000
31#if PY_VERSION_HEX >= 0x02060000
34#if PY_VERSION_HEX >= 0x03040000
43 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
44 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES |
46#
if PY_VERSION_HEX >= 0x03040000
47 | Py_TPFLAGS_LONG_SUBCLASS
50 (
char*)
"CPyCppyy long object for pass by reference",
51 0, 0, 0, 0, 0, 0, 0, 0, 0,
53 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
54#if PY_VERSION_HEX >= 0x02030000
57#if PY_VERSION_HEX >= 0x02060000
60#if PY_VERSION_HEX >= 0x03040000
69 if (!PyArg_ParseTuple(args,
const_cast<char*
>(
"|L"), &addr))
76 (
char*)
"cppyy.TypedefPointerToClass",
78 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
82 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
83#
if PY_VERSION_HEX >= 0x02030000
86#
if PY_VERSION_HEX >= 0x02060000
89#
if PY_VERSION_HEX >= 0x03040000
97#ifndef PyMethod_MAXFREELIST
98#define PyMethod_MAXFREELIST 256
103#
if PY_VERSION_HEX < 0x03000000
111 if (!PyCallable_Check(func)) {
112 PyErr_Format(PyExc_SystemError,
113 "%s:%d: bad argument to internal function", __FILE__, __LINE__);
119 free_list = (PyMethodObject*)(im->im_self);
128 im->im_weakreflist =
nullptr;
133#if PY_VERSION_HEX < 0x03000000
135 im->im_class = pyclass;
137 PyObject_GC_Track(im);
146 PyObject_GC_UnTrack(im);
148 if (im->im_weakreflist !=
nullptr)
149 PyObject_ClearWeakRefs((
PyObject*)im);
151 Py_DECREF(im->im_func);
152 Py_XDECREF(im->im_self);
153#if PY_VERSION_HEX < 0x03000000
154 Py_XDECREF(im->im_class);
173 PyObject* self = PyMethod_GET_SELF(meth);
179 PyObject* pyclass = PyMethod_GET_CLASS(meth);
180 if (1 <= argc && PyObject_IsInstance(PyTuple_GET_ITEM(args, 0), pyclass) == 1) {
181 self = PyTuple_GET_ITEM(args, 0);
183 PyObject* newArgs = PyTuple_New(argc-1);
184 for (
int i = 1; i < argc; ++i) {
187 PyTuple_SET_ITEM(newArgs, i-1,
v);
193 return PyMethod_Type.tp_call(meth, args, kw);
198 PyCFunctionObject* func = (PyCFunctionObject*)PyMethod_GET_FUNCTION(meth);
204 func->m_self =
nullptr;
215 if (PyMethod_GET_SELF(meth)
216#
if PY_VERSION_HEX < 0x03000000
217 || (PyMethod_GET_CLASS(meth) &&
218 !PyObject_IsSubclass(pyclass, PyMethod_GET_CLASS(meth)))
234 (
char*)
"cppyy.InstanceMethod",
237 0, 0, 0, 0, 0, 0, 0, 0, 0,
240 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES |
242 (
char*)
"CPyCppyy custom instance method (internal)",
243 0, 0, 0, 0, 0, 0, 0, 0, 0,
247 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
248#
if PY_VERSION_HEX >= 0x02030000
251#
if PY_VERSION_HEX >= 0x02060000
254#
if PY_VERSION_HEX >= 0x03040000
285 (
char*)
"cppyy.indexiter",
289 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
297 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
298#
if PY_VERSION_HEX >= 0x02030000
301#
if PY_VERSION_HEX >= 0x02060000
304#
if PY_VERSION_HEX >= 0x03040000
344 (
char*)
"cppyy.vectoriter",
348 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
356 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
357#
if PY_VERSION_HEX >= 0x02030000
360#
if PY_VERSION_HEX >= 0x02060000
363#
if PY_VERSION_HEX >= 0x03040000
#define CPyCppyy_PyCFunction_Call
#define PyVarObject_HEAD_INIT(type, size)
#define PyMethod_MAXFREELIST
typedef void(GLAPIENTRYP _GLUfuncptr)(void)
virtual PyObject * FromMemory(void *address)
Set of helper functions that are invoked from the pythonizors, on the Python side.
static PyObject * indexiter_iternext(indexiterobject *ii)
PyObject * CustomInstanceMethod_New(PyObject *func, PyObject *self, PyObject *pyclass)
PyTypeObject VectorIter_Type
PyTypeObject CustomInstanceMethod_Type
static PyMethodObject * free_list
PyTypeObject RefFloat_Type
Custom "builtins," detectable by type, for pass by ref and improved performance.
PyTypeObject TypedefPointerToClass_Type
PyObject * BindCppObjectNoCast(Cppyy::TCppObject_t object, Cppyy::TCppType_t klass, const unsigned flags=0)
static void vectoriter_dealloc(vectoriterobject *vi)
static int indexiter_traverse(indexiterobject *ii, visitproc visit, void *arg)
static PyObject * im_descr_get(PyObject *meth, PyObject *obj, PyObject *pyclass)
static PyObject * vectoriter_iternext(vectoriterobject *vi)
bool CPPInstance_Check(T *object)
PyTypeObject IndexIter_Type
static void indexiter_dealloc(indexiterobject *ii)
static PyObject * tpc_call(typedefpointertoclassobject *self, PyObject *args, PyObject *)
static void im_dealloc(PyMethodObject *im)
static PyObject * im_call(PyObject *meth, PyObject *args, PyObject *kw)
PyObject_HEAD PyObject * ii_container
PyObject_HEAD Cppyy::TCppType_t fType
Cppyy::TCppType_t vi_klass
CPyCppyy::Converter * vi_converter