Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TBranchObject.h
Go to the documentation of this file.
1 // @(#)root/tree:$Id$
2 // Author: Rene Brun 11/02/96
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
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_TBranchObject
13 #define ROOT_TBranchObject
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TBranchObject //
19 // //
20 // A Branch for the case of an object. //
21 //////////////////////////////////////////////////////////////////////////
22 
23 
24 #include "TBranch.h"
25 
26 class TBranchObject : public TBranch {
27 
28 protected:
29  enum EStatusBits {
30  kWarn = BIT(14)
31  };
32 
33  // In version of ROOT older then v6.12, kWarn was set to BIT(12)
34  // which overlaps with TBranch::kBranchObject. Since it stored
35  // in ROOT files as part of the TBranchObject and that we want
36  // to reset in TBranchObject::Streamer, we need to keep track
37  // of the old value.
38  enum EStatusBitsOldValues {
39  kOldWarn = BIT(12)
40  };
41 
42  TString fClassName; ///< Class name of referenced object
43  TObject *fOldObject; ///< !Pointer to old object
44 
45  void Init(TTree *tree, TBranch *parent, const char *name, const char *classname, void *addobj, Int_t basketsize, Int_t splitlevel, Int_t compress, Bool_t isptrptr);
46 
47 public:
48  TBranchObject();
49  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_t isptrptr = kTRUE);
50  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_t isptrptr = kTRUE);
51  virtual ~TBranchObject();
52 
53  virtual void Browse(TBrowser *b);
54  virtual const char* GetClassName() const { return fClassName.Data(); };
55  virtual const char* GetObjClassName() { return fClassName.Data(); };
56  virtual Int_t GetEntry(Long64_t entry=0, Int_t getall = 0);
57  virtual Int_t GetExpectedType(TClass *&clptr,EDataType &type);
58  Bool_t IsFolder() const;
59  virtual void Print(Option_t *option="") const;
60  virtual void Reset(Option_t *option="");
61  virtual void ResetAfterMerge(TFileMergeInfo *);
62  virtual void SetAddress(void *addobj);
63  virtual void SetAutoDelete(Bool_t autodel=kTRUE);
64  virtual void SetBasketSize(Int_t buffsize);
65  virtual void SetupAddresses();
66  virtual void UpdateAddress();
67 
68 private:
69  virtual Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *);
70 
71  ClassDef(TBranchObject,1); //Branch in case of an object
72 };
73 
74 #endif