/usr/include/root/TLeaf.h is in libroot-tree-dev 5.34.19+dfsg-1.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | // @(#)root/tree:$Id$
// Author: Rene Brun 12/01/96
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TLeaf
#define ROOT_TLeaf
//////////////////////////////////////////////////////////////////////////
// //
// TLeaf //
// //
// A TTree object is a list of TBranch. //
// A TBranch object is a list of TLeaf. //
// A TLeaf describes the branch data types. //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_TBranch
#include "TBranch.h"
#endif
#ifndef ROOT_Riosfwd
#include "Riosfwd.h"
#endif
class TClonesArray;
class TBrowser;
class TLeaf : public TNamed {
protected:
Int_t fNdata; //! Number of elements in fAddress data buffer
Int_t fLen; // Number of fixed length elements
Int_t fLenType; // Number of bytes for this data type
Int_t fOffset; // Offset in ClonesArray object (if one)
Bool_t fIsRange; // (=kTRUE if leaf has a range, kFALSE otherwise)
Bool_t fIsUnsigned; // (=kTRUE if unsigned, kFALSE otherwise)
TLeaf *fLeafCount; // Pointer to Leaf count if variable length (we do not own the counter)
TBranch *fBranch; //! Pointer to supporting branch (we do not own the branch)
TLeaf(const TLeaf&);
TLeaf& operator=(const TLeaf&);
template <typename T> struct GetValueHelper {
static T Exec(const TLeaf *leaf, Int_t i = 0) { return leaf->GetValue(i); }
};
public:
enum {
kIndirectAddress = BIT(11), // Data member is a pointer to an array of basic types.
kNewValue = BIT(12) // Set if we own the value buffer and so must delete it ourselves.
};
TLeaf();
TLeaf(TBranch *parent, const char* name, const char* type);
virtual ~TLeaf();
virtual void Browse(TBrowser* b);
virtual void Export(TClonesArray*, Int_t) {}
virtual void FillBasket(TBuffer& b);
TBranch *GetBranch() const { return fBranch; }
virtual TLeaf *GetLeafCount() const { return fLeafCount; }
virtual TLeaf *GetLeafCounter(Int_t& countval) const;
virtual Int_t GetLen() const;
virtual Int_t GetLenStatic() const { return fLen; }
virtual Int_t GetLenType() const { return fLenType; }
virtual Int_t GetMaximum() const { return 0; }
virtual Int_t GetMinimum() const { return 0; }
virtual Int_t GetNdata() const { return fNdata; }
virtual Int_t GetOffset() const { return fOffset; }
virtual void *GetValuePointer() const { return 0; }
virtual const char *GetTypeName() const { return ""; }
virtual Double_t GetValue(Int_t i = 0) const;
virtual Long64_t GetValueLong64(Int_t i = 0) const { return GetValue(i); } //overload only when it matters.
virtual LongDouble_t GetValueLongDouble(Int_t i = 0) const { return GetValue(i); } // overload only when it matters.
template <typename T > T GetTypedValue(Int_t i = 0) const { return GetValueHelper<T>::Exec(this, i); }
virtual void Import(TClonesArray*, Int_t) {}
virtual Bool_t IsOnTerminalBranch() const { return kTRUE; }
virtual Bool_t IsRange() const { return fIsRange; }
virtual Bool_t IsUnsigned() const { return fIsUnsigned; }
virtual void PrintValue(Int_t i = 0) const;
virtual void ReadBasket(TBuffer&) {}
virtual void ReadBasketExport(TBuffer&, TClonesArray*, Int_t) {}
virtual void ReadValue(istream& /*s*/, Char_t /*delim*/ = ' ') {
Error("ReadValue", "Not implemented!");
}
Int_t ResetAddress(void* add, Bool_t destructor = kFALSE);
virtual void SetAddress(void* add = 0);
virtual void SetBranch(TBranch* branch) { fBranch = branch; }
virtual void SetLeafCount(TLeaf* leaf);
virtual void SetLen(Int_t len = 1) { fLen = len; }
virtual void SetOffset(Int_t offset = 0) { fOffset = offset; }
virtual void SetRange(Bool_t range = kTRUE) { fIsRange = range; }
virtual void SetUnsigned() { fIsUnsigned = kTRUE; }
ClassDef(TLeaf,2); //Leaf: description of a Branch data type
};
template <> struct TLeaf::GetValueHelper<Long64_t> {
static Long64_t Exec(const TLeaf *leaf, Int_t i = 0) { return leaf->GetValueLong64(i); }
};
template <> struct TLeaf::GetValueHelper<ULong64_t> {
static ULong64_t Exec(const TLeaf *leaf, Int_t i = 0) { return (ULong64_t)leaf->GetValueLong64(i); }
};
template <> struct TLeaf::GetValueHelper<LongDouble_t> {
static LongDouble_t Exec(const TLeaf *leaf, Int_t i = 0) { return leaf->GetValueLongDouble(i); }
};
inline Double_t TLeaf::GetValue(Int_t /*i = 0*/) const { return 0.0; }
inline void TLeaf::PrintValue(Int_t /* i = 0*/) const {}
inline void TLeaf::SetAddress(void* /* add = 0 */) {}
#endif
|