15#include "../../cppyy/CPyCppyy/src/CPyCppyy.h"
16#include "../../cppyy/CPyCppyy/src/CPPInstance.h"
17#include "../../cppyy/CPyCppyy/src/Utility.h"
33 if (!PyArg_ParseTuple(args,
"O!O|i:DynamicCast", &
CPPInstance_Type, &pyclass, &pyobject, &up))
44 }
else if (PyInt_Check(pyobject) || PyLong_Check(pyobject)) {
45 address = (
void *)PyLong_AsLongLong(pyobject);
70 PyObject *pyclass = PyTuple_GetItem(args, 0);
PyObject * TClassDynamicCastPyz(PyObject *self, PyObject *args)
TClass instances represent classes, structs and namespaces in the ROOT type system.
void * DynamicCast(const TClass *base, void *obj, Bool_t up=kTRUE)
Cast obj of this class type up to baseclass cl if up is true.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
const char * GetName() const override
Returns name of object.
Py_ssize_t GetBuffer(PyObject *pyobject, char tc, int size, void *&buf, bool check=true)
bool AddToClass(PyObject *pyclass, const char *label, PyCFunction cfunc, int flags=METH_VARARGS)
PyTypeObject CPPInstance_Type
CPYCPPYY_EXTERN bool Instance_Check(PyObject *pyobject)
CPYCPPYY_EXTERN PyObject * Instance_FromVoidPtr(void *addr, const std::string &classname, bool python_owns=false)
CPYCPPYY_EXTERN void * Instance_AsVoidPtr(PyObject *pyobject)
RPY_EXPORTED std::string GetScopedFinalName(TCppType_t type)
PyObject * AddTClassDynamicCastPyz(PyObject *self, PyObject *args)
Add pythonization for TClass::DynamicCast.