76std::list<TVirtualBranchBrowsable::MethodCreateListOfBrowsables_t>
90 Warning(
"TVirtualBranchBrowsable",
"branch is NULL!");
108 || (
fClass->GetCollectionProxy()
109 &&
fClass->GetCollectionProxy()->GetType() > 0)) {
116 name.ReplaceAll(
".@",
"@.");
117 name.ReplaceAll(
"->@",
"@->");
121 Error(
"Browse",
"branch not set - might access wrong tree!");
123 }
else tree=
fBranch->GetTree();
124 tree->
Draw(
name,
"",
b ?
b->GetDrawOption() :
"");
141 std::list<MethodCreateListOfBrowsables_t>::iterator iGenerator;
144 numCreated+=(*(*iGenerator))(li, branch, parent);
174 if (clonesname && strlen(clonesname))
192 }
else if (clonesname && strlen(clonesname)) {
203 if (!clonesname || !clonesname[0])
return nullptr;
207 ::Warning(
"TVirtualBranchBrowsable::GetCollectionContainedType",
"Neither branch nor parent given!");
211 if (!type)
return nullptr;
257 }
else if (type->GetCollectionProxy()) {
258 contained=type->GetCollectionProxy()->GetValueClass();
305 if (!scope.
EndsWith(
".")) scope+=
".";
413 if (
name.EndsWith(
" const"))
name.Remove(
name.Length()-6);
416 name=
m->GetPrototype();
417 if (
m->GetCommentString() && strlen(
m->GetCommentString()))
418 name.Append(
" // ").Append(
m->GetCommentString());
421 TString plainReturnType(
m->GetReturnTypeName());
422 if (plainReturnType.
EndsWith(
"*")) {
425 plainReturnType.
Strip();
427 plainReturnType.
Remove(0,5);
428 plainReturnType.
Strip();
450 lnk; lnk=lnk->
Next()) {
451 cl=(
TClass*)lnk->GetObject();
457 if (bc) allClasses.
Add(bc);
462 for(
int el = 0; el < info->
GetElements()->GetEntries(); ++el) {
466 if (bc) allClasses.
Add(bc);
472 TIter iC(&allClasses);
473 while ((cl=(
TClass*)iC())) {
475 if (!methods)
continue;
478 while ((method=(
TMethod*)iM()))
480 allMethods.
Add(method);
483 TIter iM(&allMethods);
511 TIter iMethods(&listMethods);
512 while ((method=(
TMethod*)iMethods())) {
530 long property =
m->Property();
531 const char* baseName=
m->GetName();
532 if (
m->GetNargs() -
m->GetNargsOpt() == 0
535 &&
m->GetReturnTypeName()
536 && strcmp(
"void",
m->GetReturnTypeName())
537 && !strstr(baseName,
"DeclFile")
538 && !strstr(baseName,
"ImplFile")
539 && !strstr(baseName,
"operator")
540 && strcmp(baseName,
"IsA")
541 && strcmp(baseName,
"Class")
542 && strcmp(baseName,
"CanBypassStreamer")
543 && strcmp(baseName,
"Class_Name")
544 && strcmp(baseName,
"ClassName")
545 && strcmp(baseName,
"Clone")
546 && strcmp(baseName,
"DrawClone")
547 && strcmp(baseName,
"GetName")
548 && strcmp(baseName,
"GetDrawOption")
549 && strcmp(baseName,
"GetIconName")
550 && strcmp(baseName,
"GetOption")
551 && strcmp(baseName,
"GetTitle")
552 && strcmp(baseName,
"GetUniqueID")
553 && strcmp(baseName,
"Hash")
554 && strcmp(baseName,
"IsFolder")
555 && strcmp(baseName,
"IsOnHeap")
556 && strcmp(baseName,
"IsSortable")
557 && strcmp(baseName,
"IsZombie")) {
561 if (!cl)
return true;
563 if (!members)
return true;
564 if (!strncmp(baseName,
"Get", 3) ||
565 !strncmp(baseName,
"get", 3))
567 if (!baseName[0])
return true;
570 const char* arrMemberNames[3]={
"f%s",
"_%s",
"m%s"};
571 for (
Int_t i=0; !mem && i<3; i++)
573 return (!mem ||! ((
TDataMember*)mem)->IsPersistent());
622 element->IsaPointer(), parent)
637 && (branch==
nullptr ||
638 (
const_cast<TBranch*
>(branch)->GetListOfBranches()
639 &&
const_cast<TBranch*
>(branch)->GetListOfBranches()->GetEntries()!=0)
647 TClass* clContained=
nullptr;
654 if (!branch && parent) branch=parent->
GetBranch();
657 TList myStreamerElementsToCheck;
664 link = link->
Next() ) {
666 if (streamerElement->
IsBase()) {
676 if (!baseElements)
continue;
677 TIter iBaseSE(baseElements);
681 myStreamerElementsToCheck.
Add(baseSE);
682 }
else if (!strcmp(streamerElement->
GetName(),
"This")
689 if (!clElements)
continue;
702 ::Error(
"TNonSplitBrowsable::GetBrowsables",
703 "Missing the StreamerInfo for the class \"%s\" for the branch \"%s\" in the TTree \"%s\".",
776 TClass* clContained=
nullptr;
778 if (!clCollection || !clContained)
return 0;
804 ::Warning(
"TCollectionPropertyBrowsable::GetBrowsables",
"Neither branch nor parent is set!");
817 if (lastPart==
kNPOS || (lastArrow!=
kNPOS && lastPart<lastArrow))
819 if (lastPart==
kNPOS) lastPart=0;
822 TString size_title(
"size of ");
823 size_title += clCollection->
GetName();
825 size_title +=
" of ";
826 size_title += clContained->
GetName();
840 scope, branch, parent);
843 scope.
Insert(lastPart,
"@");
845 scope+
".size()", branch, parent);
853 scope+=
"@.GetEntries()";
854 else scope+=
"@.GetSize()";
923 TClass* clContained=
nullptr;
926 if (!clContainer || !clContained)
return 0;
931 TIter iMethods(&listMethods);
932 while ((method=(
TMethod*)iMethods()))
941 std::list<MethodCreateListOfBrowsables_t>::iterator iIsRegistered
943 if (iIsRegistered==listGenerators.end()) {
int Int_t
Signed integer 4 bytes (int).
int Ssiz_t
String size (currently int).
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
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.
const char * GetClassName() const override
Return the name of the user class whose content is stored in this branch, if any.
TStreamerInfo * GetInfo() const
Get streamer info for the branch class.
virtual const char * GetClonesName() const
A Branch for the case of an object.
const char * GetClassName() const override
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.
TClass * IsA() const override
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,...
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
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.
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.
static void Register()
Wrapper for the registration method.
TCollectionPropertyBrowsable(const char *name, const char *title, const char *draw, const TBranch *branch, const TVirtualBranchBrowsable *parent=nullptr)
constructor, which sets the name and title according to the parameters (and thus differently than our...
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 void AddAll(const TCollection *col)
Add all objects from collection col to this collection.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
void Browse(TBrowser *b) override
Browse this collection (called by TBrowser).
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
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
void Add(TObject *obj) override
virtual TObjLink * FirstLink() const
static bool IsMethodBrowsable(const TMethod *m)
A TMethod is browsable if it is const, public and not pure virtual, if does not have any parameter wi...
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,...
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.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual void SetNameTitle(const char *name, const char *title)
Set all the TNamed parameters (name and title).
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 override
Return the object in the first slot.
Wrapper around a TObject so it can be stored in a TList.
friend class TClonesArray
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 * IsA() const
TObject()
TObject constructor.
Describe one element (data member) to be Streamed.
virtual TClass * GetClassPointer() const
Returns a pointer to the TClass of this element and updates fClassObject.
const char * GetTypeName() const
virtual Bool_t IsBase() const
Return kTRUE if the element represent a base class.
TStreamerElement * GetElement(Int_t id) const override
Int_t GetNelement() 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.
void Draw(Option_t *opt) override
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.
void SetTypeIsPointer(bool set=true)
sets whether the type of this browsable object is a pointer
TList * GetLeaves() const
Return list of leaves. If not set up yet we'll create them.
~TVirtualBranchBrowsable() override
Destructor. Delete our leaves.
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.
static std::list< MethodCreateListOfBrowsables_t > fgGenerators
list of MethodCreateListOfBrowsables_t called by CreateListOfBrowsables
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.
TVirtualBranchBrowsable(const TBranch *b, TClass *type, bool typeIsPointer, const TVirtualBranchBrowsable *parent=nullptr)
Constructor setting all members according to parameters.
void Browse(TBrowser *b) override
Calls TTree::Draw on the method if return type is not a class; otherwise expands returned object's "f...
static bool fgGeneratorsSet
have we set the generators yet? empty is not good enough - user might have removed them
static std::list< MethodCreateListOfBrowsables_t > & GetRegisteredGenerators()
returns the list of registered generator methods
Int_t(* MethodCreateListOfBrowsables_t)(TList &, const TBranch *branch, const TVirtualBranchBrowsable *parent)
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.
bool fTypeIsPointer
return type is pointer to class
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
Defines a common interface to inspect/change the contents of an object that represents a collection.
virtual TClass * GetValueClass() const =0
If the value type is a user-defined class, return a pointer to the TClass representing the value type...
Abstract Interface class describing Streamer information for one class.
Bool_t IsCompiled() const
virtual TObjArray * GetElements() const =0