Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:32

0001 // @(#)root/tree:$Id$
0002 // Author: Rene Brun   11/02/96
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TBranchObject
0013 #define ROOT_TBranchObject
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TBranchObject                                                        //
0019 //                                                                      //
0020 // A Branch for the case of an object.                                  //
0021 //////////////////////////////////////////////////////////////////////////
0022 
0023 
0024 #include "TBranch.h"
0025 
0026 class TBranchObject : public TBranch {
0027 
0028 protected:
0029    enum EStatusBits {
0030       kWarn = BIT(14)
0031    };
0032 
0033    /// In version of ROOT older then v6.12, kWarn was set to BIT(12)
0034    /// which overlaps with TBranch::kBranchObject.  Since it stored
0035    /// in ROOT files as part of the TBranchObject and that we want
0036    /// to reset in TBranchObject::Streamer, we need to keep track
0037    /// of the old value.
0038    enum EStatusBitsOldValues {
0039       kOldWarn = BIT(12)
0040    };
0041 
0042    TString     fClassName;        ///< Class name of referenced object
0043    TObject     *fOldObject;       ///< !Pointer to old object
0044 
0045    void Init(TTree *tree, TBranch *parent, const char *name, const char *classname, void *addobj, Int_t basketsize, Int_t splitlevel, Int_t compress, bool isptrptr);
0046 
0047 public:
0048    TBranchObject();
0049    TBranchObject(TBranch *parent, const char *name, const char *classname, void *addobj, Int_t basketsize=32000, Int_t splitlevel = 0, Int_t compress = ROOT::RCompressionSetting::EAlgorithm::kInherit, bool isptrptr = true);
0050    TBranchObject(TTree *tree, const char *name, const char *classname, void *addobj, Int_t basketsize=32000, Int_t splitlevel = 0, Int_t compress = ROOT::RCompressionSetting::EAlgorithm::kInherit, bool isptrptr = true);
0051    ~TBranchObject() override;
0052 
0053            void        Browse(TBrowser *b) override;
0054            const char* GetClassName() const override { return fClassName.Data(); };
0055    virtual const char* GetObjClassName() { return fClassName.Data(); };
0056            Int_t       GetEntry(Long64_t entry=0, Int_t getall = 0) override;
0057            Int_t       GetExpectedType(TClass *&clptr,EDataType &type) override;
0058            bool        IsFolder() const override;
0059            void        Print(Option_t *option="") const override;
0060            void        Reset(Option_t *option="") override;
0061            void        ResetAfterMerge(TFileMergeInfo *) override;
0062            void        SetAddress(void *addobj) override;
0063            void        SetAutoDelete(bool autodel=true) override;
0064            void        SetBasketSize(Int_t buffsize) override;
0065            void        SetupAddresses() override;
0066            void        UpdateAddress() override;
0067 
0068 private:
0069            Int_t       FillImpl(ROOT::Internal::TBranchIMTHelper *) override;
0070 
0071    ClassDefOverride(TBranchObject,1);  //Branch in case of an object
0072 };
0073 
0074 #endif