#include "TBranchBrowsable.h" |
TCollectionPropertyBrowsable
class description - source file - inheritance tree (.pdf)
protected:
TCollectionPropertyBrowsable(const char* name, const char* title, const char* draw, const TBranch* branch, const TVirtualBranchBrowsable* parent = 0)
public:
TCollectionPropertyBrowsable(const TCollectionPropertyBrowsable&)
~TCollectionPropertyBrowsable()
virtual void Browse(TBrowser* b)
static TClass* Class()
static Int_t GetBrowsables(TList& list, const TBranch* branch, const TVirtualBranchBrowsable* parent = 0)
const char* GetDraw() const
virtual TClass* IsA() const
static void Register()
virtual void ShowMembers(TMemberInspector& insp, char* parent)
virtual void Streamer(TBuffer& b)
void StreamerNVirtual(TBuffer& b)
static void Unregister()
private:
TString fDraw string to send to TTree::Draw(), NOT by GetScope()!
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.
______________________________________________________________________________
void Browse(TBrowser *b)
Browses a TCollectionPropertyBrowsable. The only difference to
the generic TVirtualBranchBrowsable::Browse is our fDraw
Int_t GetBrowsables(TList& li, const TBranch* branch,
const TVirtualBranchBrowsable* parent /* =0 */)
If the element to browse (given by either parent of branch) contains
a collection (TClonesArray or something for which a TVirtualCollectionProxy
exists), we will add some special objects to the browser. For now there is
just one object "@size", returning the size of the collection (as in
std::list::size(), or TClonesArray::GetEntries()).
The objects we create are simply used to forward strings (like "@size") to
TTreeFormula via our Browse method. These strings are stored in fName.
void Register()
Wrapper for the registration method. Needed against MSVC, which
assigned different addr to the same method, depending on what
translation unit you're in...
void Unregister()
Wrapper for the registration method. Needed against MSVC, which
assigned different addr to the same method, depending on what
translation unit you're in...
Inline Functions
void ~TCollectionPropertyBrowsable()
const char* GetDraw() const
TCollectionPropertyBrowsable TCollectionPropertyBrowsable(const char* name, const char* title, const char* draw, const TBranch* branch, const TVirtualBranchBrowsable* parent = 0)
TClass* Class()
TClass* IsA() const
void ShowMembers(TMemberInspector& insp, char* parent)
void Streamer(TBuffer& b)
void StreamerNVirtual(TBuffer& b)
TCollectionPropertyBrowsable TCollectionPropertyBrowsable(const TCollectionPropertyBrowsable&)
Author: Axel Naumann 14/10/2004
Last update: root/tree:$Name: $:$Id: TBranchBrowsable.cxx,v 1.6 2005/07/18 21:05:03 pcanal Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
ROOT page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.