Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
CPyCppyy::Utility Namespace Reference

Classes

struct  PyError_t
 
struct  PyOperators
 

Enumerations

enum  ArgPreference { kNone , kPointer , kReference , kValue }
 

Functions

bool AddToClass (PyObject *pyclass, const char *label, const char *func)
 
bool AddToClass (PyObject *pyclass, const char *label, PyCallable *pyfunc)
 
bool AddToClass (PyObject *pyclass, const char *label, PyCFunction cfunc, int flags=METH_VARARGS)
 
std::string ClassName (PyObject *pyobj)
 
void ConstructCallbackPreamble (const std::string &retType, const std::vector< std::string > &argtypes, std::ostringstream &code)
 
void ConstructCallbackReturn (const std::string &retType, int nArgs, std::ostringstream &code)
 
std::string ConstructTemplateArgs (PyObject *pyname, PyObject *tpArgs, PyObject *args=nullptr, ArgPreference=kNone, int argoff=0, int *pcnt=nullptr)
 
size_t FetchError (std::vector< PyError_t > &, bool is_cpp=false)
 
PyCallableFindBinaryOperator (const std::string &lcname, const std::string &rcname, const char *op, Cppyy::TCppScope_t scope=0, bool reverse=false)
 
PyCallableFindBinaryOperator (PyObject *left, PyObject *right, const char *op, Cppyy::TCppScope_t scope=0)
 
PyCallableFindUnaryOperator (PyObject *pyclass, const char *op)
 
PyObjectFuncPtr2StdFunction (const std::string &retType, const std::string &signature, void *address)
 
Py_ssize_t GetBuffer (PyObject *pyobject, char tc, int size, void *&buf, bool check=true)
 
bool IncludePython ()
 
bool InitProxy (PyObject *module, PyTypeObject *pytype, const char *name)
 
bool IsSTLIterator (const std::string &classname)
 
std::string MapOperatorName (const std::string &name, bool bTakesParames, bool *stubbed=nullptr)
 
PyObjectPyErr_Occurred_WithGIL ()
 
void SetDetailedException (std::vector< PyError_t > &errors, PyObject *topmsg, PyObject *defexc)
 

Enumeration Type Documentation

◆ ArgPreference

Enumerator
kNone 
kPointer 
kReference 
kValue 

Definition at line 39 of file Utility.h.

Function Documentation

◆ AddToClass() [1/3]

bool CPyCppyy::Utility::AddToClass ( PyObject pyclass,
const char *  label,
const char *  func 
)

Definition at line 217 of file Utility.cxx.

◆ AddToClass() [2/3]

bool CPyCppyy::Utility::AddToClass ( PyObject pyclass,
const char *  label,
PyCallable pyfunc 
)

Definition at line 233 of file Utility.cxx.

◆ AddToClass() [3/3]

bool CPyCppyy::Utility::AddToClass ( PyObject pyclass,
const char *  label,
PyCFunction  cfunc,
int  flags = METH_VARARGS 
)

Definition at line 182 of file Utility.cxx.

◆ ClassName()

std::string CPyCppyy::Utility::ClassName ( PyObject pyobj)

Definition at line 997 of file Utility.cxx.

◆ ConstructCallbackPreamble()

void CPyCppyy::Utility::ConstructCallbackPreamble ( const std::string &  retType,
const std::vector< std::string > &  argtypes,
std::ostringstream &  code 
)

Definition at line 629 of file Utility.cxx.

◆ ConstructCallbackReturn()

void CPyCppyy::Utility::ConstructCallbackReturn ( const std::string &  retType,
int  nArgs,
std::ostringstream &  code 
)

Definition at line 695 of file Utility.cxx.

◆ ConstructTemplateArgs()

std::string CPyCppyy::Utility::ConstructTemplateArgs ( PyObject pyname,
PyObject tpArgs,
PyObject args = nullptr,
ArgPreference  pref = kNone,
int  argoff = 0,
int pcnt = nullptr 
)

Definition at line 580 of file Utility.cxx.

◆ FetchError()

size_t CPyCppyy::Utility::FetchError ( std::vector< PyError_t > &  errors,
bool  is_cpp = false 
)

Definition at line 1074 of file Utility.cxx.

◆ FindBinaryOperator() [1/2]

CPyCppyy::PyCallable * CPyCppyy::Utility::FindBinaryOperator ( const std::string &  lcname,
const std::string &  rcname,
const char *  op,
Cppyy::TCppScope_t  scope = 0,
bool  reverse = false 
)

Definition at line 315 of file Utility.cxx.

◆ FindBinaryOperator() [2/2]

CPyCppyy::PyCallable * CPyCppyy::Utility::FindBinaryOperator ( PyObject left,
PyObject right,
const char *  op,
Cppyy::TCppScope_t  scope = 0 
)

Definition at line 294 of file Utility.cxx.

◆ FindUnaryOperator()

CPyCppyy::PyCallable * CPyCppyy::Utility::FindUnaryOperator ( PyObject pyclass,
const char *  op 
)

Definition at line 279 of file Utility.cxx.

◆ FuncPtr2StdFunction()

PyObject * CPyCppyy::Utility::FuncPtr2StdFunction ( const std::string &  retType,
const std::string &  signature,
void *  address 
)

Definition at line 732 of file Utility.cxx.

◆ GetBuffer()

Py_ssize_t CPyCppyy::Utility::GetBuffer ( PyObject pyobject,
char  tc,
int  size,
void *&  buf,
bool  check = true 
)

Definition at line 808 of file Utility.cxx.

◆ IncludePython()

bool CPyCppyy::Utility::IncludePython ( )

Definition at line 1163 of file Utility.cxx.

◆ InitProxy()

bool CPyCppyy::Utility::InitProxy ( PyObject module,
PyTypeObject *  pytype,
const char *  name 
)

Definition at line 788 of file Utility.cxx.

◆ IsSTLIterator()

bool CPyCppyy::Utility::IsSTLIterator ( const std::string &  classname)

Definition at line 1018 of file Utility.cxx.

◆ MapOperatorName()

std::string CPyCppyy::Utility::MapOperatorName ( const std::string &  name,
bool  bTakesParames,
bool stubbed = nullptr 
)

Definition at line 932 of file Utility.cxx.

◆ PyErr_Occurred_WithGIL()

PyObject * CPyCppyy::Utility::PyErr_Occurred_WithGIL ( )

Definition at line 1054 of file Utility.cxx.

◆ SetDetailedException()

void CPyCppyy::Utility::SetDetailedException ( std::vector< PyError_t > &  errors,
PyObject topmsg,
PyObject defexc 
)

Definition at line 1086 of file Utility.cxx.