Logo ROOT   master
Reference Guide
Utility.h File Reference
#include <string>
#include <vector>
Include dependency graph for Utility.h:
This graph shows which files directly or indirectly include this file:

Classes

class  PyROOT::PyGILRAII
 

Namespaces

 PyROOT
 
 PyROOT::Utility
 

Enumerations

enum  PyROOT::Utility::ArgPreference { PyROOT::Utility::kNone, PyROOT::Utility::kPointer, PyROOT::Utility::kReference, PyROOT::Utility::kValue }
 

Functions

Bool_t PyROOT::Utility::AddBinaryOperator (PyObject *left, PyObject *right, const char *op, const char *label, const char *alt_label=NULL, bool lazy=false)
 Install the named operator (op) into the left object's class if such a function exists as a global overload; a label must be given if the operator is not in gC2POperatorMapping (i.e. More...
 
Bool_t PyROOT::Utility::AddBinaryOperator (PyObject *pyclass, const char *op, const char *label, const char *alt_label=NULL, bool lazy=false)
 Install binary operator op in pyclass, working on two instances of pyclass. More...
 
Bool_t PyROOT::Utility::AddBinaryOperator (PyObject *pyclass, const std::string &lcname, const std::string &rcname, const char *op, const char *label, const char *alt_label=NULL, bool lazy=false)
 
Bool_t PyROOT::Utility::AddToClass (PyObject *pyclass, const char *label, PyCFunction cfunc, int flags=METH_VARARGS)
 Add the given function to the class under name 'label'. More...
 
Bool_t PyROOT::Utility::AddToClass (PyObject *pyclass, const char *label, const char *func)
 Add the given function to the class under name 'label'. More...
 
Bool_t PyROOT::Utility::AddToClass (PyObject *pyclass, const char *label, PyCallable *pyfunc)
 Add the given function to the class under name 'label'. More...
 
Bool_t PyROOT::Utility::AddUsingToClass (PyObject *pyclass, const char *method)
 Helper to add base class methods to the derived class one (this covers the 'using' cases, which the dictionary does not provide). More...
 
Py_ssize_t PyROOT::Utility::ArraySize (const std::string &name)
 Extract size from an array type, if available. More...
 
PyObjectPyROOT::Utility::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 MakeRootTemplateClass in RootModule.cxx) or for method lookup (as in TemplatedMemberHook, below). More...
 
const std::string PyROOT::Utility::ClassName (PyObject *pyobj)
 Retrieve the class name from the given python object (which may be just an instance of the class). More...
 
const std::string PyROOT::Utility::Compound (const std::string &name)
 Break down the compound of a fully qualified type name. More...
 
voidPyROOT::Utility::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. More...
 
void PyROOT::Utility::ErrMsgCallback (char *msg)
 Translate CINT error/warning into python equivalent. More...
 
void PyROOT::Utility::ErrMsgHandler (int level, Bool_t abort, const char *location, const char *msg)
 Translate ROOT error/warning to python. More...
 
int PyROOT::Utility::GetBuffer (PyObject *pyobject, char tc, int size, void *&buf, Bool_t check=kTRUE)
 Retrieve a linear buffer pointer from the given pyobject. More...
 
Bool_t PyROOT::Utility::InitProxy (PyObject *module, PyTypeObject *pytype, const char *name)
 Initialize a proxy class for use by python, and add it to the ROOT module. More...
 
PyObjectPyROOT::Utility::InstallGUIEventInputHook ()
 
std::string PyROOT::Utility::MapOperatorName (const std::string &name, Bool_t bTakesParames)
 Map the given C++ operator name on the python equivalent. More...
 
PyObjectPyROOT::Utility::PyErr_Occurred_WithGIL ()
 Re-acquire the GIL before calling PyErr_Occurred() in case it has been released; note that the p2.2 code assumes that there are no callbacks in C++ to python (or at least none returning errors). More...
 
ULong_t PyROOT::PyLongOrInt_AsULong (PyObject *pyobject)
 
ULong64_t PyROOT::PyLongOrInt_AsULong64 (PyObject *pyobject)
 Convert <pyobject> to C++ unsigned long long, with bounds checking. More...
 
PyObjectPyROOT::Utility::RemoveGUIEventInputHook ()
 

Variables

R__EXTERN Bool_t PyROOT::gDictLookupActive = kFALSE
 
R__EXTERN dict_lookup_func PyROOT::gDictLookupOrg = 0