ROOT logo
ROOT » TREE » TREE » TVirtualBranchBrowsable

class TVirtualBranchBrowsable: public TNamed


 TVirtualBranchBrowsable is a base class (not really abstract, but useless
 by itself) for helper objects that extend TBranch's browsing support.
 Each registered derived class's generator method is called, which fills
 all created helper objects into a list which can then be browsed.
 For details of what these browser helper objects can do, see e.g.
 TMethodBrowsable, which allows methods to show up in the TBrowser.

 Only registered helper objects are created. By default, only
 TMethodBrowsable, TNonSplitBrowsable, and TCollectionPropertyBrowsable
 are registered (see RegisterDefaultGenerators). You can prevent any of
 their objects to show up in the browser by unregistering the generator:
   TMethodBrowsable::Unregister()
 will stop creating browsable method helper objects from that call on.
 Note that these helper objects are cached (in TBranch::fBrowsables);
 already created (and thus cached) browsables will still appear in the
 browser even after unregistering the corresponding generator.

 You can implement your own browsable objects and thier generator; see
 e.g. the simple TCollectionPropertyBrowsable. Note that you will have
 to register your generator just like any other, and that you should
 implement the following methods for your own class, mainly for
 consistency reasons:
   static void Register() {
     TVirtualBranchBrowsable::RegisterGenerator(GetBrowsables); }
   static void Unregister() {
     TVirtualBranchBrowsable::UnregisterGenerator(GetBrowsables); }
 where GetBrowsables is a static member function of your class, that
 creates the browsable helper objects, and has the signature
   static Int_t GetBrowsables(TList& list, const TBranch* branch,
                              const TVirtualBranchBrowsable* parent=0);
 It has to return the number of browsable helper objects for parent
 (or, if NULL, for branch) which are added to the list.

Function Members (Methods)

public:
TVirtualBranchBrowsable(const TVirtualBranchBrowsable&)
virtual~TVirtualBranchBrowsable()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidBrowse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
static Int_tFillListOfBrowsables(TList& list, const TBranch* branch, const TVirtualBranchBrowsable* parent = 0)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
const TBranch*GetBranch() const
TClass*GetClassType() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*GetIconName() const
TList*GetLeaves() const
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
const TVirtualBranchBrowsable*GetParent() const
voidGetScope(TString& scope) const
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tIsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TNamed&TNamed::operator=(const TNamed& rhs)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTNamed::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
Bool_tTypeIsPointer() const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
TVirtualBranchBrowsable(const TBranch* b, TClass* type, Bool_t typeIsPointer, const TVirtualBranchBrowsable* parent = 0)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
static TClass*GetCollectionContainedType(const TBranch* b, const TVirtualBranchBrowsable* parent, TClass*& contained)
static list<MethodCreateListOfBrowsables_t>&GetRegisteredGenerators()
voidTObject::MakeZombie()
static voidRegisterGenerator(TVirtualBranchBrowsable::MethodCreateListOfBrowsables_t generator)
voidSetType(TClass* type)
voidSetTypeIsPointer(Bool_t set = kTRUE)
static voidUnregisterGenerator(TVirtualBranchBrowsable::MethodCreateListOfBrowsables_t generator)
private:
static voidRegisterDefaultGenerators()

Data Members

protected:
TStringTNamed::fNameobject identifier
TStringTNamed::fTitleobject title
private:
const TBranch*fBranchpointer to the branch element representing the top object
TClass*fClasspointer to TClass representing our type (i.e. return type for methods), 0 if basic type
TList*fLeavespointer to laves
const TVirtualBranchBrowsable*fParentparent method if this method is member of a returned class
Bool_tfTypeIsPointerreturn type is pointer to class
static list<MethodCreateListOfBrowsables_t>fgGeneratorslist of MethodCreateListOfBrowsables_t called by CreateListOfBrowsables
static Bool_tfgGeneratorsSethave we set the generators yet? empty is not good enough - user might have removed them

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TVirtualBranchBrowsable(const TBranch* b, TClass* type, Bool_t typeIsPointer, const TVirtualBranchBrowsable* parent = 0)
 constructor setting all members according to parameters.
~TVirtualBranchBrowsable()
 Destructor. Delete our leaves.
void Browse(TBrowser* b)
 Calls TTree::Draw on the method if return type is not a class;
 otherwise expands returned object's "folder"
Int_t FillListOfBrowsables(TList& list, const TBranch* branch, const TVirtualBranchBrowsable* parent = 0)
 Askes all registered generators to fill their browsables into
 the list. The browsables are generated for a given parent,
 or (if 0), for a given branch. The branch is passed down to
 leaves of TVirtualBranchBrowsable, too, as we need to access
 the branch's TTree to be able to traw.
TClass* GetCollectionContainedType(const TBranch* b, const TVirtualBranchBrowsable* parent, TClass*& contained)
 Check whether the branch (or the parent) contains a collection.
 If it does, set "contained" to the contained type (if we can
 retrieve it) and return the TClass for the collection. Set
 "contained" to the branch's (or parent's) contained object's
 class for non-collections, returning 0.

 Only one of "branch" or "parent" can ge given (depending on whether
 we are creating browsable objects for a branch or for another
 browsable object)
TList* GetLeaves() const
 Return list of leaves. If not set up yet we'll create them.
void GetScope(TString& scope) const
 Returns the full name for TTree::Draw to draw *this.
 Recursively appends, starting at the top TBranch,
 all method / object names with proper reference operators (->, .)
 depending on fTypeIsPointer.
void RegisterDefaultGenerators()
 Adds the default generators. The user can remove any of them as follows:
   TMethodBrowsable::Unregister();
 which will cause the browser not to show any methods.
void RegisterGenerator(TVirtualBranchBrowsable::MethodCreateListOfBrowsables_t generator)
 Adds a generator to be called when browsing branches.
 Called by the Register method, which should be implemented
 for all derived classes (see e.g. TMethodBrowsable::Register())
void UnregisterGenerator(TVirtualBranchBrowsable::MethodCreateListOfBrowsables_t generator)
 Removes a generator from the list of generators to be called when
 browsing branches. The user can remove any of the generators as follows:
   TMethodBrowsable::Unregister();
 which will cause the browser not to show any methods.
const char * GetIconName() const
 return icon shown when browsing a TVirtualBranchBrowsable
Bool_t IsFolder() const
 check whether we have sub-elements
const TBranch* GetBranch() const
 return the parent branch (might be many levels up)
const TVirtualBranchBrowsable* GetParent() const
 return the parent TVirtualBranchBrowsable
TClass* GetClassType() const
 return the type of this browsable object
Bool_t TypeIsPointer() const
 return whether the type of this browsable object is a pointer
TVirtualBranchBrowsable(const TBranch* b, TClass* type, Bool_t typeIsPointer, const TVirtualBranchBrowsable* parent = 0)
 static void Register()   has to be implemented for all derived classes!
 static void Unregister() has to be implemented for all derived classes!
std::list<MethodCreateListOfBrowsables_t>& GetRegisteredGenerators()
void SetType(TClass* type)
 sets the type of this browsable object
void SetTypeIsPointer(Bool_t set = kTRUE)
 sets whether the type of this browsable object is a pointer