4#ifndef PYROOT_UTILITY_H
5#define PYROOT_UTILITY_H
28 int flags = METH_VARARGS );
36 const char* op,
const char* label,
const char* alt_label = NULL );
38 const char* op,
const char* label,
const char* alt_label = NULL );
40 const char* op,
const char* label,
const char* alt_label = NULL );
69 const char* retType,
const std::vector<std::string>& signature,
const char* callback );
PyDictEntry *(* dict_lookup_func)(PyDictObject *, PyObject *, Long_t)
unsigned long long ULong64_t
PyGILState_STATE m_GILState
PyObject * RemoveGUIEventInputHook()
Bool_t InitProxy(PyObject *module, PyTypeObject *pytype, const char *name)
Initialize a proxy class for use by python, and add it to the ROOT module.
void ErrMsgHandler(int level, Bool_t abort, const char *location, const char *msg)
Translate ROOT error/warning to python.
Bool_t AddBinaryOperator(PyObject *left, PyObject *right, const char *op, const char *label, const char *alt_label=NULL)
Install the named operator (op) into the left object's class if such a function exists as a global ov...
PyObject * PyErr_Occurred_WithGIL()
Re-acquire the GIL before calling PyErr_Occurred() in case it has been released; note that the p2....
Bool_t AddUsingToClass(PyObject *pyclass, const char *method)
Helper to add base class methods to the derived class one (this covers the 'using' cases,...
std::string MapOperatorName(const std::string &name, Bool_t bTakesParames)
Map the given C++ operator name on the python equivalent.
PyObject * InstallGUIEventInputHook()
const std::string Compound(const std::string &name)
Break down the compound of a fully qualified type name.
int GetBuffer(PyObject *pyobject, char tc, int size, void *&buf, Bool_t check=kTRUE)
Retrieve a linear buffer pointer from the given pyobject.
PyObject * BuildTemplateName(PyObject *pyname, PyObject *tpArgs, int argoff, PyObject *args=nullptr, ArgPreference=kNone, int *pcnt=nullptr, bool inferredTypes=false)
Helper to construct the "< type, type, ... >" part of a templated name (either for a class as in Make...
Bool_t AddToClass(PyObject *pyclass, const char *label, PyCFunction cfunc, int flags=METH_VARARGS)
Add the given function to the class under name 'label'.
void ErrMsgCallback(char *msg)
Translate CINT error/warning into python equivalent.
Py_ssize_t ArraySize(const std::string &name)
Extract size from an array type, if available.
void * CreateWrapperMethod(PyObject *pyfunc, Long_t user, const char *retType, const std::vector< std::string > &signature, const char *callback)
Compile a function on the fly and return a function pointer for use on C-APIs.
const std::string ClassName(PyObject *pyobj)
Retrieve the class name from the given python object (which may be just an instance of the class).
R__EXTERN dict_lookup_func gDictLookupOrg
ULong64_t PyLongOrInt_AsULong64(PyObject *pyobject)
Convert <pyobject> to C++ unsigned long long, with bounds checking.
R__EXTERN Bool_t gDictLookupActive
ULong_t PyLongOrInt_AsULong(PyObject *pyobject)