Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

TBranchElement.h

Go to the documentation of this file.
00001 // @(#)root/tree:$Name:  $:$Id: TBranchElement.h,v 1.29 2003/06/21 06:07:47 brun Exp $
00002 // Author: Rene Brun   14/01/2001
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TBranchElement
00013 #define ROOT_TBranchElement
00014 
00015 
00017 //                                                                      //
00018 // TBranchElement                                                       //
00019 //                                                                      //
00020 // A Branch for the case of an object.                                  //
00022 
00023 
00024 #ifndef ROOT_TBranch
00025 #include "TBranch.h"
00026 #endif
00027 
00028 class TFolder;
00029 class TStreamerInfo;
00030 
00031 class TBranchElement : public TBranch {
00032 
00033 protected:
00034     enum { kWarn = BIT(13), kBranchFolder = BIT(14) ,kDeleteObject = BIT(16)};
00035 
00036     TString             fClassName;     //Class name of referenced object
00037     TString             fParentName;    //Name of parent class
00038     TString             fClonesName;    //Name of class in TClonesArray (if any)
00039     Int_t               fClassVersion;  //Version number of class
00040     Int_t               fID;            //element serial number in fInfo
00041     Int_t               fType;          //branch type
00042     Int_t               fStreamerType;  //branch streamer type
00043     Int_t               fMaximum;       //Maximum entries for a TClonesArray or variable array
00044     Int_t               fNdata;         
00045     TBranchElement     *fBranchCount;   //pointer to primary branchcount branch
00046     TBranchElement     *fBranchCount2;  //pointer to secondary branchcount branch
00047     TStreamerInfo      *fInfo;          
00048     char               *fObject;        
00049     char               *fBranchPointer; 
00050 
00051             Int_t    GetDataMemberOffset(const TClass *cl, const char *name);
00052 
00053 public:
00054     TBranchElement();
00055     TBranchElement(const char *name, TStreamerInfo *sinfo, Int_t id, char *pointer, Int_t basketsize=32000, Int_t splitlevel = 0, Int_t btype=0);
00056     TBranchElement(const char *name, TClonesArray *clones, Int_t basketsize=32000, Int_t splitlevel = 0, Int_t compress=-1);
00057     virtual ~TBranchElement();
00058 
00059     virtual Int_t    Branch(const char *folder, Int_t bufsize=32000, Int_t splitlevel=99);
00060     virtual TBranch *Branch(const char *name, void *address, const char *leaflist, Int_t bufsize=32000);
00061     virtual TBranch *Branch(const char *name, const char *classname, void *addobj, Int_t bufsize=32000, Int_t splitlevel=99);
00062     virtual void     Browse(TBrowser *b);
00063             void     BuildTitle(const char *name);
00064             Int_t    Fill();
00065             void     FillLeaves(TBuffer &b);
00066     TBranchElement  *GetBranchCount() const {return fBranchCount;}
00067     TBranchElement  *GetBranchCount2() const {return fBranchCount2;}
00068     virtual const char  *GetClassName() const {return fClassName.Data();}
00069     virtual const char  *GetClonesName() const {return fClonesName.Data();}
00070             Int_t    GetEntry(Int_t entry=0, Int_t getall = 0);
00071             const char  *GetIconName() const;
00072             Int_t    GetID() const {return fID;}
00073     TStreamerInfo   *GetInfo();
00074     char    *GetObject() const { return fObject; };
00075     virtual const char  *GetParentName() const {return fParentName.Data();}
00076     virtual Int_t    GetMaximum() const;
00077             Int_t    GetNdata()  const {return fNdata;};
00078             Int_t    GetType()   const {return fType;}
00079             Int_t    GetStreamerType() const {return fStreamerType;}
00080     virtual const char *GetTypeName() const;
00081             Double_t GetValue(Int_t i, Int_t len, Bool_t subarr = kFALSE) const;
00082     virtual void    *GetValuePointer() const;
00083             Bool_t   IsBranchFolder() const {return TestBit(kBranchFolder);}
00084             Bool_t   IsFolder() const;
00085     virtual Bool_t   Notify() {fAddress = 0; return 1;}
00086     virtual void     Print(Option_t *option="") const;
00087             void     PrintValue(Int_t i) const;
00088     virtual void     ReadLeaves(TBuffer &b);
00089     virtual void     Reset(Option_t *option="");
00090     virtual void     SetAddress(void *addobj);
00091     virtual void     SetAutoDelete(Bool_t autodel=kTRUE);
00092     virtual void     SetBasketSize(Int_t buffsize);
00093     virtual void     SetBranchCount(TBranchElement *bre);
00094     virtual void     SetBranchCount2(TBranchElement *bre) {fBranchCount2 = bre;}
00095     virtual void     SetBranchFolder() {SetBit(kBranchFolder);}
00096     virtual void     SetClassName(const char *name) {fClassName=name;}
00097     virtual void     SetParentName(const char *name) {fParentName=name;}
00098     virtual void     SetType(Int_t btype) {fType=btype;}
00099     virtual Int_t    Unroll(const char *name, TClass *cltop, TClass *cl,Int_t basketsize, Int_t splitlevel, Int_t btype);
00100 
00101     ClassDef(TBranchElement,7)  //Branch in case of an object
00102 };
00103 
00104 #endif

Generated on Thu Dec 18 14:52:16 2003 for ROOT by doxygen1.2.16