Logo ROOT   6.16/01
Reference Guide
TLeafElement.cxx
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/** \class TLeafElement
13\ingroup tree
14
15A TLeaf for the general case when using the branches created via
16a TStreamerInfo (i.e. using TBranchElement).
17*/
18
19#include "TLeafElement.h"
20//#include "TMethodCall.h"
21
23
25
26////////////////////////////////////////////////////////////////////////////////
27/// Default constructor for LeafObject.
28
30{
31 fAbsAddress = 0;
32 fID = -1;
33 fType = -1;
34}
35
36////////////////////////////////////////////////////////////////////////////////
37/// Create a LeafObject.
38
40 : TLeaf(parent, name,name)
41{
42 fLenType = 0;
43 fAbsAddress = 0;
44 fID = id;
45 fType = type;
47 Int_t bareType = type;
48 if (bareType > TVirtualStreamerInfo::kOffsetP)
50 else if (bareType > TVirtualStreamerInfo::kOffsetL)
52
53 if ((bareType >= TVirtualStreamerInfo::kUChar && bareType <= TVirtualStreamerInfo::kULong)
54 || bareType == TVirtualStreamerInfo::kULong64)
55 {
57 }
58
59 auto bareTypeCopy = static_cast<EDataType>(bareType);
60 switch (bareTypeCopy) {
61 case kChar_t: // fall-through
62 case kUChar_t: // fall-through
63 case kchar: // fall-through
64 case kBool_t:
65 fLenType = 1;
66 break;
67 case kShort_t: // fall-through
68 case kUShort_t: // fall-through
69 case kFloat16_t:
70 fLenType = 2;
71 break;
72 case kFloat_t: // fall-through
73 case kDouble32_t: // fall-through
74 case kInt_t: // fall-through
75 case kUInt_t:
76 fLenType = 4;
77 break;
78 case kLong_t: // fall-through
79 case kULong_t: // fall-through
80 case kLong64_t: // fall-through
81 case kULong64_t: // fall-through
82 case kDouble_t:
83 fLenType = 8;
84 break;
85 // All cases I don't know how to handle.
86 case kOther_t: // fall-through
87 case kNoType_t: // fall-through
88 case kCounter: // fall-through
89 case kCharStar: // fall-through
90 case kBits: // fall-through
91 case kVoid_t: // fall-through
92 case kDataTypeAliasUnsigned_t: // fall-through
93 case kDataTypeAliasSignedChar_t: // fall-through
94 case kNumDataTypes: // fall-through
95 fLenType = 0;
96 };
97 }
98}
99
100////////////////////////////////////////////////////////////////////////////////
101/// Default destructor for a LeafObject.
102
104{
105}
106
107////////////////////////////////////////////////////////////////////////////////
108/// Returns pointer to method corresponding to name name is a string
109/// with the general form "method(list of params)" If list of params is
110/// omitted, () is assumed;
111
113{
114 return 0;
115}
116
117
118////////////////////////////////////////////////////////////////////////////////
119/// Copy/set fMinimum and fMaximum to include/be wide than those of the parameter
120
122{
123 if (input) {
124 if (input->GetMaximum() > this->GetMaximum())
125 ((TBranchElement*)fBranch)->fMaximum = input->GetMaximum();
126 return kTRUE;
127 } else {
128 return kFALSE;
129 }
130}
131
132////////////////////////////////////////////////////////////////////////////////
133/// Return true if this leaf is does not have any sub-branch/leaf.
134
136{
138 return kTRUE;
139}
int Int_t
Definition: RtypesCore.h:41
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassImp(name)
Definition: Rtypes.h:363
EDataType
Definition: TDataType.h:28
@ kNoType_t
Definition: TDataType.h:33
@ kFloat_t
Definition: TDataType.h:31
@ kULong64_t
Definition: TDataType.h:32
@ kInt_t
Definition: TDataType.h:30
@ kNumDataTypes
Definition: TDataType.h:40
@ kchar
Definition: TDataType.h:31
@ kLong_t
Definition: TDataType.h:30
@ kDouble32_t
Definition: TDataType.h:31
@ kShort_t
Definition: TDataType.h:29
@ kBool_t
Definition: TDataType.h:32
@ kBits
Definition: TDataType.h:34
@ kDataTypeAliasSignedChar_t
Definition: TDataType.h:38
@ kULong_t
Definition: TDataType.h:30
@ kLong64_t
Definition: TDataType.h:32
@ kVoid_t
Definition: TDataType.h:35
@ kUShort_t
Definition: TDataType.h:29
@ kDouble_t
Definition: TDataType.h:31
@ kCharStar
Definition: TDataType.h:34
@ kChar_t
Definition: TDataType.h:29
@ kUChar_t
Definition: TDataType.h:29
@ kDataTypeAliasUnsigned_t
Definition: TDataType.h:37
@ kCounter
Definition: TDataType.h:34
@ kUInt_t
Definition: TDataType.h:30
@ kFloat16_t
Definition: TDataType.h:33
@ kOther_t
Definition: TDataType.h:32
int type
Definition: TGX11.cxx:120
A Branch for the case of an object.
A TTree is a list of TBranches.
Definition: TBranch.h:64
TObjArray * GetListOfBranches()
Definition: TBranch.h:203
A TLeaf for the general case when using the branches created via a TStreamerInfo (i....
Definition: TLeafElement.h:30
TMethodCall * GetMethodCall(const char *name)
Returns pointer to method corresponding to name name is a string with the general form "method(list o...
char * fAbsAddress
! Absolute leaf Address
Definition: TLeafElement.h:33
virtual ~TLeafElement()
Default destructor for a LeafObject.
virtual Bool_t IsOnTerminalBranch() const
Return true if this leaf is does not have any sub-branch/leaf.
Int_t fType
leaf type
Definition: TLeafElement.h:35
virtual Bool_t IncludeRange(TLeaf *)
Copy/set fMinimum and fMaximum to include/be wide than those of the parameter.
Int_t fID
element serial number in fInfo
Definition: TLeafElement.h:34
TLeafElement()
Default constructor for LeafObject.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Definition: TLeaf.h:32
Int_t fLenType
Number of bytes for this data type.
Definition: TLeaf.h:42
virtual Int_t GetMaximum() const
Definition: TLeaf.h:88
TBranch * fBranch
! Pointer to supporting branch (we do not own the branch)
Definition: TLeaf.h:47
virtual void SetUnsigned()
Definition: TLeaf.h:118
Method or function calling interface.
Definition: TMethodCall.h:37
Int_t GetEntriesFast() const
Definition: TObjArray.h:64