31 PyObject* pyclass = PyType_Type.tp_alloc( metatype, nitems );
38 void meta_dealloc( PyRootClass* pytype )
40 return PyType_Type.tp_dealloc( (
PyObject*)pytype );
52 subtype->tp_alloc = (allocfunc)meta_alloc;
53 subtype->tp_dealloc = (destructor)meta_dealloc;
56 PyRootClass* result = (PyRootClass*)PyType_Type.tp_new( subtype, args, kwds );
64 const char* mp = strstr( subtype->tp_name,
"_meta" );
74 std::string( subtype->tp_name ).substr( 0, mp-subtype->tp_name ).c_str() );
90 PyErr_Fetch( &etype, &value, &trace );
95 if (
name.size() <= 2 ||
name.substr( 0, 2 ) !=
"__" ) {
104 Py_DECREF(pycppname);
113 auto completeName = methObj->
GetName();
114 std::vector< PyCallable* > overloads;
116 for (
size_t imeth = 0; imeth < nmeth; ++imeth ) {
124 if (currentName == completeName)
125 overloads.push_back(
new TFunctionHolder( scope, method ) );
143 if ( ! attr && klass ) {
167 Py_DECREF(cppnamepy);
171 Py_INCREF(&PyInt_Type);
172 PyTuple_SET_ITEM(pybases, 0, (
PyObject*)&PyInt_Type);
173 PyObject* args = Py_BuildValue((
char*)
"sOO",
name.c_str(), pybases, dct);
174 attr =
Py_TYPE(&PyInt_Type)->tp_new(
Py_TYPE(&PyInt_Type), args,
nullptr);
180 Py_INCREF(&PyInt_Type);
187 PyObject_SetAttr( pyclass,
pyname, attr );
189 attr = PyType_Type.tp_getattro( pyclass,
pyname );
200 attr = PyType_Type.tp_getattro( pyclass,
pyname );
202 PyObject_SetAttr( pyclass,
pyname, attr );
208 if ( ! attr && etype )
209 PyErr_Restore( etype, value, trace );
211 PyObject* sklass = PyObject_Str( pyclass );
212 PyErr_Format( PyExc_AttributeError,
"%s has no attribute \'%s\'",
225#if !defined(_MSC_VER)
226#pragma GCC diagnostic push
227#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
233 (
char*)
"ROOT.PyRootType",
249 (getattrofunc)pt_getattro,
252 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
253 (
char*)
"PyROOT metatype (internal)",
278#
if PY_VERSION_HEX >= 0x02030000
281#
if PY_VERSION_HEX >= 0x02060000
284#
if PY_VERSION_HEX >= 0x03040000
287#
if PY_VERSION_HEX >= 0x03080000
289#
if PY_VERSION_HEX < 0x03090000
295#if !defined(_MSC_VER)
296#pragma GCC diagnostic pop
#define PyROOT_PyUnicode_AsString
#define PyROOT_PyUnicode_FromString
#define PyROOT_PyUnicode_CheckExact
#define PyVarObject_HEAD_INIT(type, size)
Type object to hold TClassRef instance (this is only semantically a presentation of PyRootType instan...
TClass instances represent classes, structs and namespaces in the ROOT type system.
TList * GetListOfMethods(Bool_t load=kTRUE)
Return list containing the TMethods of a class.
TFunctionTemplate * GetFunctionTemplate(const char *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.
Dictionary for function template This class describes one single function template.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
Bool_t IsNamespace(TCppScope_t scope)
std::string GetMethodName(TCppMethod_t)
TCppIndex_t GetNumMethods(TCppScope_t scope)
long long GetEnumDataValue(TCppEnum_t, TCppIndex_t idata)
std::string GetScopedFinalName(TCppType_t type)
Bool_t IsEnum(const std::string &type_name)
std::string GetEnumDataName(TCppEnum_t, TCppIndex_t idata)
TCppIndex_t GetDatamemberIndex(TCppScope_t scope, const std::string &name)
TCppScope_t GetScope(const std::string &scope_name)
TCppEnum_t GetEnum(TCppScope_t scope, const std::string &enum_name)
TCppMethod_t GetMethod(TCppScope_t scope, TCppIndex_t imeth)
TCppIndex_t GetNumEnumData(TCppEnum_t)
R__EXTERN PyObject * gCppName
PyTypeObject PyRootType_Type
Bool_t PyRootType_CheckExact(T *object)
Bool_t PyRootType_Check(T *object)
TemplateProxy * TemplateProxy_New(const std::string &name, PyObject *pyclass)
MethodProxy * MethodProxy_New(const std::string &name, std::vector< PyCallable * > &methods)
PyObject * CreateScopeProxy(Cppyy::TCppScope_t)
Convenience function with a lookup first through the known existing proxies.
PropertyProxy * PropertyProxy_New(Cppyy::TCppScope_t scope, Cppyy::TCppIndex_t idata)
PyObject * GetCppGlobal(const std::string &name)
try named global variable/enum (first ROOT, then Cling: sync is too slow)
Bool_t PropertyProxy_Check(T *object)