32 PyObject* pyclass = PyType_Type.tp_alloc( metatype, nitems );
39 void meta_dealloc( PyRootClass* pytype )
41 return PyType_Type.tp_dealloc( (
PyObject*)pytype );
53 subtype->tp_alloc = (allocfunc)meta_alloc;
54 subtype->tp_dealloc = (destructor)meta_dealloc;
57 PyRootClass* result = (PyRootClass*)PyType_Type.tp_new( subtype, args, kwds );
65 const char* mp = strstr( subtype->tp_name,
"_meta" );
75 std::string( subtype->tp_name ).substr( 0, mp-subtype->tp_name ).c_str() );
86 PyObject* attr = PyType_Type.tp_getattro( pyclass, pyname );
91 PyErr_Fetch( &etype, &value, &trace );
95 if ( name.size() <= 2 || name.substr( 0, 2 ) !=
"__" ) {
104 Py_DECREF(pycppname);
113 std::vector< PyCallable* > overloads;
115 for (
size_t imeth = 0; imeth < nmeth; ++imeth ) {
118 overloads.push_back(
new TFunctionHolder( scope, method ) );
136 if ( ! attr && klass ) {
146 Py_INCREF( &PyInt_Type );
151 PyObject_SetAttr( pyclass, pyname, attr );
153 attr = PyType_Type.tp_getattro( pyclass, pyname );
164 attr = PyType_Type.tp_getattro( pyclass, pyname );
166 PyObject_SetAttr( pyclass, pyname, attr );
172 if ( ! attr && etype )
173 PyErr_Restore( etype, value, trace );
175 PyObject* sklass = PyObject_Str( pyclass );
176 PyErr_Format( PyExc_AttributeError,
"%s has no attribute \'%s\'",
193 (
char*)
"ROOT.PyRootType",
208 (getattrofunc)pt_getattro,
211 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
212 (
char*)
"PyROOT metatype (internal)",
237 #
if PY_VERSION_HEX >= 0x02030000
240 #
if PY_VERSION_HEX >= 0x02060000
243 #
if PY_VERSION_HEX >= 0x03040000
Bool_t IsNamespace(TCppScope_t scope)
Dictionary for function template This class describes one single function template.
TList * GetListOfEnums(Bool_t load=kTRUE)
Return a list containing the TEnums of a class.
Bool_t PyRootType_CheckExact(T *object)
MethodProxy * MethodProxy_New(const std::string &name, std::vector< PyCallable * > &methods)
Bool_t PyRootType_Check(T *object)
TemplateProxy * TemplateProxy_New(const std::string &name, PyObject *pyclass)
virtual TObject * FindObject(const char *name) const
Delete a TObjLink object.
#define PyVarObject_HEAD_INIT(type, size)
PyObject * GetCppGlobal(const std::string &name)
try named global variable/enum (first ROOT, then Cling: sync is too slow)
#define PyROOT_PyUnicode_AsString
Bool_t PropertyProxy_Check(T *object)
TCppMethod_t GetMethod(TCppScope_t scope, TCppIndex_t imeth)
PyTypeObject PyRootType_Type
std::string GetMethodName(TCppMethod_t)
TCppIndex_t GetDatamemberIndex(TCppScope_t scope, const std::string &name)
The ROOT global object gROOT contains a list of all defined classes.
Type object to hold TClassRef instance (this is only semantically a presentation of PyRootType instan...
PyObject * CreateScopeProxy(Cppyy::TCppScope_t)
Convenience function with a lookup first through the known existing proxies.
TCppScope_t GetScope(const std::string &scope_name)
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.
R__EXTERN PyObject * gCppName
#define PyROOT_PyUnicode_CheckExact
TFunctionTemplate * GetFunctionTemplate(const char *name)
TCppIndex_t GetNumMethods(TCppScope_t scope)
PropertyProxy * PropertyProxy_New(Cppyy::TCppScope_t scope, Cppyy::TCppIndex_t idata)
TList * GetListOfMethods(Bool_t load=kTRUE)
Return list containing the TMethods of a class.