File indexing completed on 2025-01-18 10:12:12
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TLeafElement
0013 #define ROOT_TLeafElement
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include <atomic>
0025
0026 #include "TDataType.h"
0027 #include "TLeaf.h"
0028 #include "TBranchElement.h"
0029
0030 class TMethodCall;
0031
0032 class TLeafElement : public TLeaf {
0033
0034 protected:
0035 char *fAbsAddress;
0036 Int_t fID;
0037 Int_t fType;
0038 mutable std::atomic<DeserializeType> fDeserializeTypeCache{ DeserializeType::kInvalid };
0039 mutable std::atomic<EDataType> fDataTypeCache{EDataType::kOther_t};
0040
0041 private:
0042 Int_t GetOffsetHeaderSize() const override {return 1;}
0043
0044 public:
0045 TLeafElement();
0046 TLeafElement(TBranch *parent, const char *name, Int_t id, Int_t type);
0047 ~TLeafElement() override;
0048
0049 bool CanGenerateOffsetArray() override { return fLeafCount && fLenType; }
0050 virtual Int_t *GenerateOffsetArrayBase(Int_t , Int_t ) { return nullptr; }
0051 DeserializeType GetDeserializeType() const override;
0052
0053 Int_t GetID() const { return fID; }
0054 TString GetFullName() const override;
0055 Int_t GetLen() const override { return ((TBranchElement*)fBranch)->GetNdata()*fLen; }
0056 TMethodCall *GetMethodCall(const char *name);
0057 Int_t GetMaximum() const override { return ((TBranchElement*)fBranch)->GetMaximum(); }
0058 Int_t GetNdata() const override { return ((TBranchElement*)fBranch)->GetNdata()*fLen; }
0059 const char *GetTypeName() const override { return ((TBranchElement*)fBranch)->GetTypeName(); }
0060
0061 Double_t GetValue(Int_t i=0) const override { return ((TBranchElement*)fBranch)->GetValue(i, fLen, false);}
0062 Long64_t GetValueLong64(Int_t i = 0) const override { return ((TBranchElement*)fBranch)->GetTypedValue<Long64_t>(i, fLen, false); }
0063 LongDouble_t GetValueLongDouble(Int_t i = 0) const override { return ((TBranchElement*)fBranch)->GetTypedValue<LongDouble_t>(i, fLen, false); }
0064 template<typename T> T GetTypedValueSubArray(Int_t i=0, Int_t j=0) const {return ((TBranchElement*)fBranch)->GetTypedValue<T>(i, j, true);}
0065
0066 bool ReadBasketFast(TBuffer&, Long64_t) override;
0067
0068 void *GetValuePointer() const override { return ((TBranchElement*)fBranch)->GetValuePointer(); }
0069 bool IncludeRange(TLeaf *) override;
0070 bool IsOnTerminalBranch() const override;
0071 void PrintValue(Int_t i=0) const override {((TBranchElement*)fBranch)->PrintValue(i);}
0072 void SetLeafCount(TLeaf *leaf) override { fLeafCount = leaf; }
0073
0074 ClassDefOverride(TLeafElement,1);
0075 };
0076
0077 #endif