Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
THaVarList.cxx
Go to the documentation of this file.
1//*-- Author : Ole Hansen 27/04/00
2
4//
5// THaVarList
6//
7// A specialized THashList containing global variables of the
8// Hall A analyzer.
9//
10// Variables can be added to the list as follows:
11// (assumes THaVarList* gHaVars = new THaVarList)
12//
13// Double_t x;
14// gHaVars->Define("x","x variable",x);
15//
16// or for short
17// gHaVars->Define("x",x);
18//
19// Likewise for arrays:
20//
21// Double_t a[10];
22// gHaVars->Define("a[10]","array of doubles",a);
23//
24// or
25// gHaVars->Define("a[10]",a);
26//
27// (Note: Array definitions register only the name before the bracket
28// as the variable name; "a" in the example above. Hence
29//
30// gHaVars->Define("a",x)
31// and
32// gHaVars->Define("a[10]",a)
33//
34// result in a name conflict, i.e. the second definition will fail.
35//
36// Supported data types are:
37//
38// Double_t, Float_t, Long_t, ULong_t, Int_t, UInt_t,
39// Short_t, UShort_t, Char_t, Byte_t.
40//
41// The type is determined automatically through function overloading.
42// Do not specify the type explicitly using casts. Instead, define variables
43// with the type you need.
44//
45// To get maximum efficiency and accuracy, variables should be Double_t.
46// For calculations in THaFormula/THaCut, all data will be promoted to
47// double precision anyhow.
48//
50
51#include "THaVarList.h"
52#include "THaVar.h"
53#include "THaRTTI.h"
54#include "THaArrayString.h"
55#include "TRegexp.h"
56#include "TString.h"
57#include "TClass.h"
58#include "TMethodCall.h"
59#include "TFunction.h"
60#include "TROOT.h"
61
62#include <string> // for TFunction::GetReturnTypeNormalizedName
63#include <cassert>
64
66
67using namespace std;
68
69static const Int_t kInitVarListCapacity = 100;
70static const Int_t kVarListRehashLevel = 3;
71
72//_____________________________________________________________________________
74{
75 // Default constructor
76
77 // THaVarList "owns" the variables put into it, i.e. if the list is deleted
78 // so are the global variables in it.
79 SetOwner(true);
80}
81
82//_____________________________________________________________________________
83THaVar* THaVarList::DefineByType( const char* name, const char* descript,
84 const void* var, VarType type,
85 const Int_t* count, const char* errloc )
86{
87 // Define a global variable with given type.
88 // Duplicate names are not allowed; if a name already exists, return 0
89
90 THaVar* ptr = Find( name );
91 if( ptr ) {
92 Warning( errloc, "Variable %s already exists. Not redefined.",
93 ptr->GetName() );
94 return nullptr;
95 }
96
97 ptr = new THaVar( name, descript, var, type, -1, nullptr, count );
98 if( ptr->IsZombie() ) {
99 Warning( errloc, "Error creating variable %s", name );
100 delete ptr;
101 return nullptr;
102 }
103
104 AddLast( ptr );
105 return ptr;
106}
107
108//_____________________________________________________________________________
110 const TString& def, const void* const obj,
111 TClass* const cl, const char* errloc )
112{
113 // Define variable via its ROOT RTTI
114
115 typedef vector<TSeqCollection*> VecSC_t;
116
117 static_assert( sizeof(ULong_t) == sizeof(void*), "ULong_t must be of pointer size" );
118
119 if( !obj || !cl ) {
120 Warning( errloc, "Invalid class or object. Variable %s not defined.",
121 name.Data() );
122 return nullptr;
123 }
124
125 THaVar* var = Find( name );
126 if( var ) {
127 Warning( errloc, "Variable %s already exists. Not redefined.",
128 var->GetName() );
129 return nullptr;
130 }
131
132 // Find up to two dots in the definition and extract the strings between them
133 Ssiz_t pos = 0, ppos = 0;
134 Int_t ndot = 0;
135 TString s[3];
136 while( (pos = def.Index( ".", pos )) != kNPOS && ndot<2 ) {
137 Int_t len = pos - ppos;
138 if( len >= 0 )
139 s[ndot] = def(ppos, len);
140 ppos = ++pos;
141 ++ndot;
142 }
143 s[ndot] = def(ppos, def.Length()-ppos );
144
145 // More than two dots?
146 if( pos != kNPOS ) {
147 Warning( errloc, "Too many dots in definition of variable %s (%s). "
148 "Variable not defined.", name.Data(), desc.Data() );
149 return nullptr;
150 }
151 // Any zero-length strings?
152 Int_t i = 0;
153 while( i <= ndot )
154 if( s[i++].Length() == 0 )
155 return nullptr;
156
157 TClass* theClass = nullptr;
158 auto loc = reinterpret_cast<ULong_t>(obj);
159
160 THaRTTI objrtti;
161 Int_t vecidx = -1;
162
163 // Parse RTTI info
164 switch( ndot ) {
165 case 0:
166 // Simple member variable or pointer to basic type
167 theClass = cl;
168 break;
169 case 1:
170 // Member variable contained in a member object, or pointer to it (->scalar);
171 // or member variable contained in an object inside a vector (->vararray)
172 // (like ndot==2, except element type is known)
173 objrtti.Find( cl, s[0], obj );
174 if( !objrtti.IsValid() ||
175 !(objrtti.IsObject() || objrtti.IsObjVector()) ) {
176 Warning( errloc, "Unsupported type of data member %s. "
177 "Variable %s (%s) not defined.",
178 s[0].Data(), name.Data(), desc.Data() );
179 return nullptr;
180 }
181 loc += objrtti.GetOffset();
182 if( objrtti.IsPointer() ) {
183 void** ploc = (void**)loc;
184 loc = (ULong_t)*ploc;
185 }
186 theClass = objrtti.GetClass();
187 assert( theClass ); // else objrtti.Find should not have succeeded
188 break;
189 case 2:
190 // TSeqCollection member object, or pointer to it, or std::vector<TSeqCollection*>
191 objrtti.Find( cl, s[0], obj );
192 if( !objrtti.IsValid() || !objrtti.IsObject() ) {
193 // Check for vector element
194 bool good = false;
195 THaArrayString s0(s[0]);
196 if( s0 && s0.IsArray() && s0.GetNdim() == 1 ) {
197 objrtti.Find( cl, s0, obj );
198 if( objrtti.IsValid() && objrtti.IsObjVector() &&
199 objrtti.GetType() == kObjectPV ) {
200 vecidx = s0[0];
201 good = true;
202 }
203 }
204 if( !good ) {
205 Warning( errloc, "Unsupported type of data member %s. "
206 "Variable %s (%s) not defined.",
207 s[0].Data(), name.Data(), desc.Data() );
208 return nullptr;
209 }
210 }
211 theClass = objrtti.GetClass();
212 assert( theClass );
213 if( !theClass->InheritsFrom( "TSeqCollection" )) {
214 Warning( errloc, "Data member %s is not a TSeqCollection. "
215 "Variable %s (%s) not defined.",
216 s[0].Data(), name.Data(), desc.Data() );
217 return nullptr;
218 }
219 loc += objrtti.GetOffset();
220 if( objrtti.IsPointer() ) {
221 void** ploc = (void**)loc;
222 loc = (ULong_t)*ploc;
223 }
224 // For std::vector<TSeqCollection*>, get the requested vector element
225 if( objrtti.IsObjVector() ) {
226 VecSC_t vec = *reinterpret_cast<VecSC_t*>(loc);
227 if( vecidx < 0 || vecidx >= (Int_t)vec.size() ) {
228 Warning( errloc, "Illegal index %d into std::vector %s. "
229 "Current size = %d. Variable %s (%s) not defined.",
230 vecidx, s[0].Data(), (Int_t)vec.size(), name.Data(),
231 desc.Data() );
232 return nullptr;
233 }
234 loc = reinterpret_cast<ULong_t>(vec[vecidx]);
235 if( !loc ) {
236 Warning( errloc, "Null pointer in std::vector %s. "
237 "Variable %s (%s) not defined.",
238 s[0].Data(), name.Data(), desc.Data() );
239 return nullptr;
240 }
241 objrtti.Reset(); // clear objrtti.IsObjVector()
242 }
243
244 theClass = gROOT->GetClass( s[1] );
245 if( !theClass ) {
246 Warning( errloc, "Cannot determine class of container "
247 "member object %s. Variable %s (%s) not defined.",
248 s[1].Data(), name.Data(), desc.Data() );
249 return nullptr;
250 }
251 break;
252 default:
253 assert(false); // not reached
254 break;
255 }
256
257 // Define the variable based on the parse results
258 Bool_t function = s[ndot].EndsWith("()");
259 if( !function ) {
260 // Member variables
261
262 THaRTTI rtti;
263 rtti.Find( theClass, s[ndot], (ndot==0) ? obj : nullptr );
264 if( !rtti.IsValid() ) {
265 Warning( errloc, "No RTTI information for variable %s. "
266 "Not defined.", name.Data() );
267 return nullptr;
268 }
269 if( rtti.IsObject() ) {
270 Warning( errloc, "Variable %s is an object. Must be a basic type. "
271 "Not defined.", name.Data() );
272 return nullptr;
273 }
274
275 if( ndot < 2 && !objrtti.IsObjVector() ) {
276 // Basic data, arrays/vectors of basic data, or basic data in single objects
277 loc += rtti.GetOffset();
278 TString theName(name);
279 Int_t* count_loc = nullptr;
280 switch( rtti.GetArrayType() ) {
281 case THaRTTI::kScalar:
282 case THaRTTI::kVector:
283 break;
284 case THaRTTI::kFixed:
285 theName.Append( rtti.GetSubscript() );
286 break;
288 count_loc = (Int_t*)( (ULong_t)obj + rtti.GetCountOffset() );
289 break;
290 }
291 var = DefineByType( theName, desc, (void*)loc, rtti.GetType(),
292 count_loc, errloc );
293 } else {
294 // Collections of objects
295 if( !objrtti.IsObjVector() )
296 var = new THaVar( name, desc, (void*)loc, rtti.GetType(),
297 rtti.GetOffset() );
298 else {
299 assert( ndot == 1 );
300 VarType type = objrtti.GetType();
301 assert( type == kObjectV || type == kObjectPV );
302 Int_t sz = (type == kObjectV) ? objrtti.GetClass()->Size() : 0;
303 var = new THaVar( name, desc, (void*)loc, rtti.GetType(), sz,
304 rtti.GetOffset() );
305 }
306 if( !var->IsZombie() )
307 AddLast( var );
308 else {
309 Warning( errloc, "Error creating variable %s", name.Data() );
310 delete var;
311 return nullptr;
312 }
313 }
314
315 } else { // if( !function )
316 // Member functions
317
318 TString funcName(s[ndot]);
319 Ssiz_t pos2 = funcName.Index('(' );
320 assert(pos2 != kNPOS ); // else EndsWith("()") lied
321 funcName = funcName(0, pos2);
322
323 auto* theMethod = new TMethodCall(theClass, funcName, "" );
324 if( !theMethod->IsValid() ) {
325 Warning( errloc, "Error getting function information for variable %s. "
326 "Not defined.", name.Data() );
327 delete theMethod;
328 return nullptr;
329 }
330 TFunction* func = theMethod->GetMethod();
331 if( !func ) {
332 Warning( errloc, "Function %s does not exist. Variable %s not defined.",
333 s[ndot].Data(), name.Data() );
334 delete theMethod;
335 return nullptr;
336 }
337
338 TMethodCall::EReturnType rtype = theMethod->ReturnType();
339 if( rtype != TMethodCall::kLong && rtype != TMethodCall::kDouble ) {
340 Warning( errloc, "Unsupported return type for function %s. "
341 "Variable %s not defined.", s[ndot].Data(), name.Data() );
342 delete theMethod;
343 return nullptr;
344 }
345
346 // Attempt to get the real function return type
347 VarType type = kVarTypeEnd;
348 string ntype = func->GetReturnTypeNormalizedName();
349 if( ntype == "double" )
350 type = kDouble;
351 else if( (sizeof(int) == sizeof(Int_t) && ntype == "int") ||
352 (sizeof(long) == sizeof(Int_t) && ntype == "long") )
353 type = kInt;
354 else if( (sizeof(unsigned int) == sizeof(UInt_t) && ntype == "unsigned int") ||
355 (sizeof(unsigned long) == sizeof(UInt_t) && ntype == "unsigned long") )
356 type = kUInt;
357 else if( ntype == "float" )
358 type = kFloat;
359 else if( ntype == "bool" ) {
360 if( sizeof(bool) == sizeof(Char_t) )
361 type = kChar;
362 else if( sizeof(bool) == sizeof(Short_t) )
363 type = kShort;
364 else if( sizeof(bool) == sizeof(Int_t) )
365 type = kInt;
366 }
367 else if( (sizeof(long) == sizeof(Long_t) && ntype == "long") ||
368 (sizeof(long long) == sizeof(Long_t) && ntype == "long long") ||
369 (sizeof(int) == sizeof(Long_t) && ntype == "int") )
370 type = kLong;
371 else if( (sizeof(unsigned long) == sizeof(ULong_t) && ntype == "unsigned long") ||
372 (sizeof(unsigned long long) == sizeof(ULong_t) && ntype == "unsigned long long") ||
373 (sizeof(unsigned int) == sizeof(ULong_t) && ntype == "unsigned int") )
374 type = kULong;
375 else if( (sizeof(short) == sizeof(Short_t) && ntype == "short") )
376 type = kShort;
377 else if( (sizeof(unsigned short) == sizeof(UShort_t) && ntype == "unsigned short") )
378 type = kUShort;
379 else if( ntype == "char" )
380 type = kChar;
381 else if( ntype == "unsigned char" )
382 type = kUChar;
383
384 if( type == kVarTypeEnd ) {
385 Warning( errloc, "Unsupported return type \"%s\" for function %s. "
386 "Variable %s not defined.", ntype.c_str(), s[ndot].Data(), name.Data() );
387 delete theMethod;
388 return nullptr;
389 }
390 if( (rtype == TMethodCall::kDouble && type != kDouble && type != kFloat) ||
391 (rtype == TMethodCall::kLong && (type == kDouble || type == kFloat)) ) {
392 // Someone lied to us
393 Warning( errloc, "Ill-formed TMethodCall returned from ROOT for function %s, "
394 "variable %s. Call expert.", s[ndot].Data(), name.Data() );
395 delete theMethod;
396 return nullptr;
397 }
398 if( !objrtti.IsObjVector() )
399 var = new THaVar( name, desc, (void*)loc, type, ((ndot==2) ? 0 : -1),
400 theMethod );
401 else {
402 assert( ndot == 1 );
403 VarType otype = objrtti.GetType();
404 assert( otype == kObjectV || otype == kObjectPV );
405 Int_t sz = (otype == kObjectV) ? objrtti.GetClass()->Size() : 0;
406 var = new THaVar( name, desc, (void*)loc, type, sz, 0, theMethod );
407 }
408 if( !var->IsZombie() )
409 AddLast( var );
410 else {
411 Warning( errloc, "Error creating variable %s", name.Data() );
412 delete theMethod;
413 delete var;
414 return nullptr;
415 }
416
417 } // if( !function ) else
418
419 return var;
420}
421
422//-----------------------------------------------------------------------------
423Int_t THaVarList::DefineVariables( const VarDef* list, const char* prefix,
424 const char* caller )
425{
426 // Add all variables specified in 'list' to the list. 'list' is a C-style
427 // structure defined in VarDef.h and must be terminated with a nullptr name.
428 //
429 // Allows definition of:
430 // scalars
431 // fixed size arrays
432 // variable size arrays
433 // fixed size arrays of pointers
434 // variable size arrays of pointers
435 // Data can be anywhere in memory, typically in member variables.
436 // Data type must be specified explicitly. To use the ROOT RTTI features
437 // to determine data types (and arrays sizes etc.) automatically, or
438 // to access data in member ROOT objects, use the second form of this
439 // method.
440 //
441 // The names of all newly created variables will be prefixed with 'prefix',
442 // if given. Error messages will include 'caller', if given.
443 // Output a warning if a name already exists. Return values >0 indicate the
444 // number of variables defined, <0 indicate errors (no variables defined).
445
446 TString errloc("DefineVariables [called from ");
447 if( !caller || !*caller ) {
448 caller = "(global scope)";
449 }
450 errloc.Append(caller);
451 errloc.Append("]");
452
453 if( !list ) {
454 Error(errloc, "Empty input list. No variables registered.");
455 return -1;
456 }
457
458 if( !prefix )
459 prefix = "";
460
461 const VarDef* item = list;
462 Int_t ndef = 0;
464
465 while( item->name ) {
466
467 const char* description = item->desc;
468 if( !description || !*description )
469 description = item->name;
470
471 // Assemble the name string
472 name = prefix;
473 name.Append(item->name);
474 // size>1 means fixed-size 1-d array
475 bool fixed_array = (item->size > 1);
476 bool var_array = (item->count != nullptr) ||
477 (item->type >= kIntV && item->type <= kDoubleV);
478 if( item->size>0 && var_array ) {
479 Warning( errloc, "Variable %s: variable-size arrays must have size=0. "
480 "Ignoring size.", name.Data() );
481 } else if( fixed_array ) {
482 const int LEN = 32;
483 char dimstr[LEN];
484 snprintf( dimstr, LEN, "[%d]", item->size );
485 name.Append(dimstr);
486 }
487
488 // Define this variable, using the indicated type
489
490 THaVar* var = DefineByType( name, description, item->loc,
491 static_cast<VarType>( item->type ),
492 item->count, errloc );
493 if( var )
494 ndef++;
495 item++;
496 }
497
498 return ndef;
499}
500
501//-----------------------------------------------------------------------------
502Int_t THaVarList::DefineVariables( const RVarDef* list, const TObject* obj,
503 const char* prefix, const char* caller,
504 const char* def_prefix,
505 const char* comment_subst )
506{
507 // Add all variables specified in 'list' to the list. 'list' is a C-style
508 // structure defined in VarDef.h and must be terminated with a nullptr name.
509 //
510 // Allows definition of:
511 // scalars
512 // fixed size arrays
513 // variable size arrays
514 //
515 // Data must be persistent ROOT data members or accessible via
516 // member functions. They can be member variables, member variables
517 // of member ROOT objects, or member variables of ROOT objects
518 // contained in member ROOT containers derived from TSeqCollection.
519 //
520 // The names of all newly created variables will be prefixed with 'prefix',
521 // if given. Error messages will include 'caller', if given.
522 // Output a warning if a name already exists. Return values >0 indicate the
523 // number of variables defined, <0 indicate errors (no variables defined).
524
525 TString errloc("DefineVariables [called from ");
526 if( !caller || !*caller) {
527 caller = "(global scope)";
528 }
529 errloc.Append(caller);
530 errloc.Append("]");
531
532 if( !list ) {
533 Error(errloc, "No input list. No variables registered.");
534 return -1;
535 }
536
537 if( !obj ) {
538 Error(errloc, "No base object. No variables registered.");
539 return -2;
540 }
541
542 // Get the class of the base object
543 TClass* cl = obj->IsA();
544 if( !cl ) {
545 //Oops
546 Error( errloc, "Base object has no class?!? No variables registered.");
547 return -3;
548 }
549
550 const RVarDef* item;
551 Int_t ndef = 0;
552 while( (item = list++) && item->name ) {
553
554 // Assemble the name and description strings
555 TString name( item->name );
556 if( name.IsNull() )
557 continue;
558 if( prefix )
559 name.Prepend(prefix);
560
561 TString desc;
562 if( item->desc && *item->desc ) {
563 desc = item->desc;
564 if( !comment_subst )
565 comment_subst = "";
566 // Substitute "%s" in description string with 'comment_subst'
567 desc.ReplaceAll("%s", comment_subst);
568 } else
569 desc = name;
570 // Trim string, collapse whitespace
571 desc.Remove(TString::EStripType::kLeading,' ')
572 .Remove(TString::EStripType::kTrailing,' ');
573 while( desc.Index(" ") != kNPOS )
574 desc.ReplaceAll(" "," ");
575
576 // Process the variable definition
577 char* c = ::Compress( item->def );
578 TString def( c );
579 delete [] c;
580 if( def.IsNull() ) {
581 Warning( errloc, "Invalid definition for variable %s (%s). "
582 "Variable not defined.", name.Data(), desc.Data() );
583 continue;
584 }
585 if( def_prefix && *def_prefix )
586 def.Prepend(def_prefix);
587
588 THaVar* var = DefineByRTTI( name, desc, def, obj, cl, errloc );
589
590 if( var )
591 ndef++;
592 }
593
594 return ndef;
595}
596
597//_____________________________________________________________________________
598THaVar* THaVarList::Find( const char* name ) const
599{
600 // Find a variable in the list. If 'name' has array syntax ("var[3]"),
601 // the search is performed for the array basename ("var").
602
603 if( !name )
604 return nullptr;
605 string s(name);
606 auto pos = s.find('[');
607 return dynamic_cast<THaVar*>(
608 (pos == string::npos) ? FindObject(name)
609 : FindObject(s.erase(pos).c_str())
610 );
611}
612
613//_____________________________________________________________________________
614void THaVarList::PrintFull( Option_t* option ) const
615{
616 // Print variable names, descriptions, and data.
617 // Identical to Print() except that variable data is also printed.
618 // Supports selection of subsets of variables via 'option'.
619 // E.g.: option="var*" prints only variables whose names start with "var".
620
621 if( !option ) option = "";
622 TRegexp re(option,true);
623 TIter next(this);
624
625 while( TObject* obj = next() ) {
626 if( *option ) {
627 TString s = obj->GetName();
628 if( s.Index(re) == kNPOS )
629 continue;
630 }
631 obj->Print("FULL");
632 }
633}
634
635//_____________________________________________________________________________
636Int_t THaVarList::RemoveName( const char* name )
637{
638 // Delete the variable with the given name from the list.
639 // Returns 1 if variable was deleted, 0 is it wasn't in the list.
640 //
641 // Note: This differs from TList::Remove(), which doesn't delete the
642 // element itself.
643
644 TObject* ptr = Find( name );
645 if( !ptr )
646 return 0;
647 ptr = Remove( ptr );
648 delete ptr;
649 return 1;
650}
651
652//_____________________________________________________________________________
653Int_t THaVarList::RemoveRegexp( const char* expr, Bool_t wildcard )
654{
655 // Delete all variables matching regular expression 'expr'. If 'wildcard'
656 // is true, the more user-friendly wildcard format is used (see TRegexp).
657 // Returns number of variables removed, or <0 if error.
658
659 TRegexp re( expr, wildcard );
660 if( re.Status() ) return -1;
661
662 Int_t ndel = 0;
663 TIter next( this );
664 while( TObject* ptr = next() ) {
665 TString name = ptr->GetName();
666 if( name.Index( re ) != kNPOS ) {
667 ptr = Remove( ptr );
668 delete ptr;
669 ndel++;
670 }
671 }
672 return ndel;
673}
int Int_t
unsigned int UInt_t
unsigned long ULong_t
long Long_t
#define c(i)
#define s0(x)
bool Bool_t
unsigned short UShort_t
const Ssiz_t kNPOS
int Ssiz_t
char Char_t
short Short_t
const char Option_t
Option_t Option_t option
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 UChar_t len
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
char name[80]
static const Int_t kVarListRehashLevel
static const Int_t kInitVarListCapacity
#define gROOT
#define snprintf
Int_t Size() const
Bool_t InheritsFrom(const char *cl) const override
virtual void SetOwner(Bool_t enable=kTRUE)
std::string GetReturnTypeNormalizedName() const
Bool_t IsObjVector() const
Definition THaRTTI.h:43
VarType GetType() const
Definition THaRTTI.h:38
@ kScalar
Definition THaRTTI.h:21
@ kVariable
Definition THaRTTI.h:21
@ kFixed
Definition THaRTTI.h:21
@ kVector
Definition THaRTTI.h:21
Bool_t IsPointer() const
Definition THaRTTI.cxx:278
Long_t GetCountOffset() const
Definition THaRTTI.h:33
Bool_t IsObject() const
Definition THaRTTI.h:40
void Reset()
Definition THaRTTI.h:48
Long_t GetOffset() const
Definition THaRTTI.h:35
EArrayType GetArrayType() const
Definition THaRTTI.h:31
TClass * GetClass() const
Definition THaRTTI.cxx:265
Bool_t IsValid() const
Definition THaRTTI.h:46
Int_t Find(TClass *cl, const TString &var, const void *p=nullptr)
Definition THaRTTI.cxx:29
const char * GetSubscript() const
Definition THaRTTI.h:37
virtual Int_t RemoveRegexp(const char *expr, Bool_t wildcard=true)
virtual Int_t RemoveName(const char *name)
virtual void PrintFull(Option_t *opt="") const
virtual THaVar * DefineByType(const char *name, const char *desc, const void *loc, VarType type, const Int_t *count, const char *errloc="DefineByType")
virtual THaVar * DefineByRTTI(const TString &name, const TString &desc, const TString &def, const void *obj, TClass *cl, const char *errloc="DefineByRTTI")
virtual THaVar * Find(const char *name) const
virtual Int_t DefineVariables(const VarDef *list, const char *prefix="", const char *caller="")
TObject * Remove(TObject *obj) override
TObject * FindObject(const char *name) const override
void AddLast(TObject *obj) override
static const EReturnType kLong
TInterpreter::EReturnType EReturnType
static const EReturnType kDouble
const char * GetName() const override
virtual void Warning(const char *method, const char *msgfmt,...) const
R__ALWAYS_INLINE Bool_t IsZombie() const
virtual void Error(const char *method, const char *msgfmt,...) const
virtual TClass * IsA() const
EStatVal Status()
Ssiz_t Length() const
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
const char * Data() const
TString & Append(char c, Ssiz_t rep=1)
Bool_t IsNull() const
TString & Prepend(char c, Ssiz_t rep=1)
TString & Remove(EStripType s, char c)
TString & ReplaceAll(const char *s1, const char *s2)
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
STL namespace.
ClassImp(TPyArg)