Logo ROOT   6.10/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 #include "TLeaf.h"
26 #include "TBranchElement.h"
27 
28 class TMethodCall;
29 
30 class TLeafElement : public TLeaf {
31 
32 protected:
33  char *fAbsAddress; ///<! Absolute leaf Address
34  Int_t fID; ///< element serial number in fInfo
35  Int_t fType; ///< leaf type
36 
37 public:
38  TLeafElement();
39  TLeafElement(TBranch *parent, const char *name, Int_t id, Int_t type);
40  virtual ~TLeafElement();
41 
42  virtual Int_t GetLen() const {return ((TBranchElement*)fBranch)->GetNdata()*fLen;}
43  TMethodCall *GetMethodCall(const char *name);
44  virtual Int_t GetMaximum() const {return ((TBranchElement*)fBranch)->GetMaximum();}
45  virtual Int_t GetNdata() const {return ((TBranchElement*)fBranch)->GetNdata()*fLen;}
46  virtual const char *GetTypeName() const {return ((TBranchElement*)fBranch)->GetTypeName();}
47 
48  virtual Double_t GetValue(Int_t i=0) const { return ((TBranchElement*)fBranch)->GetValue(i, fLen, kFALSE);}
49  virtual Long64_t GetValueLong64(Int_t i = 0) const { return ((TBranchElement*)fBranch)->GetTypedValue<Long64_t>(i, fLen, kFALSE); }
50  virtual LongDouble_t GetValueLongDouble(Int_t i = 0) const { return ((TBranchElement*)fBranch)->GetTypedValue<LongDouble_t>(i, fLen, kFALSE); }
51  template<typename T> T GetTypedValueSubArray(Int_t i=0, Int_t j=0) const {return ((TBranchElement*)fBranch)->GetTypedValue<T>(i, j, kTRUE);}
52 
53  virtual void *GetValuePointer() const { return ((TBranchElement*)fBranch)->GetValuePointer(); }
54  virtual Bool_t IsOnTerminalBranch() const;
55  virtual void PrintValue(Int_t i=0) const {((TBranchElement*)fBranch)->PrintValue(i);}
56  virtual void SetLeafCount(TLeaf *leaf) {fLeafCount = leaf;}
57 
58  ClassDef(TLeafElement,1); //A TLeaf for a general object derived from TObject.
59 };
60 
61 #endif
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Definition: TLeaf.h:32
long long Long64_t
Definition: RtypesCore.h:69
double T(double x)
Definition: ChebyshevPol.h:34
virtual void SetLeafCount(TLeaf *leaf)
Set the leaf count of this leaf.
Definition: TLeafElement.h:56
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
virtual Bool_t IsOnTerminalBranch() const
Return true if this leaf is does not have any sub-branch/leaf.
#define ClassDef(name, id)
Definition: Rtypes.h:297
Int_t fID
element serial number in fInfo
Definition: TLeafElement.h:34
Method or function calling interface.
Definition: TMethodCall.h:37
Int_t fLen
Number of fixed length elements.
Definition: TLeaf.h:37
TLeafElement()
Default constructor for LeafObject.
virtual Int_t GetMaximum() const
Definition: TLeafElement.h:44
Int_t fType
leaf type
Definition: TLeafElement.h:35
virtual void * GetValuePointer() const
Definition: TLeafElement.h:53
virtual Int_t GetNdata() const
Definition: TLeafElement.h:45
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:30
A Branch for the case of an object.
const Bool_t kFALSE
Definition: RtypesCore.h:92
virtual LongDouble_t GetValueLongDouble(Int_t i=0) const
Definition: TLeafElement.h:50
double Double_t
Definition: RtypesCore.h:55
T GetTypedValueSubArray(Int_t i=0, Int_t j=0) const
Definition: TLeafElement.h:51
virtual Double_t GetValue(Int_t i=0) const
Definition: TLeafElement.h:48
int type
Definition: TGX11.cxx:120
virtual ~TLeafElement()
Default destructor for a LeafObject.
virtual void PrintValue(Int_t i=0) const
Definition: TLeafElement.h:55
TBranch * fBranch
! Pointer to supporting branch (we do not own the branch)
Definition: TLeaf.h:43
TLeaf * fLeafCount
Pointer to Leaf count if variable length (we do not own the counter)
Definition: TLeaf.h:42
char * fAbsAddress
! Absolute leaf Address
Definition: TLeafElement.h:33
virtual Int_t GetLen() const
Return the number of effective elements of this leaf.
Definition: TLeafElement.h:42
A TTree is a list of TBranches.
Definition: TBranch.h:57
virtual const char * GetTypeName() const
Definition: TLeafElement.h:46
const Bool_t kTRUE
Definition: RtypesCore.h:91
virtual Long64_t GetValueLong64(Int_t i=0) const
Definition: TLeafElement.h:49