77std::list<TVirtualBranchBrowsable::MethodCreateListOfBrowsables_t>
87fBranch(branch), fParent(parent), fLeaves(nullptr),
fClass(
type), fTypeIsPointer(typeIsPointer)
91 Warning(
"TVirtualBranchBrowsable",
"branch is NULL!");
117 name.ReplaceAll(
".@",
"@.");
118 name.ReplaceAll(
"->@",
"@->");
122 Error(
"Browse",
"branch not set - might access wrong tree!");
125 tree->Draw(
name,
"",
b ?
b->GetDrawOption() :
"");
142 std::list<MethodCreateListOfBrowsables_t>::iterator iGenerator;
145 numCreated+=(*(*iGenerator))(li, branch, parent);
169 if (branch->IsA()==TBranchElement::Class()) {
175 if (clonesname && strlen(clonesname))
193 }
else if (clonesname && strlen(clonesname)) {
199 }
else if (branch->IsA()==TBranchObject::Class()) {
204 if (!clonesname || !clonesname[0])
return 0;
208 ::Warning(
"TVirtualBranchBrowsable::GetCollectionContainedType",
"Neither branch nor parent given!");
215 if (
type->InheritsFrom(TClonesArray::Class())
216 && branch->IsA()==TBranchObject::Class()
229 if (objContainer && objContainer->IsA()==TClonesArray::Class()) {
234 }
else if (
type->InheritsFrom(TClonesArray::Class())
235 && branch->IsA()==TBranchElement::Class()
255 }
else if (
type->InheritsFrom(TCollection::Class())) {
258 }
else if (
type->GetCollectionProxy()) {
259 contained=
type->GetCollectionProxy()->GetValueClass();
261 }
else if (
type->InheritsFrom(TRef::Class()))
306 if (!scope.
EndsWith(
".")) scope+=
".";
415 if (
name.EndsWith(
" const"))
name.Remove(
name.Length()-6);
418 name=
m->GetPrototype();
419 if (
m->GetCommentString() && strlen(
m->GetCommentString()))
420 name.Append(
" // ").Append(
m->GetCommentString());
423 TString plainReturnType(
m->GetReturnTypeName());
424 if (plainReturnType.
EndsWith(
"*")) {
427 plainReturnType.
Strip();
429 plainReturnType.
Remove(0,5);
430 plainReturnType.
Strip();
452 lnk; lnk=lnk->Next()) {
453 cl=(
TClass*)lnk->GetObject();
459 if (bc) allClasses.
Add(bc);
464 for(
int el = 0; el < info->
GetElements()->GetEntries(); ++el) {
468 if (bc) allClasses.
Add(bc);
474 TIter iC(&allClasses);
475 while ((cl=(
TClass*)iC())) {
477 if (!methods)
continue;
480 while ((method=(
TMethod*)iM()))
482 allMethods.
Add(method);
485 TIter iM(&allMethods);
513 TIter iMethods(&listMethods);
514 while ((method=(
TMethod*)iMethods())) {
532 long property =
m->Property();
533 if (
m->GetNargs() -
m->GetNargsOpt() == 0
536 &&
m->GetReturnTypeName()
537 && strcmp(
"void",
m->GetReturnTypeName())
538 && !strstr(
m->GetName(),
"DeclFile")
539 && !strstr(
m->GetName(),
"ImplFile")
540 && strcmp(
m->GetName(),
"IsA")
541 && strcmp(
m->GetName(),
"Class")
542 && strcmp(
m->GetName(),
"CanBypassStreamer")
543 && strcmp(
m->GetName(),
"Class_Name")
544 && strcmp(
m->GetName(),
"ClassName")
545 && strcmp(
m->GetName(),
"Clone")
546 && strcmp(
m->GetName(),
"DrawClone")
547 && strcmp(
m->GetName(),
"GetName")
548 && strcmp(
m->GetName(),
"GetDrawOption")
549 && strcmp(
m->GetName(),
"GetIconName")
550 && strcmp(
m->GetName(),
"GetOption")
551 && strcmp(
m->GetName(),
"GetTitle")
552 && strcmp(
m->GetName(),
"GetUniqueID")
553 && strcmp(
m->GetName(),
"Hash")
554 && strcmp(
m->GetName(),
"IsFolder")
555 && strcmp(
m->GetName(),
"IsOnHeap")
556 && strcmp(
m->GetName(),
"IsSortable")
557 && strcmp(
m->GetName(),
"IsZombie")) {
561 if (!cl)
return kTRUE;
563 if (!members)
return kTRUE;
565 if (!strncmp(
m->GetName(),
"Get", 3) ||
566 !strncmp(
m->GetName(),
"get", 3))
568 if (!baseName[0])
return kTRUE;
571 const char* arrMemberNames[3]={
"f%s",
"_%s",
"m%s"};
572 for (
Int_t i=0; !mem && i<3; i++)
574 return (!mem ||! ((
TDataMember*)mem)->IsPersistent());
624 element->IsaPointer(), parent)
640 (
const_cast<TBranch*
>(branch)->GetListOfBranches()
641 &&
const_cast<TBranch*
>(branch)->GetListOfBranches()->GetEntries()!=0)
656 if (!branch && parent) branch=parent->
GetBranch();
659 TList myStreamerElementsToCheck;
666 link = link->Next() ) {
668 if (streamerElement->
IsBase()) {
678 if (!baseElements)
continue;
679 TIter iBaseSE(baseElements);
683 myStreamerElementsToCheck.
Add(baseSE);
684 }
else if (!strcmp(streamerElement->
GetName(),
"This")
691 if (!clElements)
continue;
704 ::Error(
"TNonSplitBrowsable::GetBrowsables",
705 "Missing the StreamerInfo for the class \"%s\" for the branch \"%s\" in the TTree \"%s\".",
781 if (!clCollection || !clContained)
return 0;
807 ::Warning(
"TCollectionPropertyBrowsable::GetBrowsables",
"Neither branch nor parent is set!");
820 if (lastPart==
kNPOS || (lastArrow!=
kNPOS && lastPart<lastArrow))
822 if (lastPart==
kNPOS) lastPart=0;
825 TString size_title(
"size of ");
826 size_title += clCollection->
GetName();
828 size_title +=
" of ";
829 size_title += clContained->
GetName();
843 scope, branch, parent);
846 scope.
Insert(lastPart,
"@");
848 scope+
".size()", branch, parent);
852 else if (clCollection->
InheritsFrom(TCollection::Class())) {
856 scope+=
"@.GetEntries()";
857 else scope+=
"@.GetSize()";
930 if (!clContainer || !clContained)
return 0;
935 TIter iMethods(&listMethods);
936 while ((method=(
TMethod*)iMethods()))
945 std::list<MethodCreateListOfBrowsables_t>::iterator iIsRegistered
947 if (iIsRegistered==listGenerators.end()) {
Each class (see TClass) has a linked list of its base class(es).
TClass * GetClassPointer(Bool_t load=kTRUE)
Get pointer to the base class TClass.
A Branch for the case of an object.
TStreamerInfo * GetInfo() const
Get streamer info for the branch class.
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any.
virtual const char * GetClonesName() const
A Branch for the case of an object.
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any.
A TTree is a list of TBranches.
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all leaves of entry and return total number of bytes read.
Long64_t GetReadEntry() const
TObjArray * GetListOfLeaves()
TBranch * GetMother() const
Get our top-level parent branch in the tree.
Using a TBrowser one can browse all ROOT objects.
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.
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
Bool_t IsLoaded() const
Return true if the shared library of this class is currently in the a process's memory.
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0, Bool_t isTransient=kFALSE) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist,...
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
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.
An array of clone (identical) objects.
TCollectionMethodBrowsable extends TCollectionPropertyBrowsable by showing all methods of the collect...
static void Register()
Wrapper for the registration method.
static Int_t GetBrowsables(TList &list, const TBranch *branch, const TVirtualBranchBrowsable *parent=nullptr)
This methods fills list with TMethodBrowsables for the branch's or parent's collection class and its ...
TCollectionMethodBrowsable(const TBranch *branch, TMethod *m, const TVirtualBranchBrowsable *parent=nullptr)
Constructor, see TMethodBrowsable's constructor.
static void Unregister()
Wrapper for the registration method.
A tiny browser helper object (and its generator) for adding a virtual (as in "not actually part of th...
static void Register()
Wrapper for the registration method.
static Int_t GetBrowsables(TList &list, const TBranch *branch, const TVirtualBranchBrowsable *parent=nullptr)
If the element to browse (given by either parent of branch) contains a collection (TClonesArray or so...
static void Unregister()
Wrapper for the registration method.
const char * GetDraw() const
return the string passed to TTree::Draw
void Browse(TBrowser *b) override
Browses a TCollectionPropertyBrowsable.
virtual const char * GetName() const
Return name of this collection.
virtual void AddAll(const TCollection *col)
Add all objects from collection col to this collection.
void Browse(TBrowser *b)
Browse this collection (called by TBrowser).
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
All ROOT classes may have RTTI (run time type identification) support added.
A TLeaf for a general object derived from TObject.
TObject * GetObject() const
virtual void Add(TObject *obj)
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
virtual TObjLink * FirstLink() const
This helper object allows the browsing of methods of objects stored in branches.
static Int_t GetBrowsables(TList &list, const TBranch *branch, const TVirtualBranchBrowsable *parent=nullptr)
This methods fills list with TMethodBrowsables for the branch's or parent's class and its base classe...
static void GetBrowsableMethodsForClass(TClass *cl, TList &list)
Given a class, this methods fills list with TMethodBrowsables for the class and its base classes,...
static Bool_t IsMethodBrowsable(const TMethod *m)
A TMethod is browsable if it is const, public and not pure virtual, if does not have any parameter wi...
TMethodBrowsable(const TBranch *branch, TMethod *m, const TVirtualBranchBrowsable *parent=nullptr)
Constructor.
static void Unregister()
Wrapper for the registration method.
static void Register()
Wrapper for the registration method.
Each ROOT class (see TClass) has a linked list of methods.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
virtual void SetNameTitle(const char *name, const char *title)
Set all the TNamed parameters (name and title).
Allows a TBrowser to browse non-split branches as if they were split.
TNonSplitBrowsable(const TStreamerElement *element, const TBranch *branch, const TVirtualBranchBrowsable *parent=nullptr)
Constructor.
static Int_t GetBrowsables(TList &list, const TBranch *branch, const TVirtualBranchBrowsable *parent=nullptr)
Given either a branch "branch" or a "parent" TVirtualBranchBrowsable, we fill "list" with objects of ...
static void Unregister()
Wrapper for the registration method.
static void Register()
Wrapper for the registration method.
Int_t GetEntriesFast() const
TObject * UncheckedAt(Int_t i) const
TObject * First() const
Return the object in the first slot.
Wrapper around a TObject so it can be stored in a TList.
Mother of all ROOT objects.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual TClass * GetClassPointer() const
Returns a pointer to the TClass of this element.
const char * GetTypeName() const
virtual Bool_t IsBase() const
Return kTRUE if the element represent a base class.
Int_t GetNelement() const
TStreamerElement * GetElement(Int_t id) const
TString & Insert(Ssiz_t pos, const char *s)
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
Ssiz_t First(char c) const
Find first occurrence of a character c.
Ssiz_t Last(char c) const
Find last occurrence of a character c.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
TString & Prepend(const char *cs)
TString & Remove(Ssiz_t pos)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
A TTree represents a columnar dataset.
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
TVirtualBranchBrowsable is a base class (not really abstract, but useless by itself) for helper objec...
void SetType(TClass *type)
sets the type of this browsable object
const TBranch * fBranch
pointer to the branch element representing the top object
const TBranch * GetBranch() const
return the parent branch (might be many levels up)
static TClass * GetCollectionContainedType(const TBranch *b, const TVirtualBranchBrowsable *parent, TClass *&contained)
Check whether the branch (or the parent) contains a collection.
~TVirtualBranchBrowsable()
Destructor. Delete our leaves.
TList * GetLeaves() const
Return list of leaves. If not set up yet we'll create them.
static void RegisterGenerator(MethodCreateListOfBrowsables_t generator)
Adds a generator to be called when browsing branches.
void GetScope(TString &scope) const
Returns the full name for TTree::Draw to draw *this.
TVirtualBranchBrowsable(const TBranch *b, TClass *type, Bool_t typeIsPointer, const TVirtualBranchBrowsable *parent=nullptr)
Constructor setting all members according to parameters.
static std::list< MethodCreateListOfBrowsables_t > fgGenerators
list of MethodCreateListOfBrowsables_t called by CreateListOfBrowsables
void SetTypeIsPointer(Bool_t set=kTRUE)
sets whether the type of this browsable object is a pointer
TList * fLeaves
pointer to leaves
static Int_t FillListOfBrowsables(TList &list, const TBranch *branch, const TVirtualBranchBrowsable *parent=nullptr)
Askes all registered generators to fill their browsables into the list.
void Browse(TBrowser *b) override
Calls TTree::Draw on the method if return type is not a class; otherwise expands returned object's "f...
Bool_t fTypeIsPointer
return type is pointer to class
static std::list< MethodCreateListOfBrowsables_t > & GetRegisteredGenerators()
returns the list of registered generator methods
static void UnregisterGenerator(MethodCreateListOfBrowsables_t generator)
Removes a generator from the list of generators to be called when browsing branches.
static void RegisterDefaultGenerators()
Adds the default generators.
static Bool_t fgGeneratorsSet
have we set the generators yet? empty is not good enough - user might have removed them
const TVirtualBranchBrowsable * fParent
parent method if this method is member of a returned class
TClass * fClass
pointer to TClass representing our type (i.e. return type for methods), 0 if basic type
TClass * GetClassType() const
return the type of this browsable object
virtual EDataType GetType() const =0
virtual TClass * GetValueClass() const =0
Abstract Interface class describing Streamer information for one class.
Bool_t IsCompiled() const
virtual TObjArray * GetElements() const =0