48 PyObject *pydtype = PyTuple_GetItem(args, 0);
53 std::stringstream code;
54 code <<
"*((size_t*)" << std::showbase << (uintptr_t)&
size <<
") = (size_t)sizeof(" << dtype <<
")";
74 PyObject *pyobj = PyTuple_GetItem(args, 0);
76 auto cppobj = instance->GetObject();
79 PyObject *pycppname = PyTuple_GetItem(args, 1);
83 PyObject *pymethodname = PyTuple_GetItem(args, 2);
87 uintptr_t pointer = 0;
88 std::stringstream code;
89 code <<
"*((intptr_t*)" << std::showbase << (uintptr_t)&pointer <<
") = reinterpret_cast<uintptr_t>(reinterpret_cast<"
90 << cppname <<
"*>(" << std::showbase << (uintptr_t)cppobj <<
")->" << methodname <<
"())";
94 PyObject *pypointer = PyLong_FromUnsignedLongLong(pointer);
122 Py_XDECREF(derivedMethod);
127 if (!mro || !PyTuple_Check(mro)) {
129 Py_DECREF(derivedMethod);
134 for (
int i = 1; i < PyTuple_GET_SIZE(mro); ++i) {
135 baseMethod = (
CPPOverload *)PyObject_GetAttrString(PyTuple_GET_ITEM(mro, i),
const_cast<char *
>(method));
145 Py_DECREF(baseMethod);
146 baseMethod =
nullptr;
152 Py_XDECREF(baseMethod);
153 Py_DECREF(derivedMethod);
161 Py_DECREF(baseMethod);
162 Py_DECREF(derivedMethod);
180 PyObject *pyclass = PyTuple_GetItem(args, 0);
#define CPyCppyy_PyText_AsString
#define CPyCppyy_PyText_FromString
static bool AddUsingToClass(PyObject *pyclass, const char *method)
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
void AdoptMethod(PyCallable *pc)
MethodInfo_t * fMethodInfo
Set of helper functions that are invoked from the pythonizors, on the Python side.
bool CPPOverload_Check(T *object)
PyObject * GetEndianess(PyObject *self, PyObject *args)
Get endianess of the system.
PyObject * GetDataPointer(PyObject *self, PyObject *args)
Get pointer to the data of an object.
PyObject * GetSizeOfType(PyObject *self, PyObject *args)
Get size of C++ data-type.
PyObject * AddUsingToClass(PyObject *self, PyObject *args)
Add base class overloads of a given method to a derived class.
CPPOverload::Methods_t fMethods