14#define CustomInstanceMethod_GET_SELF(meth) reinterpret_cast<PyMethodObject *>(meth)->im_self
15#define CustomInstanceMethod_GET_FUNCTION(meth) reinterpret_cast<PyMethodObject *>(meth)->im_func
16#if PY_VERSION_HEX >= 0x03000000
18#define CustomInstanceMethod_GET_CLASS(meth) Py_None
20#define CustomInstanceMethod_GET_CLASS(meth) PyMethod_GET_CLASS(meth)
25#if PY_VERSION_HEX < 0x03000000
29 (
char*)
"cppyy.Double",
30 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
31 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES |
33 (
char*)
"CPyCppyy float object for pass by reference",
34 0, 0, 0, 0, 0, 0, 0, 0, 0,
36 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
37#if PY_VERSION_HEX >= 0x02030000
40#if PY_VERSION_HEX >= 0x02060000
43#if PY_VERSION_HEX >= 0x03040000
52 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
53 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES |
55#
if PY_VERSION_HEX >= 0x03040000
56 | Py_TPFLAGS_LONG_SUBCLASS
59 (
char*)
"CPyCppyy long object for pass by reference",
60 0, 0, 0, 0, 0, 0, 0, 0, 0,
62 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
63#if PY_VERSION_HEX >= 0x02030000
66#if PY_VERSION_HEX >= 0x02060000
69#if PY_VERSION_HEX >= 0x03040000
79 if (!PyArg_ParseTuple(args,
const_cast<char*
>(
"|L"), &addr))
106 {(
char*)
"__name__", (getter)
tptc_name,
nullptr,
nullptr,
nullptr},
107 {(
char*)
"__cpp_name__", (getter)
tptc_getcppname,
nullptr,
nullptr,
nullptr},
108 {(
char*)
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
114 (
char*)
"cppyy.TypedefPointerToClass",
129 PyObject_GenericGetAttr,
130 PyObject_GenericSetAttr,
158#
if PY_VERSION_HEX >= 0x02030000
161#
if PY_VERSION_HEX >= 0x02060000
164#
if PY_VERSION_HEX >= 0x03040000
167#
if PY_VERSION_HEX >= 0x03080000
176#ifndef PyMethod_MAXFREELIST
177#define PyMethod_MAXFREELIST 256
182#
if PY_VERSION_HEX < 0x03000000
190 if (!PyCallable_Check(func)) {
191 PyErr_Format(PyExc_SystemError,
192 "%s:%d: bad argument to internal function", __FILE__, __LINE__);
198 free_list = (PyMethodObject*)(im->im_self);
207 im->im_weakreflist =
nullptr;
212#if PY_VERSION_HEX < 0x03000000
214 im->im_class = pyclass;
216 PyObject_GC_Track(im);
225 PyObject_GC_UnTrack(im);
227 if (im->im_weakreflist !=
nullptr)
228 PyObject_ClearWeakRefs((
PyObject*)im);
230 Py_DECREF(im->im_func);
231 Py_XDECREF(im->im_self);
232#if PY_VERSION_HEX < 0x03000000
233 Py_XDECREF(im->im_class);
259 if (1 <= argc && PyObject_IsInstance(PyTuple_GET_ITEM(args, 0), pyclass) == 1) {
260 self = PyTuple_GET_ITEM(args, 0);
262 PyObject* newArgs = PyTuple_New(argc-1);
263 for (
int i = 1; i < argc; ++i) {
266 PyTuple_SET_ITEM(newArgs, i-1,
v);
272 return PyMethod_Type.tp_call(meth, args, kw);
283 func->m_self =
nullptr;
295#
if PY_VERSION_HEX < 0x03000000
313 (
char*)
"cppyy.InstanceMethod",
316 0, 0, 0, 0, 0, 0, 0, 0, 0,
319 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES |
321 (
char*)
"CPyCppyy custom instance method (internal)",
322 0, 0, 0, 0, 0, 0, 0, 0, 0,
326 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
327#
if PY_VERSION_HEX >= 0x02030000
330#
if PY_VERSION_HEX >= 0x02060000
333#
if PY_VERSION_HEX >= 0x03040000
336#
if PY_VERSION_HEX >= 0x03080000
345 PyObject_GC_UnTrack(ii);
369 (
char*)
"cppyy.indexiter",
373 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
381 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
382#
if PY_VERSION_HEX >= 0x02030000
385#
if PY_VERSION_HEX >= 0x02060000
388#
if PY_VERSION_HEX >= 0x03040000
391#
if PY_VERSION_HEX >= 0x03080000
435 (
char*)
"cppyy.vectoriter",
439 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
447 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
448#
if PY_VERSION_HEX >= 0x02030000
451#
if PY_VERSION_HEX >= 0x02060000
454#
if PY_VERSION_HEX >= 0x03040000
457#
if PY_VERSION_HEX >= 0x03080000
#define CPYCPPYY_PYTYPE_TAIL
#define CPyCppyy_PyCFunction_Call
static PyObject * PyObject_CallMethodOneArg(PyObject *obj, PyObject *name, PyObject *arg)
#define CPyCppyy_PyText_FromString
#define PyVarObject_HEAD_INIT(type, size)
#define PyMethod_MAXFREELIST
#define CustomInstanceMethod_GET_SELF(meth)
#define CustomInstanceMethod_GET_FUNCTION(meth)
#define CustomInstanceMethod_GET_CLASS(meth)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
virtual PyObject * FromMemory(void *address)
static PyObject * indexiter_iternext(indexiterobject *ii)
PyObject * CustomInstanceMethod_New(PyObject *func, PyObject *self, PyObject *pyclass)
PyTypeObject VectorIter_Type
PyObject * GetScopeProxy(Cppyy::TCppScope_t)
PyTypeObject CustomInstanceMethod_Type
static PyMethodObject * free_list
PyTypeObject RefFloat_Type
Custom "builtins," detectable by type, for pass by ref and improved performance.
static PyGetSetDef tptc_getset[]
PyTypeObject TypedefPointerToClass_Type
static PyObject * tptc_call(typedefpointertoclassobject *self, PyObject *args, PyObject *)
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)
static PyObject * tptc_name(typedefpointertoclassobject *self, void *)
PyTypeObject IndexIter_Type
static PyObject * tptc_getcppname(typedefpointertoclassobject *self, void *)
static void indexiter_dealloc(indexiterobject *ii)
PyObject * BindCppObject(Cppyy::TCppObject_t object, Cppyy::TCppType_t klass, const unsigned flags=0)
static void im_dealloc(PyMethodObject *im)
static PyObject * im_call(PyObject *meth, PyObject *args, PyObject *kw)
RPY_EXPORTED std::string GetScopedFinalName(TCppType_t type)
PyObject_HEAD PyObject * ii_container
PyObject_HEAD Cppyy::TCppType_t fCppType
Cppyy::TCppType_t vi_klass
CPyCppyy::Converter * vi_converter