ROOT logo
// @(#)root/tree
// Author: Rene Brun   11/02/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_TBranchClones
#define ROOT_TBranchClones


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TBranchClones                                                        //
//                                                                      //
// A Branch for the case of an array of clone objects.                  //
//////////////////////////////////////////////////////////////////////////


#ifndef ROOT_TBranch
#include "TBranch.h"
#endif

class TClonesArray;
class TTreeCloner;

class TBranchClones : public TBranch {

protected:
   TClonesArray     *fList;           //!Pointer to the clonesarray
   Int_t            fRead;            //!flag = 1 if clonesarray has been read
   Int_t            fN;               //!Number of elements in ClonesArray
   Int_t            fNdataMax;        //!Maximum value of fN
   TString          fClassName;       //name of the class of the objets in the ClonesArray
   TBranch          *fBranchCount;    //Branch with clones count

   friend class TTreeCloner;

   void Init(TTree *tree, TBranch *parent, const char *name, void *clonesaddress, Int_t basketsize=32000,Int_t compress=-1, Int_t splitlevel=1);

public:
   TBranchClones();
   TBranchClones(TTree *tree, const char *name, void *clonesaddress, Int_t basketsize=32000,Int_t compress=-1, Int_t splitlevel=1);
   TBranchClones(TBranch *parent, const char *name, void *clonesaddress, Int_t basketsize=32000,Int_t compress=-1, Int_t splitlevel=1);
   virtual ~TBranchClones();
   
   virtual void    Browse(TBrowser *b);
   virtual Int_t   Fill();
   virtual const char* GetClassName() const { return fClassName; }
   virtual Int_t   GetEntry(Long64_t entry=0, Int_t getall = 0);
   virtual Int_t   GetN() const {return fN;}
   TClonesArray    *GetList() const {return fList;}
   Bool_t          IsFolder() const {return kTRUE;}
   virtual void    Print(Option_t *option="") const;
   virtual void    Reset(Option_t *option="");
   virtual void    ResetAfterMerge(TFileMergeInfo *);
   virtual void    SetAddress(void *add);
   virtual void    SetBasketSize(Int_t buffsize);
   virtual void    SetTree(TTree *tree) { fTree = tree; fBranchCount->SetTree(tree); }
   virtual void    UpdateFile();

   ClassDef(TBranchClones,2);  //Branch in case of an array of clone objects
};

#endif
 TBranchClones.h:1
 TBranchClones.h:2
 TBranchClones.h:3
 TBranchClones.h:4
 TBranchClones.h:5
 TBranchClones.h:6
 TBranchClones.h:7
 TBranchClones.h:8
 TBranchClones.h:9
 TBranchClones.h:10
 TBranchClones.h:11
 TBranchClones.h:12
 TBranchClones.h:13
 TBranchClones.h:14
 TBranchClones.h:15
 TBranchClones.h:16
 TBranchClones.h:17
 TBranchClones.h:18
 TBranchClones.h:19
 TBranchClones.h:20
 TBranchClones.h:21
 TBranchClones.h:22
 TBranchClones.h:23
 TBranchClones.h:24
 TBranchClones.h:25
 TBranchClones.h:26
 TBranchClones.h:27
 TBranchClones.h:28
 TBranchClones.h:29
 TBranchClones.h:30
 TBranchClones.h:31
 TBranchClones.h:32
 TBranchClones.h:33
 TBranchClones.h:34
 TBranchClones.h:35
 TBranchClones.h:36
 TBranchClones.h:37
 TBranchClones.h:38
 TBranchClones.h:39
 TBranchClones.h:40
 TBranchClones.h:41
 TBranchClones.h:42
 TBranchClones.h:43
 TBranchClones.h:44
 TBranchClones.h:45
 TBranchClones.h:46
 TBranchClones.h:47
 TBranchClones.h:48
 TBranchClones.h:49
 TBranchClones.h:50
 TBranchClones.h:51
 TBranchClones.h:52
 TBranchClones.h:53
 TBranchClones.h:54
 TBranchClones.h:55
 TBranchClones.h:56
 TBranchClones.h:57
 TBranchClones.h:58
 TBranchClones.h:59
 TBranchClones.h:60
 TBranchClones.h:61
 TBranchClones.h:62
 TBranchClones.h:63
 TBranchClones.h:64
 TBranchClones.h:65
 TBranchClones.h:66
 TBranchClones.h:67
 TBranchClones.h:68
 TBranchClones.h:69