36 if (!PyArg_ParseTuple(args,
"OO|i:DynamicCast", &pyclass, &pyobject, &up))
46 const char *nameStr =
name ? PyUnicode_AsUTF8AndSize(
name,
nullptr) :
nullptr;
48 PyErr_Format(PyExc_TypeError,
"DynamicCast argument 1 must be a cppyy instance, got '%s'", nameStr);
50 PyErr_SetString(PyExc_TypeError,
"DynamicCast argument 1 must be a cppyy instance");
65 long long value = PyLong_AsLongLong(pyobject);
66 if (!PyErr_Occurred()) {
67 address = (
void *)
value;
93 PyObject *pyclass = PyTuple_GetItem(args, 0);
PyObject * TClassDynamicCastPyz(PyObject *self, PyObject *args)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
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.
bool AddToClass(PyObject *pyclass, const char *label, PyCFunction cfunc, int flags=METH_VARARGS)
CPYCPPYY_EXTERN bool Instance_Check(PyObject *pyobject)
CPYCPPYY_EXTERN PyObject * Instance_FromVoidPtr(void *addr, const std::string &classname, bool python_owns=false)
CPYCPPYY_EXTERN std::string Instance_GetScopedFinalName(PyObject *pyobject)
CPYCPPYY_EXTERN void * Instance_AsVoidPtr(PyObject *pyobject)
void GetBuffer(PyObject *pyobject, void *&buf)
PyObject * AddTClassDynamicCastPyz(PyObject *self, PyObject *args)
Add pythonization for TClass::DynamicCast.