ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TBranchObject.h
Go to the documentation of this file.
1 // @(#)root/tree:$Id$
2 // Author: Rene Brun 11/02/96
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TBranchObject
13 #define ROOT_TBranchObject
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TBranchObject //
19 // //
20 // A Branch for the case of an object. //
21 //////////////////////////////////////////////////////////////////////////
22 
23 
24 #ifndef ROOT_TBranch
25 #include "TBranch.h"
26 #endif
27 
28 class TBranchObject : public TBranch {
29 
30 protected:
31  enum { kWarn = BIT(12) };
32 
33  TString fClassName; //Class name of referenced object
34  TObject *fOldObject; //!Pointer to old object
35 
36  void Init(TTree *tree, TBranch *parent, const char *name, const char *classname, void *addobj, Int_t basketsize, Int_t splitlevel, Int_t compress, Bool_t isptrptr);
37 
38 public:
39  TBranchObject();
40  TBranchObject(TBranch *parent, const char *name, const char *classname, void *addobj, Int_t basketsize=32000, Int_t splitlevel = 0, Int_t compress=-1, Bool_t isptrptr = kTRUE);
41  TBranchObject(TTree *tree, const char *name, const char *classname, void *addobj, Int_t basketsize=32000, Int_t splitlevel = 0, Int_t compress=-1, Bool_t isptrptr = kTRUE);
42  virtual ~TBranchObject();
43 
44  virtual void Browse(TBrowser *b);
45  virtual Int_t Fill();
46  virtual const char* GetClassName() const { return fClassName.Data(); };
47  virtual const char* GetObjClassName() { return fClassName.Data(); };
48  virtual Int_t GetEntry(Long64_t entry=0, Int_t getall = 0);
49  virtual Int_t GetExpectedType(TClass *&clptr,EDataType &type);
50  Bool_t IsFolder() const;
51  virtual void Print(Option_t *option="") const;
52  virtual void Reset(Option_t *option="");
53  virtual void ResetAfterMerge(TFileMergeInfo *);
54  virtual void SetAddress(void *addobj);
55  virtual void SetAutoDelete(Bool_t autodel=kTRUE);
56  virtual void SetBasketSize(Int_t buffsize);
57  virtual void SetupAddresses();
58  virtual void UpdateAddress();
59 
60  ClassDef(TBranchObject,1); //Branch in case of an object
61 };
62 
63 #endif
TObject * fOldObject
Definition: TBranchObject.h:34
Bool_t IsFolder() const
Return TRUE if more than one leaf or if fBrowsables, FALSE otherwise.
long long Long64_t
Definition: RtypesCore.h:69
virtual const char * GetObjClassName()
Definition: TBranchObject.h:47
A Branch for the case of an object.
Definition: TBranchObject.h:28
virtual Int_t Fill()
Loop on all leaves of this branch to fill Basket buffer.
const char Option_t
Definition: RtypesCore.h:62
#define BIT(n)
Definition: Rtypes.h:120
void Init(TTree *tree, TBranch *parent, const char *name, const char *classname, void *addobj, Int_t basketsize, Int_t splitlevel, Int_t compress, Bool_t isptrptr)
Pointer to old object.
virtual Int_t GetExpectedType(TClass *&clptr, EDataType &type)
Fill expectedClass and expectedType with information on the data type of the object/values contained ...
Basic string class.
Definition: TString.h:137
virtual void Print(Option_t *option="") const
Print TBranch parameters.
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void Browse(TBrowser *b)
Browse the branch content.
const char * Data() const
Definition: TString.h:349
virtual void SetupAddresses()
– If the branch address is not set, we set all addresses starting with the top level parent branch...
virtual void SetAutoDelete(Bool_t autodel=kTRUE)
Set the AutoDelete bit.
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all branches of a BranchObject and return total number of bytes.
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
virtual void Reset(Option_t *option="")
Reset a branch.
virtual void SetAddress(void *addobj)
Set address of this branch.
virtual void UpdateAddress()
Update branch addresses if a new object was created.
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any. ...
Definition: TBranchObject.h:46
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:81
Long64_t entry
virtual void SetBasketSize(Int_t buffsize)
Reset basket size for all subbranches of this branch.
TString fClassName
Definition: TBranchObject.h:33
tuple tree
Definition: tree.py:24
int type
Definition: TGX11.cxx:120
EDataType
Definition: TDataType.h:30
#define name(a, b)
Definition: linkTestLib0.cpp:5
Mother of all ROOT objects.
Definition: TObject.h:58
A TTree object has a header with a name and a title.
Definition: TTree.h:98
ClassDef(TBranchObject, 1)
A TTree is a list of TBranches.
Definition: TBranch.h:58
const Bool_t kTRUE
Definition: Rtypes.h:91
virtual void ResetAfterMerge(TFileMergeInfo *)
virtual ~TBranchObject()
Destructor for a BranchObject.