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,
83 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
84#
if PY_VERSION_HEX >= 0x02030000
87#
if PY_VERSION_HEX >= 0x02060000
90#
if PY_VERSION_HEX >= 0x03040000
98#ifndef PyMethod_MAXFREELIST
99#define PyMethod_MAXFREELIST 256
104#
if PY_VERSION_HEX < 0x03000000
112 if (!PyCallable_Check(func)) {
113 PyErr_Format(PyExc_SystemError,
114 "%s:%d: bad argument to internal function", __FILE__, __LINE__);
120 free_list = (PyMethodObject*)(im->im_self);
129 im->im_weakreflist =
nullptr;
134#if PY_VERSION_HEX < 0x03000000
136 im->im_class = pyclass;
138 PyObject_GC_Track(im);
147 PyObject_GC_UnTrack(im);
149 if (im->im_weakreflist !=
nullptr)
150 PyObject_ClearWeakRefs((
PyObject*)im);
152 Py_DECREF(im->im_func);
153 Py_XDECREF(im->im_self);
154#if PY_VERSION_HEX < 0x03000000
155 Py_XDECREF(im->im_class);
174 PyObject* self = PyMethod_GET_SELF(meth);
180 PyObject* pyclass = PyMethod_GET_CLASS(meth);
181 if (1 <= argc && PyObject_IsInstance(PyTuple_GET_ITEM(args, 0), pyclass) == 1) {
182 self = PyTuple_GET_ITEM(args, 0);
184 PyObject* newArgs = PyTuple_New(argc-1);
185 for (
int i = 1; i < argc; ++i) {
188 PyTuple_SET_ITEM(newArgs, i-1,
v);
194 return PyMethod_Type.tp_call(meth, args, kw);
199 PyCFunctionObject* func = (PyCFunctionObject*)PyMethod_GET_FUNCTION(meth);
205 func->m_self =
nullptr;
216 if (PyMethod_GET_SELF(meth)
217#
if PY_VERSION_HEX < 0x03000000
218 || (PyMethod_GET_CLASS(meth) &&
219 !PyObject_IsSubclass(pyclass, PyMethod_GET_CLASS(meth)))
235 (
char*)
"cppyy.InstanceMethod",
238 0, 0, 0, 0, 0, 0, 0, 0, 0,
241 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES |
243 (
char*)
"CPyCppyy custom instance method (internal)",
244 0, 0, 0, 0, 0, 0, 0, 0, 0,
248 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
249#
if PY_VERSION_HEX >= 0x02030000
252#
if PY_VERSION_HEX >= 0x02060000
255#
if PY_VERSION_HEX >= 0x03040000
286 (
char*)
"cppyy.indexiter",
290 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
298 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
299#
if PY_VERSION_HEX >= 0x02030000
302#
if PY_VERSION_HEX >= 0x02060000
305#
if PY_VERSION_HEX >= 0x03040000
345 (
char*)
"cppyy.vectoriter",
349 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
357 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
358#
if PY_VERSION_HEX >= 0x02030000
361#
if PY_VERSION_HEX >= 0x02060000
364#
if PY_VERSION_HEX >= 0x03040000
#define PyVarObject_HEAD_INIT(type, size)
#define PyMethod_MAXFREELIST
typedef void((*Func_t)())
virtual PyObject * FromMemory(void *address)
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