Definition at line 7 of file StreamerInfoGenerator.py.
◆ __init__()
def StreamerInfoGenerator.StreamerInfoGenerator.__init__ |
( |
|
self | ) |
|
Definition at line 8 of file StreamerInfoGenerator.py.
10 print(
"StreamerInfoGenerator v1.0.0")
12 self.problemclasses = []
14 self.blacklist = [
'std::',
'vector<',
'map<',
'queue<',
'list<']
15 self.type = cppyy.gbl.RootType
16 self.type.EnableCintex()
17 cppyy.load_library(
'libAtlasSTLAddReflexDict')
19 ROOT.gROOT.ProcessLine(
".autodict")
◆ inspect()
def StreamerInfoGenerator.StreamerInfoGenerator.inspect |
( |
|
self, |
|
|
|
typename |
|
) |
| |
Definition at line 22 of file StreamerInfoGenerator.py.
23 if self.debug:
print(
'inspecting ', typename)
27 for b
in self.blacklist:
28 if typename.find(b) == 0:
29 if self.debug:
print(
'blacklisted ', typename)
33 if typename
in self.classlist:
34 if self.debug:
print(
'seen before ', typename)
38 t = self.type.ByName(typename)
41 if self.debug:
print(typename,
' is fundamental')
49 exceptions = [
"string::(anonymous)",
"string::(unnamed)"]
56 bind_name = bind_name.replace(
"<",
"['", 1)[::-1].
replace(
">",
"]'", 1)[::-1]
58 base_and_arg = bind_name.split(
"[")
59 base_and_arg[0] = base_and_arg[0].
replace(
"::",
".")
60 bind_name =
"[".
join(base_and_arg)
61 bind_name =
"ROOT." + bind_name
63 print(
"Making class {} -> {}".
format(typename, bind_name))
64 print(
"cl = " + bind_name)
65 exec(
"cl = " + bind_name, globals())
66 if self.debug:
print(cl)
68 self.classlist.
append(typename)
69 if self.debug:
print(
"appended type to the classlist")
70 except Exception
as ex:
71 if self.debug:
print(
'Cannot create class of {}: {}'.
format(typename, ex))
72 if typename
not in exceptions:
75 t = self.type.ByName(typename)
78 if self.debug:
print(typename,
'is complete')
80 if self.debug:
print(typename,
' isn\'t complete')
83 if self.debug:
print(typename,
' is a pointer')
85 if self.debug:
print(typename,
' is typedef')
86 underlying = t.ToType()
88 self.inspect(underlying.Name(7))
90 if self.debug:
print(typename,
' is an array')
91 elif t.IsTemplateInstance():
92 if self.debug:
print(typename,
' is template')
93 if typename.find(
'std::')==0:
94 if self.debug:
print(
'std::business removed')
96 self.classlist.
remove(typename)
99 for i
in range(t.TemplateArgumentSize()):
100 tt = t.TemplateArgumentAt(i)
102 if tt.IsPointer()
or tt.IsArray()
or tt.IsTypedef():
103 ttname = tt.ToType().Name(7)
106 if self.debug:
print(typename,
' is a class')
108 if self.debug:
print(cname)
110 for i
in range(t.DataMemberSize()):
111 d = t.DataMemberAt(i)
113 dtype = d.TypeOf().Name(7)
115 print(
'DataMember: ', dname,
' ', dtype,
' transient=', d.IsTransient())
116 if not d.IsTransient():
120 print(
'what to do about ', typename,
'?')
121 self.problemclasses.
append( typename )
◆ streamers()
def StreamerInfoGenerator.StreamerInfoGenerator.streamers |
( |
|
self | ) |
|
◆ blacklist
StreamerInfoGenerator.StreamerInfoGenerator.blacklist |
◆ classlist
StreamerInfoGenerator.StreamerInfoGenerator.classlist |
◆ debug
StreamerInfoGenerator.StreamerInfoGenerator.debug |
◆ problemclasses
StreamerInfoGenerator.StreamerInfoGenerator.problemclasses |
◆ type
StreamerInfoGenerator.StreamerInfoGenerator.type |
The documentation for this class was generated from the following file: