ROOT  6.06/09
Reference Guide
TLeafElement.h
Go to the documentation of this file.
1 // @(#)root/tree:$Id$
2 // Author: Rene Brun 14/01/2001
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_TLeafElement
13 #define ROOT_TLeafElement
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TLeafElement //
19 // //
20 // A TLeaf for a general object derived from TObject. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 
25 #ifndef ROOT_TLeaf
26 #include "TLeaf.h"
27 #endif
28 #ifndef ROOT_TBranchElement
29 #include "TBranchElement.h"
30 #endif
31 
32 class TMethodCall;
33 
34 class TLeafElement : public TLeaf {
35 
36 protected:
37  char *fAbsAddress; //! Absolute leaf Address
38  Int_t fID; //element serial number in fInfo
39  Int_t fType; //leaf type
40 
41 public:
42  TLeafElement();
43  TLeafElement(TBranch *parent, const char *name, Int_t id, Int_t type);
44  virtual ~TLeafElement();
45 
46  virtual Int_t GetLen() const {return ((TBranchElement*)fBranch)->GetNdata()*fLen;}
47  TMethodCall *GetMethodCall(const char *name);
48  virtual Int_t GetMaximum() const {return ((TBranchElement*)fBranch)->GetMaximum();}
49  virtual Int_t GetNdata() const {return ((TBranchElement*)fBranch)->GetNdata()*fLen;}
50  virtual const char *GetTypeName() const {return ((TBranchElement*)fBranch)->GetTypeName();}
51 
52  virtual Double_t GetValue(Int_t i=0) const { return ((TBranchElement*)fBranch)->GetValue(i, fLen, kFALSE);}
53  virtual Long64_t GetValueLong64(Int_t i = 0) const { return ((TBranchElement*)fBranch)->GetTypedValue<Long64_t>(i, fLen, kFALSE); }
54  virtual LongDouble_t GetValueLongDouble(Int_t i = 0) const { return ((TBranchElement*)fBranch)->GetTypedValue<LongDouble_t>(i, fLen, kFALSE); }
55  template<typename T> T GetTypedValueSubArray(Int_t i=0, Int_t j=0) const {return ((TBranchElement*)fBranch)->GetTypedValue<T>(i, j, kTRUE);}
56 
57  virtual void *GetValuePointer() const { return ((TBranchElement*)fBranch)->GetValuePointer(); }
58  virtual Bool_t IsOnTerminalBranch() const;
59  virtual void PrintValue(Int_t i=0) const {((TBranchElement*)fBranch)->PrintValue(i);}
60  virtual void SetLeafCount(TLeaf *leaf) {fLeafCount = leaf;}
61 
62  ClassDef(TLeafElement,1); //A TLeaf for a general object derived from TObject.
63 };
64 
65 #endif
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Definition: TLeaf.h:37
virtual Bool_t IsOnTerminalBranch() const
Return true if this leaf is does not have any sub-branch/leaf.
long long Long64_t
Definition: RtypesCore.h:69
virtual const char * GetTypeName() const
Definition: TLeafElement.h:50
double T(double x)
Definition: ChebyshevPol.h:34
virtual void SetLeafCount(TLeaf *leaf)
Set the leaf count of this leaf.
Definition: TLeafElement.h:60
TMethodCall * GetMethodCall(const char *name)
Returns pointer to method corresponding to name name is a string with the general form "method(list o...
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
ClassDef(TLeafElement, 1)
T GetTypedValueSubArray(Int_t i=0, Int_t j=0) const
Definition: TLeafElement.h:55
Int_t fID
Absolute leaf Address.
Definition: TLeafElement.h:38
Method or function calling interface.
Definition: TMethodCall.h:41
Int_t fLen
Number of elements in fAddress data buffer.
Definition: TLeaf.h:42
virtual Int_t GetMaximum() const
Definition: TLeafElement.h:48
virtual LongDouble_t GetValueLongDouble(Int_t i=0) const
Definition: TLeafElement.h:54
long double LongDouble_t
Definition: RtypesCore.h:57
A TLeaf for the general case when using the branches created via a TStreamerInfo (i.e.
Definition: TLeafElement.h:34
A Branch for the case of an object.
virtual Int_t GetLen() const
Return the number of effective elements of this leaf.
Definition: TLeafElement.h:46
double Double_t
Definition: RtypesCore.h:55
int type
Definition: TGX11.cxx:120
virtual ~TLeafElement()
Default destructor for a LeafObject.
#define name(a, b)
Definition: linkTestLib0.cpp:5
TBranch * fBranch
Definition: TLeaf.h:48
virtual Int_t GetNdata() const
Definition: TLeafElement.h:49
TLeaf * fLeafCount
Definition: TLeaf.h:47
virtual void PrintValue(Int_t i=0) const
Definition: TLeafElement.h:59
char * fAbsAddress
Definition: TLeafElement.h:37
A TTree is a list of TBranches.
Definition: TBranch.h:58
const Bool_t kTRUE
Definition: Rtypes.h:91
virtual Long64_t GetValueLong64(Int_t i=0) const
Definition: TLeafElement.h:53
virtual void * GetValuePointer() const
Definition: TLeafElement.h:57
virtual Double_t GetValue(Int_t i=0) const
Definition: TLeafElement.h:52