ROOT  6.06/09
Reference Guide
TFormLeafInfo.h
Go to the documentation of this file.
1 // @(#)root/treeplayer:$Id$
2 // Author: Philippe Canal 01/06/2004
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers and al. *
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_TFormLeafInfo
13 #define ROOT_TFormLeafInfo
14 
15 #ifndef ROOT_TObject
16 #include "TObject.h"
17 #endif
18 
19 #ifndef ROOT_TLeafElement
20 #include "TLeafElement.h"
21 #endif
22 
23 #include "TArrayI.h"
24 #include "TDataType.h"
25 #include "TStreamerInfo.h"
26 #include "TStreamerElement.h"
27 
28 
29 // declare the extra versions of GetValue() plus templated implementation
30 #define DECLARE_GETVAL \
31  virtual Double_t GetValue(TLeaf *leaf, Int_t instance = 0) \
32  { return GetValueImpl<Double_t>(leaf, instance); } \
33  virtual Long64_t GetValueLong64(TLeaf *leaf, Int_t instance = 0) \
34  { return GetValueImpl<Long64_t>(leaf, instance); } \
35  virtual LongDouble_t GetValueLongDouble(TLeaf *leaf, Int_t instance = 0) \
36  { return GetValueImpl<LongDouble_t>(leaf, instance); } \
37  template<typename T> T GetValueImpl(TLeaf *leaf, Int_t instance = 0) // no semicolon
38 
39 
40 // declare the extra versions of ReadValue() plus templated implementation
41 #define DECLARE_READVAL \
42  virtual Double_t ReadValue(char *where, Int_t instance = 0) \
43  { return ReadValueImpl<Double_t>(where, instance); } \
44  virtual Long64_t ReadValueLong64(char *where, Int_t instance = 0) \
45  { return ReadValueImpl<Long64_t>(where, instance); } \
46  virtual LongDouble_t ReadValueLongDouble(char *where, Int_t instance = 0) \
47  { return ReadValueImpl<LongDouble_t>(where, instance); } \
48  template<typename T> T ReadValueImpl(char *where, Int_t instance = 0) // no semicolon
49 
50 
51 
52 
53 class TFormLeafInfo : public TObject {
54 public:
55  // Constructors
56  TFormLeafInfo(TClass* classptr = 0, Long_t offset = 0,
57  TStreamerElement* element = 0);
58  TFormLeafInfo(const TFormLeafInfo& orig);
59  virtual TFormLeafInfo* DeepCopy() const;
60  virtual ~TFormLeafInfo();
61 
62  void Swap(TFormLeafInfo &other);
64 
65  // Data Members
66  TClass *fClass; //! This is the class of the data pointed to
67  //TStreamerInfo *fInfo; //! == fClass->GetStreamerInfo()
68  Long_t fOffset; //! Offset of the data pointed inside the class fClass
69  TStreamerElement *fElement; //! Descriptor of the data pointed to.
70  //Warning, the offset in fElement is NOT correct because it does not take into
71  //account base classes and nested objects (which fOffset does).
73  TFormLeafInfo *fNext; // follow this to grab the inside information
76 
77 protected:
79 public:
80 
81  virtual void AddOffset(Int_t offset, TStreamerElement* element);
82 
83  virtual Int_t GetArrayLength();
84  virtual TClass* GetClass() const;
85  virtual Int_t GetCounterValue(TLeaf* leaf);
86  virtual Int_t ReadCounterValue(char *where);
87 
88  char* GetObjectAddress(TLeafElement* leaf, Int_t &instance);
89 
91 
92  // Currently only implemented in TFormLeafInfoCast
93  Int_t GetNdata(TLeaf* leaf);
94  virtual Int_t GetNdata();
95 
96  virtual void *GetValuePointer(TLeaf *leaf, Int_t instance = 0);
97  virtual void *GetValuePointer(char *from, Int_t instance = 0);
98  virtual void *GetLocalValuePointer(TLeaf *leaf, Int_t instance = 0);
99  virtual void *GetLocalValuePointer( char *from, Int_t instance = 0);
100 
101  virtual Bool_t HasCounter() const;
102  virtual Bool_t IsString() const;
103 
104  virtual Bool_t IsInteger() const;
105  virtual Bool_t IsReference() const { return kFALSE; }
106 
107  // Method for multiple variable dimensions.
108  virtual Int_t GetPrimaryIndex();
109  virtual Int_t GetVarDim();
110  virtual Int_t GetVirtVarDim();
111  virtual Int_t GetSize(Int_t index);
112  virtual Int_t GetSumOfSizes();
113  virtual void LoadSizes(TBranch* branch);
114  virtual void SetPrimaryIndex(Int_t index);
115  virtual void SetSecondaryIndex(Int_t index);
116  virtual void SetSize(Int_t index, Int_t val);
117  virtual void SetBranch(TBranch* br) { if ( fNext ) fNext->SetBranch(br); }
118  virtual void UpdateSizes(TArrayI *garr);
119 
120  virtual Bool_t Update();
121 
124 
125  template <typename T> struct ReadValueHelper {
126  static T Exec(TFormLeafInfo *leaf, char *where, Int_t instance) {
127  return leaf->ReadValue(where, instance);
128  }
129  };
130  template <typename T > T ReadTypedValue(char *where, Int_t instance = 0) {
131  return ReadValueHelper<T>::Exec(this, where, instance);
132  }
133 
134  template <typename T> struct GetValueHelper {
135  static T Exec(TFormLeafInfo *linfo, TLeaf *leaf, Int_t instance) {
136  return linfo->GetValue(leaf, instance);
137  }
138  };
139  template <typename T > T GetTypedValue(TLeaf *leaf, Int_t instance = 0) {
140  return GetValueHelper<T>::Exec(this, leaf, instance);
141  }
142 };
143 
144 
146  static Long64_t Exec(TFormLeafInfo *leaf, char *where, Int_t instance) { return leaf->ReadValueLong64(where, instance); }
147 };
149  static ULong64_t Exec(TFormLeafInfo *leaf, char *where, Int_t instance) { return (ULong64_t)leaf->ReadValueLong64(where, instance); }
150 };
152  static LongDouble_t Exec(TFormLeafInfo *leaf, char *where, Int_t instance) { return leaf->ReadValueLongDouble(where, instance); }
153 };
154 
156  static Long64_t Exec(TFormLeafInfo *linfo, TLeaf *leaf, Int_t instance) { return linfo->GetValueLong64(leaf, instance); }
157 };
159  static ULong64_t Exec(TFormLeafInfo *linfo, TLeaf *leaf, Int_t instance) { return (ULong64_t)linfo->GetValueLong64(leaf, instance); }
160 };
162  static LongDouble_t Exec(TFormLeafInfo *linfo, TLeaf *leaf, Int_t instance) { return linfo->GetValueLongDouble(leaf, instance); }
163 };
164 
165 // TFormLeafInfoDirect is a small helper class to implement reading a data
166 // member on an object stored in a TTree.
167 
169 public:
171  // The implicit default constructor's implementation is correct.
172 
173  virtual TFormLeafInfo* DeepCopy() const;
174 
176  virtual void *GetLocalValuePointer(TLeaf *leaf, Int_t instance = 0);
177  virtual void *GetLocalValuePointer(char *thisobj, Int_t instance = 0);
178 
179  virtual Double_t ReadValue(char * /*where*/, Int_t /*instance*/= 0);
180  virtual Long64_t ReadValueLong64(char *where, Int_t i= 0) { return ReadValue(where, i); }
181  virtual LongDouble_t ReadValueLongDouble(char *where, Int_t i= 0) { return ReadValue(where, i); }
182 
183 };
184 
185 // TFormLeafInfoNumerical is a small helper class to implement reading a
186 // numerical value inside a collection
187 
191 public:
195 
196  virtual TFormLeafInfo* DeepCopy() const;
197  void Swap(TFormLeafInfoNumerical &other);
199 
200  virtual ~TFormLeafInfoNumerical();
201 
202  virtual Bool_t IsString() const;
203  virtual Bool_t Update();
204 };
205 
206 // TFormLeafInfoCollectionObject
207 // This class is used when we are interested by the collection it self and
208 // it is split.
209 
211  Bool_t fTop; //If true, it indicates that the branch itself contains
212 public:
213  TFormLeafInfoCollectionObject(TClass* classptr = 0, Bool_t fTop = kTRUE);
215 
216  void Swap(TFormLeafInfoCollectionObject &other);
218 
219  virtual TFormLeafInfo* DeepCopy() const {
220  return new TFormLeafInfoCollectionObject(*this);
221  }
222 
224  virtual Int_t GetCounterValue(TLeaf* leaf);
225  virtual Double_t ReadValue(char *where, Int_t instance = 0);
226  virtual Long64_t ReadValueLong64(char *where, Int_t i= 0) { return ReadValue(where, i); }
227  virtual LongDouble_t ReadValueLongDouble(char *where, Int_t i= 0) { return ReadValue(where, i); }
228  virtual void *GetValuePointer(TLeaf *leaf, Int_t instance = 0);
229  virtual void *GetValuePointer(char *thisobj, Int_t instance = 0);
230  virtual void *GetLocalValuePointer(TLeaf *leaf, Int_t instance = 0);
231  virtual void *GetLocalValuePointer(char *thisobj, Int_t instance = 0);
232 };
233 
234 // TFormLeafInfoClones is a small helper class to implement reading a data
235 // member on a TClonesArray object stored in a TTree.
236 
238  Bool_t fTop; //If true, it indicates that the branch itself contains
239 public:
240  //either the clonesArrays or something inside the clonesArray
241  TFormLeafInfoClones(TClass* classptr = 0, Long_t offset = 0);
242  TFormLeafInfoClones(TClass* classptr, Long_t offset, Bool_t top);
243  TFormLeafInfoClones(TClass* classptr, Long_t offset, TStreamerElement* element,
244  Bool_t top = kFALSE);
246 
247  void Swap(TFormLeafInfoClones &other);
249 
250  virtual TFormLeafInfo* DeepCopy() const {
251  return new TFormLeafInfoClones(*this);
252  }
253 
256  virtual Int_t GetCounterValue(TLeaf* leaf);
257  virtual Int_t ReadCounterValue(char *where);
258  virtual void *GetValuePointer(TLeaf *leaf, Int_t instance = 0);
259  virtual void *GetValuePointer(char *thisobj, Int_t instance = 0);
260  virtual void *GetLocalValuePointer(TLeaf *leaf, Int_t instance = 0);
261  virtual void *GetLocalValuePointer(char *thisobj, Int_t instance = 0);
262 };
263 
264 // TFormLeafInfoCollection is a small helper class to implement reading a data member
265 // on a generic collection object stored in a TTree.
266 
268  Bool_t fTop; //If true, it indicates that the branch itself contains
269  //either the clonesArrays or something inside the clonesArray
274 public:
275 
277  Long_t offset,
278  TStreamerElement* element,
279  Bool_t top = kFALSE);
280 
281  TFormLeafInfoCollection(TClass* motherclassptr,
282  Long_t offset = 0,
283  TClass* elementclassptr = 0,
284  Bool_t top = kFALSE);
285 
288 
290 
291  void Swap(TFormLeafInfoCollection &other);
293 
294  virtual TFormLeafInfo* DeepCopy() const;
295 
296  virtual Bool_t Update();
297 
300  virtual Int_t GetCounterValue(TLeaf* leaf);
301  virtual Int_t ReadCounterValue(char* where);
302  virtual Int_t GetCounterValue(TLeaf* leaf, Int_t instance);
303  virtual Bool_t HasCounter() const;
304  virtual void *GetValuePointer(TLeaf *leaf, Int_t instance = 0);
305  virtual void *GetValuePointer(char *thisobj, Int_t instance = 0);
306  virtual void *GetLocalValuePointer(TLeaf *leaf, Int_t instance = 0);
307  virtual void *GetLocalValuePointer(char *thisobj, Int_t instance = 0);
308 };
309 
310 // TFormLeafInfoCollectionSize is used to return the size of a collection
311 
316 public:
318  TFormLeafInfoCollectionSize(TClass* classptr,Long_t offset,TStreamerElement* element);
321 
323 
324  void Swap(TFormLeafInfoCollectionSize &other);
326 
327  virtual TFormLeafInfo* DeepCopy() const;
328 
329  virtual Bool_t Update();
330 
331  virtual void *GetValuePointer(TLeaf *leaf, Int_t instance = 0);
332  virtual void *GetValuePointer(char *from, Int_t instance = 0);
333  virtual void *GetLocalValuePointer(TLeaf *leaf, Int_t instance = 0);
334  virtual void *GetLocalValuePointer( char *from, Int_t instance = 0);
335  virtual Double_t ReadValue(char *where, Int_t instance = 0);
336  virtual Long64_t ReadValueLong64(char *where, Int_t i= 0) { return ReadValue(where, i); }
337  virtual LongDouble_t ReadValueLongDouble(char *where, Int_t i= 0) { return ReadValue(where, i); }
338 };
339 
340 // TFormLeafInfoPointer is a small helper class to implement reading a data
341 // member by following a pointer inside a branch of TTree.
342 
344 public:
345  TFormLeafInfoPointer(TClass* classptr = 0, Long_t offset = 0,
346  TStreamerElement* element = 0);
347  // The default copy constructor is the right implementation.
348 
349  virtual TFormLeafInfo* DeepCopy() const;
350 
353 };
354 
355 // TFormLeafInfoMethod is a small helper class to implement executing a method
356 // of an object stored in a TTree
357 
359 
368 
369 public:
370 
371  TFormLeafInfoMethod(TClass* classptr = 0, TMethodCall *method = 0);
374 
375  void Swap(TFormLeafInfoMethod &other);
377 
378  virtual TFormLeafInfo* DeepCopy() const;
379 
381  virtual TClass* GetClass() const;
382  virtual void *GetLocalValuePointer( TLeaf *from, Int_t instance = 0);
383  virtual void *GetLocalValuePointer(char *from, Int_t instance = 0);
384  virtual Bool_t IsInteger() const;
385  virtual Bool_t IsString() const;
386  virtual Bool_t Update();
387 };
388 
389 // TFormLeafInfoMultiVarDim is a small helper class to implement reading a
390 // data member on a variable size array inside a TClonesArray object stored in
391 // a TTree. This is the version used when the data member is inside a
392 // non-split object.
393 
395 public:
397  TArrayI fSizes; // Array of sizes of the variable dimension
398  TFormLeafInfo *fCounter2; // Information on how to read the secondary dimensions
399  Int_t fSumOfSizes; // Sum of the content of fSizes
400  Int_t fDim; // physical number of the dimension that is variable
401  Int_t fVirtDim; // number of the virtual dimension to which this object correspond.
402  Int_t fPrimaryIndex; // Index of the dimensions that is indexing the second dimension's size
403  Int_t fSecondaryIndex; // Index of the second dimension
404 
405 protected:
407  TStreamerElement* element) : TFormLeafInfo(classptr,offset,element),fNsize(0),fSizes(),fCounter2(0),fSumOfSizes(0),fDim(0),fVirtDim(0),fPrimaryIndex(-1),fSecondaryIndex(-1) {}
408 
409 public:
410  TFormLeafInfoMultiVarDim(TClass* classptr, Long_t offset,
411  TStreamerElement* element, TFormLeafInfo* parent);
415 
416  void Swap(TFormLeafInfoMultiVarDim &other);
418 
419  virtual TFormLeafInfo* DeepCopy() const;
420 
421  /* The proper indexing and unwinding of index is done by prior leafinfo in the chain. */
422  //virtual Double_t ReadValue(char *where, Int_t instance = 0) {
423  // return TFormLeafInfo::ReadValue(where,instance);
424  //}
425 
426  virtual void LoadSizes(TBranch* branch);
427  virtual Int_t GetPrimaryIndex();
428  virtual void SetPrimaryIndex(Int_t index);
429  virtual void SetSecondaryIndex(Int_t index);
430  virtual void SetSize(Int_t index, Int_t val);
431  virtual Int_t GetSize(Int_t index);
432  virtual Int_t GetSumOfSizes();
433  virtual Double_t GetValue(TLeaf * /*leaf*/, Int_t /*instance*/ = 0);
434  virtual Long64_t GetValueLong64(TLeaf *leaf, Int_t i= 0) { return GetValue(leaf, i); }
435  virtual LongDouble_t GetValueLongDouble(TLeaf *leaf, Int_t i= 0) { return GetValue(leaf, i); }
436  virtual Int_t GetVarDim();
437  virtual Int_t GetVirtVarDim();
438  virtual Bool_t Update();
439  virtual void UpdateSizes(TArrayI *garr);
440 };
441 
442 // TFormLeafInfoMultiVarDimDirect is a small helper class to implement reading
443 // a data member on a variable size array inside a TClonesArray object stored
444 // in a TTree. This is the version used for split access
445 
447 public:
448  // The default constructor are the correct implementation.
449 
450  virtual TFormLeafInfo* DeepCopy() const;
451 
453  virtual Double_t ReadValue(char * /*where*/, Int_t /*instance*/ = 0);
454  virtual Long64_t ReadValueLong64(char *where, Int_t i= 0) { return ReadValue(where, i); }
455  virtual LongDouble_t ReadValueLongDouble(char *where, Int_t i= 0) { return ReadValue(where, i); }
456 };
457 
458 // TFormLeafInfoMultiVarDimCollection is a small helper class to implement reading
459 // a data member which is a collection inside a TClonesArray or collection object
460 // stored in a TTree. This is the version used for split access
461 //
463 public:
464  TFormLeafInfoMultiVarDimCollection(TClass* motherclassptr, Long_t offset,
465  TClass* elementclassptr, TFormLeafInfo *parent);
467  TStreamerElement* element, TFormLeafInfo* parent);
468  // The default copy constructor is the right implementation.
469 
470  virtual TFormLeafInfo* DeepCopy() const;
471 
472  virtual Int_t GetArrayLength() { return 0; }
473  virtual void LoadSizes(TBranch* branch);
474  virtual Double_t GetValue(TLeaf *leaf, Int_t instance = 0);
475  virtual Long64_t GetValueLong64(TLeaf *leaf, Int_t i= 0) { return GetValue(leaf, i); }
476  virtual LongDouble_t GetValueLongDouble(TLeaf *leaf, Int_t i= 0) { return GetValue(leaf, i); }
478 };
479 
480 // TFormLeafInfoMultiVarDimClones is a small helper class to implement reading
481 // a data member which is a TClonesArray inside a TClonesArray or collection object
482 // stored in a TTree. This is the version used for split access
483 //
485 public:
486  TFormLeafInfoMultiVarDimClones(TClass* motherclassptr, Long_t offset,
487  TClass* elementclassptr, TFormLeafInfo *parent);
488  TFormLeafInfoMultiVarDimClones(TClass* classptr, Long_t offset,
489  TStreamerElement* element, TFormLeafInfo* parent);
490  // The default copy constructor is the right implementation.
491 
492  virtual TFormLeafInfo* DeepCopy() const;
493 
494  virtual Int_t GetArrayLength() { return 0; }
495  virtual void LoadSizes(TBranch* branch);
496  virtual Double_t GetValue(TLeaf *leaf, Int_t instance = 0);
497  virtual Long64_t GetValueLong64(TLeaf *leaf, Int_t i= 0) { return GetValue(leaf, i); }
498  virtual LongDouble_t GetValueLongDouble(TLeaf *leaf, Int_t i= 0) { return GetValue(leaf, i); }
500 };
501 
502 // TFormLeafInfoCast is a small helper class to implement casting an object to
503 // a different type (equivalent to dynamic_cast)
504 
506 public:
507  TClass *fCasted; //! Pointer to the class we are trying to case to
508  TString fCastedName; //! Name of the class we are casting to.
509  Bool_t fGoodCast; //! Marked by ReadValue.
510  Bool_t fIsTObject; //! Indicated whether the fClass inherits from TObject.
511 
512  TFormLeafInfoCast(TClass* classptr = 0, TClass* casted = 0);
514  virtual ~TFormLeafInfoCast();
515 
516  void Swap(TFormLeafInfoCast &other);
518 
519  virtual TFormLeafInfo* DeepCopy() const;
520 
522  // Currently only implemented in TFormLeafInfoCast
523  virtual Int_t GetNdata();
524  virtual Bool_t Update();
525 };
526 
527 // TFormLeafInfoTTree is a small helper class to implement reading
528 // from the containing TTree object itself.
529 
534 
535 public:
536  TFormLeafInfoTTree(TTree *tree = 0, const char *alias = 0, TTree *current = 0);
538 
539  void Swap(TFormLeafInfoTTree &other);
541 
542  virtual TFormLeafInfo* DeepCopy() const;
543 
545  using TFormLeafInfo::GetValue;
546 
549  virtual void *GetLocalValuePointer(TLeaf *leaf, Int_t instance = 0);
550  virtual Bool_t Update();
551 };
552 
553 
554 #endif /* ROOT_TFormLeafInfo */
555 
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Definition: TLeaf.h:37
virtual Bool_t IsReference() const
virtual Int_t ReadCounterValue(char *where)
Return the current size of the the TClonesArray.
virtual Bool_t Update()
We reloading all cached information in case the underlying class information has changed (for example...
TFormLeafInfoNumerical & operator=(const TFormLeafInfoNumerical &orig)
Exception safe assignment operator.
TFormLeafInfo & operator=(const TFormLeafInfo &orig)
Exception safe assignment operator.
~TFormLeafInfoCollection()
Destructor.
A small helper class to implement reading a data member on a TClonesArray object stored in a TTree...
virtual void AddOffset(Int_t offset, TStreamerElement *element)
Increase the offset of this element.
long long Long64_t
Definition: RtypesCore.h:69
virtual void LoadSizes(TBranch *branch)
Load the current array sizes.
TVirtualCollectionProxy * fCollProxy
Bool_t fGoodCast
Name of the class we are casting to.
virtual void * GetLocalValuePointer(TLeaf *leaf, Int_t instance=0)
Return the pointer to the clonesArray.
TFormLeafInfoCollectionSize()
Constructor.
virtual void * GetLocalValuePointer(TLeaf *leaf, Int_t instance=0)
Return the pointer to the clonesArray.
virtual void * GetValuePointer(TLeaf *leaf, Int_t instance=0)
Return the pointer to the clonesArray.
virtual Bool_t Update()
We reloading all cached information in case the underlying class information has changed (for example...
A small helper class to implement reading a data member on an object stored in a TTree.
double T(double x)
Definition: ChebyshevPol.h:34
TString fClassName
Definition: TFormLeafInfo.h:74
virtual void * GetValuePointer(TLeaf *leaf, Int_t instance=0)
returns the address of the value pointed to by the serie of TFormLeafInfo.
virtual Long64_t ReadValueLong64(char *where, Int_t i=0)
virtual Double_t GetValue(TLeaf *leaf, Int_t instance=0)
TFormLeafInfoCollectionObject(TClass *classptr=0, Bool_t fTop=kTRUE)
Constructor.
void Swap(TFormLeafInfoCast &other)
Exception safe swap.
virtual TFormLeafInfo * DeepCopy() const
Copy the object and all of its content.
void Swap(TFormLeafInfoMultiVarDim &other)
Exception safe swap.
A small helper class to implement casting an object to a different type (equivalent to dynamic_cast) ...
Basic string class.
Definition: TString.h:137
TFormLeafInfoCast & operator=(const TFormLeafInfoCast &orig)
Exception safe assignment operator.
TFormLeafInfo * fNext
Definition: TFormLeafInfo.h:73
TFormLeafInfoTTree & operator=(const TFormLeafInfoTTree &orig)
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
TFormLeafInfoNumerical(TVirtualCollectionProxy *holder_of)
Construct a TFormLeafInfo for the numerical type contained in the collection.
TFormLeafInfo(TClass *classptr=0, Long_t offset=0, TStreamerElement *element=0)
Constructor.
virtual Bool_t Update()
We reloading all cached information in case the underlying class information has changed (for example...
virtual void * GetValuePointer(TLeaf *leaf, Int_t instance=0)
Return the pointer to the clonesArray.
virtual Int_t GetSize(Int_t index)
Return the size of the requested sub-array.
virtual TFormLeafInfo * DeepCopy() const
Make a complete copy of this FormLeafInfo and all its content.
~TFormLeafInfoCollectionSize()
Destructor.
virtual Int_t GetPrimaryIndex()
Return the index vlaue of the primary index.
TFormLeafInfoClones(TClass *classptr=0, Long_t offset=0)
Constructor.
virtual void * GetLocalValuePointer(TLeaf *from, Int_t instance=0)
This is implemented here because some compiler want ALL the signature of an overloaded function to be...
virtual TFormLeafInfo * DeepCopy() const
Make a complete copy of this FormLeafInfo and all its content.
TFormLeafInfoCollection()
Constructor.
TFormLeafInfoCollectionObject & operator=(const TFormLeafInfoCollectionObject &orig)
Exception safe assignement operator.
A helper class to implement reading a data member on a variable size array inside a TClonesArray obje...
Array of integers (32 bits per element).
Definition: TArrayI.h:29
virtual Long64_t ReadValueLong64(char *where, Int_t i=0)
TMethodCall * fMethod
virtual TFormLeafInfo * DeepCopy() const
Copy the object and all its content.
virtual TClass * GetClass() const
Get the class of the underlying data.
TFormLeafInfoMultiVarDim()
Constructor.
virtual Bool_t Update()
We reloading all cached information in case the underlying class information has changed (for example...
virtual TFormLeafInfo * DeepCopy() const
Copy the object and all of its contnet.
TFormLeafInfoMethod & operator=(const TFormLeafInfoMethod &orig)
Exception safe assignment operator.
virtual Bool_t IsString() const
Return true if the underlying data is a string.
virtual Int_t GetVarDim()
Return the index of the dimension which varies for each elements of an enclosing array (typically a T...
virtual TFormLeafInfo * DeepCopy() const
Copy the object and all its content.
virtual Int_t GetArrayLength()
Return the current length of the array.
TFormLeafInfoMultiVarDim & operator=(const TFormLeafInfoMultiVarDim &orig)
Exception safe assignment operator.
virtual TFormLeafInfo * DeepCopy() const
Copy this object and its content.
virtual Bool_t Update()
Update after a change of file in a chain.
TString fCastedName
Pointer to the class we are trying to case to.
virtual TFormLeafInfo * DeepCopy() const
Copy the object and all its content.
virtual Int_t GetSumOfSizes()
Get the total size.
TString fElementName
Definition: TFormLeafInfo.h:75
virtual Long64_t GetValueLong64(TLeaf *leaf, Int_t i=0)
virtual void * GetLocalValuePointer(TLeaf *leaf, Int_t instance=0)
Not implemented.
virtual ~TFormLeafInfoCast()
Destructor.
TFormLeafInfoTTree(TTree *tree=0, const char *alias=0, TTree *current=0)
TFormLeafInfoMultiVarDimCollection(TClass *motherclassptr, Long_t offset, TClass *elementclassptr, TFormLeafInfo *parent)
Constructor.
virtual Double_t ReadValue(char *, Int_t=0)
Read the value at the given memory location.
virtual Bool_t Update()
We reloading all cached information in case the underlying class information has changed (for example...
virtual void * GetValuePointer(TLeaf *leaf, Int_t instance=0)
Return the pointer to the clonesArray.
static T Exec(TFormLeafInfo *leaf, char *where, Int_t instance)
virtual void SetPrimaryIndex(Int_t index)
Set the current value of the primary index.
virtual void LoadSizes(TBranch *branch)
Load the current array sizes.
virtual Double_t ReadValue(char *where, Int_t instance=0)
Return the value of the underlying data member inside the clones array.
virtual Bool_t IsInteger() const
Return true if the underlying data is an integral value.
Method or function calling interface.
Definition: TMethodCall.h:41
virtual void UpdateSizes(TArrayI *garr)
Update the sizes of the arrays.
static ULong64_t Exec(TFormLeafInfo *leaf, char *where, Int_t instance)
virtual Int_t ReadCounterValue(char *where)
Return the size of the underlying array for the current entry in the TTree.
TFormLeafInfoMethod(TClass *classptr=0, TMethodCall *method=0)
Constructor.
char * GetObjectAddress(TLeafElement *leaf, Int_t &instance)
Returns the the location of the object pointed to.
Int_t fMultiplicity
Definition: TFormLeafInfo.h:78
A small helper class to implement reading a data member on a variable size array inside a TClonesArra...
virtual Int_t GetCounterValue(TLeaf *leaf)
Return the current size of the the TClonesArray.
Used to return the size of a collection.
TClass * fClass
Definition: TFormLeafInfo.h:66
virtual ~TFormLeafInfo()
Delete this object and all its content.
virtual void SetSecondaryIndex(Int_t index)
Set the primary index value.
virtual TFormLeafInfo * DeepCopy() const
Copy the object and all its content.
static LongDouble_t Exec(TFormLeafInfo *linfo, TLeaf *leaf, Int_t instance)
A small helper class to implement reading a data member on a variable size array inside a TClonesArra...
virtual Int_t GetCounterValue(TLeaf *leaf)
Return the current size of the the TClonesArray.
static LongDouble_t Exec(TFormLeafInfo *leaf, char *where, Int_t instance)
TStreamerElement * fElement
Offset of the data pointed inside the class fClass.
Definition: TFormLeafInfo.h:69
A small helper class to implement reading a data member by following a pointer inside a branch of TTr...
virtual Int_t GetCounterValue(TLeaf *leaf)
Return the current size of the the TClonesArray.
virtual LongDouble_t ReadValueLongDouble(char *where, Int_t i=0)
virtual TFormLeafInfo * DeepCopy() const
Copy the object and all its content.
virtual void SetSize(Int_t index, Int_t val)
Set the current size of the arrays.
virtual LongDouble_t GetValueLongDouble(TLeaf *leaf, Int_t i=0)
static Long64_t Exec(TFormLeafInfo *leaf, char *where, Int_t instance)
virtual Int_t GetPrimaryIndex()
Method for multiple variable dimensions.
virtual void * GetLocalValuePointer(TLeaf *leaf, Int_t instance=0)
returns the address of the value pointed to by the TFormLeafInfo.
virtual void SetSize(Int_t index, Int_t val)
Set the sizes of the sub-array.
virtual Bool_t HasCounter() const
Return true if the underlying data has a array size counter.
virtual void LoadSizes(TBranch *branch)
Load the current array sizes.
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:81
long double LongDouble_t
Definition: RtypesCore.h:57
T ReadTypedValue(char *where, Int_t instance=0)
virtual Int_t GetSize(Int_t index)
For the current entry, and the value 'index' for the main array, return the size of the secondary var...
virtual void UpdateSizes(TArrayI *garr)
Set the current sizes of the arrays.
virtual void SetPrimaryIndex(Int_t index)
Set the primary index value.
TVirtualCollectionProxy * fCollProxy
TFormLeafInfoClones & operator=(const TFormLeafInfoClones &orig)
Exception safe assignement operator.
virtual ~TFormLeafInfoNumerical()
Destructor.
virtual Double_t ReadValue(char *, Int_t=0)
Not implemented.
virtual void * GetValuePointer(TLeaf *leaf, Int_t instance=0)
Not implemented.
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 void SetSecondaryIndex(Int_t index)
Set the current value of the primary index.
TFormLeafInfoCollection & operator=(const TFormLeafInfoCollection &orig)
Exception safe assignment operator.
TFormLeafInfoCollectionSize & operator=(const TFormLeafInfoCollectionSize &orig)
Exception safe assignment operator.
~TFormLeafInfoMethod()
Destructor.
void Swap(TFormLeafInfoNumerical &other)
Exception safe swap.
long Long_t
Definition: RtypesCore.h:50
static Long64_t Exec(TFormLeafInfo *linfo, TLeaf *leaf, Int_t instance)
virtual TFormLeafInfo * DeepCopy() const
Make a complete copy of this FormLeafInfo and all its content.
virtual Int_t GetVirtVarDim()
Return the virtual index (for this expression) of the dimension which varies for each elements of an ...
TFormLeafInfoPointer(TClass *classptr=0, Long_t offset=0, TStreamerElement *element=0)
Constructor.
A small helper class to implement reading from the containing TTree object itself.
virtual TFormLeafInfo * DeepCopy() const
Copy of the object and its content.
virtual Int_t ReadCounterValue(char *where)
Return the size of the underlying array for the current entry in the TTree.
static T Exec(TFormLeafInfo *linfo, TLeaf *leaf, Int_t instance)
virtual Int_t GetNdata()
Get the number of element in the entry.
virtual void SetBranch(TBranch *br)
TFormLeafInfoMultiVarDimClones(TClass *motherclassptr, Long_t offset, TClass *elementclassptr, TFormLeafInfo *parent)
Constructor.
double Double_t
Definition: RtypesCore.h:55
virtual LongDouble_t GetValueLongDouble(TLeaf *leaf, Int_t i=0)
A small helper class to implement reading a numerical value inside a collection.
virtual Bool_t IsString() const
Return true if the return value is a string.
This class is a small helper class to implement reading a data member on an object stored in a TTree...
Definition: TFormLeafInfo.h:53
unsigned long long ULong64_t
Definition: RtypesCore.h:70
Int_t GetMultiplicity()
Reminder of the meaning of fMultiplicity:
EDataType
Definition: TDataType.h:30
TFormLeafInfoDirect(TBranchElement *from)
Constructor.
virtual Int_t GetNdata()
Get the number of element in the entry.
virtual void LoadSizes(TBranch *branch)
Load the current array sizes.
virtual LongDouble_t ReadValueLongDouble(char *where, Int_t i=0)
virtual Int_t GetSumOfSizes()
Total all the elements that are available for the current entry for the secondary variable dimension...
void Swap(TFormLeafInfoCollectionSize &other)
Exception safe swap.
TFormLeafInfo * fCounter2
virtual TFormLeafInfo * DeepCopy() const
Copy the object and all its content.
void Swap(TFormLeafInfoCollection &other)
Exception safe swap.
virtual Long64_t GetValueLong64(TLeaf *leaf, Int_t i=0)
virtual Bool_t Update()
We reloading all cached information in case the underlying class information has changed (for example...
Mother of all ROOT objects.
Definition: TObject.h:58
virtual void * GetLocalValuePointer(TLeaf *leaf, Int_t instance=0)
Return the address of the underlying value.
virtual LongDouble_t GetValueLongDouble(TLeaf *leaf, Int_t i=0)
void Swap(TFormLeafInfoClones &other)
Exception safe swap.
virtual TFormLeafInfo * DeepCopy() const
Make a complete copy of this FormLeafInfo and all its content.
virtual Double_t ReadValue(char *where, Int_t instance=0)
Return the value of the underlying pointer data member.
void Swap(TFormLeafInfo &other)
virtual Double_t GetValue(TLeaf *, Int_t=0)
virtual Bool_t HasCounter() const
Return true if any of underlying data has a array size counter.
TFormLeafInfoMultiVarDim(TClass *classptr, Long_t offset, TStreamerElement *element)
virtual LongDouble_t ReadValueLongDouble(char *where, Int_t i=0)
TFormLeafInfoCast(TClass *classptr=0, TClass *casted=0)
Indicated whether the fClass inherits from TObject.
T GetTypedValue(TLeaf *leaf, Int_t instance=0)
virtual Bool_t IsInteger() const
Return true if the return value is integral.
TStreamerElement * fLocalElement
A small helper class to implement reading a data member on a generic collection object stored in a TT...
A TTree object has a header with a name and a title.
Definition: TTree.h:94
Asmall helper class to implement executing a method of an object stored in a TTree.
virtual void * GetLocalValuePointer(TLeaf *leaf, Int_t instance=0)
returns the address of the value pointed to by the TFormLeafInfo.
virtual Long64_t ReadValueLong64(char *where, Int_t i=0)
Bool_t fIsTObject
Marked by ReadValue.
virtual void * GetLocalValuePointer(TLeaf *leaf, Int_t instance=0)
Return the pointer to the clonesArray.
TFormLeafInfo * fCounter
Descriptor of the data pointed to.
Definition: TFormLeafInfo.h:72
Long_t fOffset
This is the class of the data pointed to.
Definition: TFormLeafInfo.h:68
virtual Int_t GetArrayLength()
Return the current length of the array.
virtual Bool_t IsString() const
Return true if the underlying data is a string.
A TTree is a list of TBranches.
Definition: TBranch.h:58
A small helper class to implement reading a data member on a TClonesArray object stored in a TTree...
static ULong64_t Exec(TFormLeafInfo *linfo, TLeaf *leaf, Int_t instance)
const Bool_t kTRUE
Definition: Rtypes.h:91
void Swap(TFormLeafInfoCollectionObject &other)
Exception safe swap.
A small helper class to implement reading a data member on a variable size array inside a TClonesArra...
virtual Int_t GetCounterValue(TLeaf *leaf)
Return the size of the underlying array for the current entry in the TTree.
virtual TClass * GetClass() const
Return the type of the underlying return value.
virtual LongDouble_t ReadValueLongDouble(char *where, Int_t i=0)
virtual Int_t GetVarDim()
Return the index of the dimension which varies for each elements of an enclosing array (typically a T...
virtual Int_t GetVirtVarDim()
Return the virtual index (for this expression) of the dimension which varies for each elements of an ...
virtual Int_t GetArrayLength()
Return the current length of the array.
virtual Long64_t ReadValueLong64(char *where, Int_t i=0)
~TFormLeafInfoMultiVarDim()
Destructor.
virtual TFormLeafInfo * DeepCopy() const
Copy the object and all its data.
void Swap(TFormLeafInfoMethod &other)
Exception safe swap.
virtual Bool_t Update()
We reloading all cached information in case the underlying class information has changed (for example...
virtual Long64_t GetValueLong64(TLeaf *leaf, Int_t i=0)
void Swap(TFormLeafInfoTTree &other)
virtual Double_t GetValue(TLeaf *leaf, Int_t instance=0)