00001 // @(#)root/tree:$Id: TLeafElement.h 20882 2007-11-19 11:31:26Z rdm $ 00002 // Author: Rene Brun 14/01/2001 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 #ifndef ROOT_TLeafElement 00013 #define ROOT_TLeafElement 00014 00015 00016 ////////////////////////////////////////////////////////////////////////// 00017 // // 00018 // TLeafElement // 00019 // // 00020 // A TLeaf for a general object derived from TObject. // 00021 // // 00022 ////////////////////////////////////////////////////////////////////////// 00023 00024 00025 #ifndef ROOT_TLeaf 00026 #include "TLeaf.h" 00027 #endif 00028 #ifndef ROOT_TBranchElement 00029 #include "TBranchElement.h" 00030 #endif 00031 00032 class TMethodCall; 00033 00034 class TLeafElement : public TLeaf { 00035 00036 protected: 00037 char *fAbsAddress; //! Absolute leaf Address 00038 Int_t fID; //element serial number in fInfo 00039 Int_t fType; //leaf type 00040 00041 public: 00042 TLeafElement(); 00043 TLeafElement(TBranch *parent, const char *name, Int_t id, Int_t type); 00044 virtual ~TLeafElement(); 00045 00046 virtual Int_t GetLen() const {return ((TBranchElement*)fBranch)->GetNdata()*fLen;} 00047 TMethodCall *GetMethodCall(const char *name); 00048 virtual Int_t GetMaximum() const {return ((TBranchElement*)fBranch)->GetMaximum();} 00049 virtual Int_t GetNdata() const {return ((TBranchElement*)fBranch)->GetNdata()*fLen;} 00050 virtual const char *GetTypeName() const {return ((TBranchElement*)fBranch)->GetTypeName();} 00051 virtual Double_t GetValue(Int_t i=0) const {return ((TBranchElement*)fBranch)->GetValue(i, fLen, kFALSE);} 00052 virtual Double_t GetValueSubArray(Int_t i=0, Int_t j=0) const {return ((TBranchElement*)fBranch)->GetValue(i, j, kTRUE);} 00053 virtual void *GetValuePointer() const { return ((TBranchElement*)fBranch)->GetValuePointer(); } 00054 virtual Bool_t IsOnTerminalBranch() const; 00055 virtual void PrintValue(Int_t i=0) const {((TBranchElement*)fBranch)->PrintValue(i);} 00056 virtual void SetLeafCount(TLeaf *leaf) {fLeafCount = leaf;} 00057 00058 ClassDef(TLeafElement,1); //A TLeaf for a general object derived from TObject. 00059 }; 00060 00061 #endif