75 std::list<TVirtualBranchBrowsable::MethodCreateListOfBrowsables_t>
85 fBranch(branch), fParent(parent), fLeaves(0),
fClass(type), fTypeIsPointer(typeIsPointer)
89 Warning(
"TVirtualBranchBrowsable",
"branch is NULL!");
120 Error(
"Browse",
"branch not set - might access wrong tree!");
140 std::list<MethodCreateListOfBrowsables_t>::iterator iGenerator;
143 numCreated+=(*(*iGenerator))(li, branch, parent);
173 if (clonesname && strlen(clonesname))
191 }
else if (clonesname && strlen(clonesname)) {
202 if (!clonesname || !clonesname[0])
return 0;
206 ::Warning(
"TVirtualBranchBrowsable::GetCollectionContainedType",
"Neither branch nor parent given!");
304 if (!scope.
EndsWith(
".")) scope+=
".";
308 if (!nameMother.EndsWith(
".")) {
412 if (name.EndsWith(
" const")) name.Remove(name.Length()-6);
421 if (plainReturnType.EndsWith(
"*")) {
423 plainReturnType.Remove(plainReturnType.Length()-1);
424 plainReturnType.Strip();
425 if(plainReturnType.BeginsWith(
"const")) {
426 plainReturnType.Remove(0,5);
427 plainReturnType.Strip();
449 lnk; lnk=lnk->
Next()) {
450 cl=(
TClass*)lnk->GetObject();
456 if (bc) allClasses.
Add(bc);
465 if (bc) allClasses.
Add(bc);
471 TIter iC(&allClasses);
472 while ((cl=(
TClass*)iC())) {
474 if (!methods)
continue;
477 while ((method=(
TMethod*)iM()))
479 allMethods.
Add(method);
482 TIter iM(&allMethods);
510 TIter iMethods(&listMethods);
511 while ((method=(
TMethod*)iMethods())) {
534 && !strstr(m->
GetName(),
"DeclFile")
535 && !strstr(m->
GetName(),
"ImplFile")
537 && strcmp(m->
GetName(),
"Class")
538 && strcmp(m->
GetName(),
"CanBypassStreamer")
539 && strcmp(m->
GetName(),
"Class_Name")
540 && strcmp(m->
GetName(),
"ClassName")
541 && strcmp(m->
GetName(),
"Clone")
542 && strcmp(m->
GetName(),
"DrawClone")
543 && strcmp(m->
GetName(),
"GetName")
544 && strcmp(m->
GetName(),
"GetDrawOption")
545 && strcmp(m->
GetName(),
"GetIconName")
546 && strcmp(m->
GetName(),
"GetOption")
547 && strcmp(m->
GetName(),
"GetTitle")
548 && strcmp(m->
GetName(),
"GetUniqueID")
550 && strcmp(m->
GetName(),
"IsFolder")
551 && strcmp(m->
GetName(),
"IsOnHeap")
552 && strcmp(m->
GetName(),
"IsSortable")
553 && strcmp(m->
GetName(),
"IsZombie")) {
557 if (!cl)
return kTRUE;
559 if (!members)
return kTRUE;
560 const char* baseName=m->
GetName();
561 if (!strncmp(m->
GetName(),
"Get", 3) ||
562 !strncmp(m->
GetName(),
"get", 3))
564 if (!baseName[0])
return kTRUE;
567 const char* arrMemberNames[3]={
"f%s",
"_%s",
"m%s"};
568 for (
Int_t i=0; !mem && i<3; i++)
570 return (!mem ||! ((
TDataMember*)mem)->IsPersistent());
619 element->IsaPointer(), parent)
635 (const_cast<TBranch*>(branch)->GetListOfBranches()
636 && const_cast<TBranch*>(branch)->GetListOfBranches()->GetEntries()!=0)
651 if (!branch && parent) branch=parent->
GetBranch();
654 TList myStreamerElementsToCheck;
663 if (streamerElement->
IsBase()) {
673 if (!baseElements)
continue;
674 TIter iBaseSE(baseElements);
678 myStreamerElementsToCheck.
Add(baseSE);
679 }
else if (!strcmp(streamerElement->
GetName(),
"This")
686 if (!clElements)
continue;
699 ::Error(
"TNonSplitBrowsable::GetBrowsables",
700 "Missing the StreamerInfo for the class \"%s\" for the branch \"%s\" in the TTree \"%s\".",
775 if (!clCollection || !clContained)
return 0;
788 if (!nameMother.EndsWith(
".")) {
801 ::Warning(
"TCollectionPropertyBrowsable::GetBrowsables",
"Neither branch nor parent is set!");
814 if (lastPart==
kNPOS || (lastArrow!=
kNPOS && lastPart<lastArrow))
816 if (lastPart==
kNPOS) lastPart=0;
819 TString size_title(
"size of ");
820 size_title += clCollection->
GetName();
822 size_title +=
" of ";
823 size_title += clContained->
GetName();
837 scope, branch, parent);
840 scope.
Insert(lastPart,
"@");
842 scope+
".size()", branch, parent);
850 scope+=
"@.GetEntries()";
851 else scope+=
"@.GetSize()";
923 if (!clContainer || !clContained)
return 0;
928 TIter iMethods(&listMethods);
929 while ((method=(
TMethod*)iMethods()))
938 std::list<MethodCreateListOfBrowsables_t>::iterator iIsRegistered
940 if (iIsRegistered==listGenerators.end()) {
static void Unregister()
Wrapper for the registration method.
Long64_t GetReadEntry() const
virtual const char * GetTitle() const
Returns title of object.
Ssiz_t Last(char c) const
Find last occurrence of a character c.
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
Int_t GetNelement() const
void GetScope(TString &scope) const
Returns the full name for TTree::Draw to draw *this.
static void RegisterDefaultGenerators()
Adds the default generators.
const char * GetTypeName() const
Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
A Branch for the case of an object.
virtual TClass * GetValueClass() const =0
All ROOT classes may have RTTI (run time type identification) support added.
A TLeaf for a general object derived from TObject.
TString & ReplaceAll(const TString &s1, const TString &s2)
TClass * GetClassPointer(Bool_t load=kTRUE)
Get pointer to the base class TClass.
const char * GetReturnTypeName() const
Get full type description of function return type, e,g.: "class TDirectory*".
static Int_t GetBrowsables(TList &list, const TBranch *branch, const TVirtualBranchBrowsable *parent=0)
This methods fills list with TMethodBrowsables for the branch's or parent's collection class and its ...
Int_t GetNargs() const
Number of function arguments.
virtual void SetName(const char *name)
Change (i.e.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
ClassImp(TVirtualBranchBrowsable)
static Int_t GetBrowsables(TList &list, const TBranch *branch, const TVirtualBranchBrowsable *parent=0)
This methods fills list with TMethodBrowsables for the branch's or parent's class and its base classe...
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
static void Register()
Wrapper for the registration method.
virtual Bool_t IsBase() const
Return kTRUE if the element represent a base class.
Int_t GetEntriesFast() const
TString & Prepend(const char *cs)
virtual EDataType GetType() const =0
virtual void SetNameTitle(const char *name, const char *title)
Change (i.e. set) all the TNamed parameters (name and title).
TString & Insert(Ssiz_t pos, const char *s)
const TVirtualBranchBrowsable * fParent
A tiny browser helper object (and its generator) for adding a virtual (as in "not actually part of th...
virtual const char * GetClonesName() const
void SetType(TClass *type)
static Int_t FillListOfBrowsables(TList &list, const TBranch *branch, const TVirtualBranchBrowsable *parent=0)
Askes all registered generators to fill their browsables into the list.
ClassImp(RooList) TObjOptLink *RooList TObjLink * link
Find the link corresponding to the named object in this list.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
const TBranch * GetBranch() const
static void GetBrowsableMethodsForClass(TClass *cl, TList &list)
Given a class, this methods fills list with TMethodBrowsables for the class and its base classes...
static void Unregister()
Wrapper for the registration method.
TNonSplitBrowsable(const TStreamerElement *element, const TBranch *branch, const TVirtualBranchBrowsable *parent=0)
Constructor.
TStreamerInfo * GetInfo() const
Get streamer info for the branch class.
Bool_t IsCompiled() const
virtual void AddAll(const TCollection *col)
TCollectionMethodBrowsable(const TBranch *branch, TMethod *m, const TVirtualBranchBrowsable *parent=0)
Contructor, see TMethodBrowsable's constructor.
TClass * fClass
pointer to the foreign object
TObject * First() const
Return the object in the first slot.
virtual const char * GetCommentString()
Returns a comment string from the class declaration.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
static TClass * GetCollectionContainedType(const TBranch *b, const TVirtualBranchBrowsable *parent, TClass *&contained)
Check whether the branch (or the parent) contains a collection.
static void Register()
Wrapper for the registration method.
TObject * UncheckedAt(Int_t i) const
Int_t GetNargsOpt() const
Number of function optional (default) arguments.
Using a TBrowser one can browse all ROOT objects.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist...
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...
TBranch * GetMother() const
Get our top-level parent branch in the tree.
static void RegisterGenerator(MethodCreateListOfBrowsables_t generator)
Adds a generator to be called when browsing branches.
TCollectionMethodBrowsable extends TCollectionPropertyBrowsable by showing all methods of the collect...
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any. ...
static Int_t GetBrowsables(TList &list, const TBranch *branch, const TVirtualBranchBrowsable *parent=0)
Given either a branch "branch" or a "parent" TVirtualBranchBrowsable, we fill "list" with objects of ...
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all leaves of entry and return total number of bytes read.
virtual const char * GetName() const
Returns name of object.
The ROOT global object gROOT contains a list of all defined classes.
Long_t Property() const
Get property description word. For meaning of bits see EProperty.
static void Unregister()
Wrapper for the registration method.
virtual TObjLink * FirstLink() const
static Bool_t fgGeneratorsSet
TMethodBrowsable(const TBranch *branch, TMethod *m, const TVirtualBranchBrowsable *parent=0)
Constructor.
TVirtualBranchBrowsable is a base class (not really abstract, but useless by itself) for helper objec...
Each class (see TClass) has a linked list of its base class(es).
A Branch for the case of an object.
void SetTypeIsPointer(Bool_t set=kTRUE)
TString & Remove(Ssiz_t pos)
Bool_t IsLoaded() const
Return true if the shared library of this class is currently in the a process's memory.
TClass * GetClass() const
virtual Int_t GetSize() const
virtual const char * GetPrototype() const
Returns the prototype of a function as defined by CINT, or 0 in case of error.
virtual TObjArray * GetElements() const =0
virtual TClass * GetClassPointer() const
Returns a pointer to the TClass of this element.
TClass * GetClassType() const
Wrapper around a TObject so it can be stored in a TList.
void Browse(TBrowser *b)
Calls TTree::Draw on the method if return type is not a class; otherwise expands returned object's "f...
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
TCollectionPropertyBrowsable(const char *name, const char *title, const char *draw, const TBranch *branch, const TVirtualBranchBrowsable *parent=0)
TObject * GetObject() const
void Browse(TBrowser *b)
Browse this collection (called by TBrowser).
TObjArray * GetListOfLeaves()
Int_t GetEntries() const
Return the number of objects in array (i.e.
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, 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.
TList * GetLeaves() const
Return list of leaves. If not set up yet we'll create them.
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Mother of all ROOT objects.
static void Register()
Wrapper for the registration method.
An array of clone (identical) objects.
static Int_t GetBrowsables(TList &list, const TBranch *branch, const TVirtualBranchBrowsable *parent=0)
If the element to browse (given by either parent of branch) contains a collection (TClonesArray or so...
virtual void Add(TObject *obj)
Each ROOT class (see TClass) has a linked list of methods.
TStreamerElement * GetElement(Int_t id) const
static void Unregister()
Wrapper for the registration method.
A TTree object has a header with a name and a title.
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
static std::list< MethodCreateListOfBrowsables_t > fgGenerators
static void Register()
Wrapper for the registration method.
void Browse(TBrowser *b)
Browses a TCollectionPropertyBrowsable.
A TTree is a list of TBranches.
Abstract Interface class describing Streamer information for one class.
static std::list< MethodCreateListOfBrowsables_t > & GetRegisteredGenerators()
returns the list of registered generator methods
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
TList * GetListOfMethods(Bool_t load=kTRUE)
Return list containing the TMethods of a class.
~TVirtualBranchBrowsable()
Destructor. Delete our leaves.
TVirtualBranchBrowsable(const TBranch *b, TClass *type, Bool_t typeIsPointer, const TVirtualBranchBrowsable *parent=0)
Constructor setting all members according to parameters.
Allows a TBrowser to browse non-split branches as if they were split.
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * GetDraw() const
static void UnregisterGenerator(MethodCreateListOfBrowsables_t generator)
Removes a generator from the list of generators to be called when browsing branches.
This helper object allows the browsing of methods of objects stored in branches.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.