ATLAS Offline Software
Loading...
Searching...
No Matches
checkTP Namespace Reference

Classes

class  Columbo
class  DataMember
class  FctMember

Functions

 dumpDataMembers (self, klass)
 for i in xrange(klass.DataMemberSize()): mbr = klass.DataMemberAt(i).TypeOf().Name(DICTSCOPE) klassNames.append (self.loadDicts(mbr))
 dumpFctMembers (self, klass)
 inspect (self, klassName)
 save (self, fileName="./columbo.out")

Variables

str __author__ = "Sebastien Binet"
int S = 4
int SF = 5
int SQ = 6
int SFQ = 7
int DICTSCOPE = SF
tuple _cpp_builtins
 klassName = sys.argv[1]
 columbo = Columbo()
list report = []

Function Documentation

◆ dumpDataMembers()

checkTP.dumpDataMembers ( self,
klass )

for i in xrange(klass.DataMemberSize()): mbr = klass.DataMemberAt(i).TypeOf().Name(DICTSCOPE) klassNames.append (self.loadDicts(mbr))

Definition at line 104 of file checkTP.py.

104 def dumpDataMembers(self, klass):
105 dataMembers = []
106 for i in range(klass.DataMemberSize()):
107 d = klass.DataMemberAt(i)
108 scope = klass.Name()
109 offset = '<s>' if d.IsStatic() else d.Offset()
110 fullname = '::'.join([scope, d.Name(SFQ)])
111 typename = d.TypeOf().Name(SFQ)
112 dataMembers.append( DataMember(offset, fullname, typename) )
113 return dataMembers
114

◆ dumpFctMembers()

checkTP.dumpFctMembers ( self,
klass )

Definition at line 115 of file checkTP.py.

115 def dumpFctMembers(self, klass):
116 fctMembers = []
117 for i in range(klass.FunctionMemberSize()):
118 f = klass.FunctionMemberAt(i)
119 fctMembers.append( FctMember( f.Name(SFQ),
120 f.TypeOf().Name(SFQ) ) )
121 pass
122 return fctMembers
123

◆ inspect()

checkTP.inspect ( self,
klassName )

Definition at line 124 of file checkTP.py.

124 def inspect(self, klassName):
125 self.report = []
126 print ("")
127 print ("#"*80)
128 print ("## loading all relevant dictionaries...")
129 try:
130 klassNames = self.loadDicts(klassName)
131 print ("#"*80)
132 except Exception as err:
133 print ("")
134 print ("#"*80)
135 print ("## ERROR while trying to load dict for [%s]" % klassName)
136 print ("## -Most probably you DIDN'T give a fully qualified name !")
137 print ("## Ex: try 'Analysis::Muon' instead of 'Muon'")
138 print ("##")
139 print ("## -Could also mean that you are missing a dictionary ")
140 print ("## of one of the base classes...")
141 print ("#"*80)
142 print (err)
143 raise
144 return
145
146 print ("")
147 print ("#"*80)
148 print ("## infos for class [%s]:" % klassName)
149 print ("## sizeof(%s) = %i" % \
150 (klassName,
151 self.Type.SizeOf(self.Type.ByName(klassName))))
152 print ("##")
153 print ("## (offset, data member name, data member type)")
154 print ("")
155 # we want to dump from the base to the most derived class
156 klassNames.reverse()
157 for klass in klassNames:
158 line = "%s %s %s" % (
159 "-" * (40-len(klass)//2-1),
160 "[%s]" % klass,
161 "-" * (40-len(klass)//2-1) )
162
163 print (line)
164 self.report.append(line)
165 dataMembers = self.dumpDataMembers( self.Type.ByName(klass) )
166 for i in dataMembers:
167 line = "%3s %s %-50s %s %s" % ( str(i.offset),
168 " "*5,
169 i.name,
170 " "*5, i.type )
171 print (line)
172 self.report.append(line)
173 print ("#"*80)
174 return
175

◆ save()

checkTP.save ( self,
fileName = "./columbo.out" )

Definition at line 176 of file checkTP.py.

176 def save(self, fileName = "./columbo.out" ):
177 file = open(os.path.expandvars(os.path.expanduser(fileName)),
178 "w+")
179 for line in self.report:
180 file.writelines(line + os.linesep)
181 pass
182 file.close()
183

Variable Documentation

◆ __author__

str checkTP.__author__ = "Sebastien Binet"
private

Definition at line 21 of file checkTP.py.

◆ _cpp_builtins

tuple checkTP._cpp_builtins
protected
Initial value:
1= (
2 'char', 'unsigned char', 'signed char',
3 'short', 'unsigned short',
4 'int', 'unsigned int',
5 'long', 'unsigned long',
6 'long long', 'unsigned long long', 'ulonglong',
7 'float',
8 'double',
9 'bool',
10 )

Definition at line 30 of file checkTP.py.

◆ columbo

checkTP.columbo = Columbo()

Definition at line 194 of file checkTP.py.

◆ DICTSCOPE

int checkTP.DICTSCOPE = SF

Definition at line 28 of file checkTP.py.

◆ klassName

str checkTP.klassName = sys.argv[1]

Definition at line 189 of file checkTP.py.

◆ report

list checkTP.report = []

Definition at line 125 of file checkTP.py.

◆ S

int checkTP.S = 4

Definition at line 24 of file checkTP.py.

◆ SF

int checkTP.SF = 5

Definition at line 25 of file checkTP.py.

◆ SFQ

int checkTP.SFQ = 7

Definition at line 27 of file checkTP.py.

◆ SQ

int checkTP.SQ = 6

Definition at line 26 of file checkTP.py.