Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TChainElement.h
Go to the documentation of this file.
1 // @(#)root/tree:$Id$
2 // Author: Rene Brun 11/02/97
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 #ifndef ROOT_TChainElement
12 #define ROOT_TChainElement
13 
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TChainElement //
18 // //
19 // Describes a component of a TChain. //
20 // //
21 //////////////////////////////////////////////////////////////////////////
22 
23 
24 #include "TNamed.h"
25 
26 class TBranch;
27 
28 class TChainElement : public TNamed {
29 
30  // TChainElement status bits
31  enum EStatusBits {
32  kHasBeenLookedUp = BIT(15)
33  };
34 
35 protected:
36  Long64_t fEntries; ///< Number of entries in the tree of this chain element
37  Int_t fNPackets; ///< Number of packets
38  Int_t fPacketSize; ///< Number of events in one packet for parallel root
39  Int_t fStatus; ///< branch status when used as a branch
40  void *fBaddress; ///<! branch address when used as a branch
41  TString fBaddressClassName; ///<! Name of the class pointed to by fBaddress
42  UInt_t fBaddressType; ///<! Type of the value pointed to by fBaddress
43  Bool_t fBaddressIsPtr; ///<! True if the address is a pointer to an address
44  char *fPackets; ///<! Packet descriptor string
45  TBranch **fBranchPtr; ///<! Address of user branch pointer (to updated upon loading a file)
46  Int_t fLoadResult; ///<! Return value of TChain::LoadTree(); 0 means success
47 
48 public:
49  TChainElement();
50  TChainElement(const char *title, const char *filename);
51  virtual ~TChainElement();
52  virtual void CreatePackets();
53  virtual void *GetBaddress() const {return fBaddress;}
54  virtual const char *GetBaddressClassName() const { return fBaddressClassName; }
55  virtual Bool_t GetBaddressIsPtr() const { return fBaddressIsPtr; }
56  virtual UInt_t GetBaddressType() const { return fBaddressType; }
57  virtual TBranch **GetBranchPtr() const { return fBranchPtr; }
58  virtual Long64_t GetEntries() const {return fEntries;}
59  Int_t GetLoadResult() const { return fLoadResult; }
60  virtual char *GetPackets() const {return fPackets;}
61  virtual Int_t GetPacketSize() const {return fPacketSize;}
62  virtual Int_t GetStatus() const {return fStatus;}
63  virtual Bool_t HasBeenLookedUp() { return TestBit(kHasBeenLookedUp); }
64  virtual void ls(Option_t *option="") const;
65  virtual void SetBaddress(void *add) {fBaddress = add;}
66  virtual void SetBaddressClassName(const char* clname) { fBaddressClassName = clname; }
67  virtual void SetBaddressIsPtr(Bool_t isptr) { fBaddressIsPtr = isptr; }
68  virtual void SetBaddressType(UInt_t type) { fBaddressType = type; }
69  virtual void SetBranchPtr(TBranch **ptr) { fBranchPtr = ptr; }
70  void SetLoadResult(Int_t result) { fLoadResult = result; }
71  virtual void SetLookedUp(Bool_t y = kTRUE);
72  virtual void SetNumberEntries(Long64_t n) {fEntries=n;}
73  virtual void SetPacketSize(Int_t size = 100);
74  virtual void SetStatus(Int_t status) {fStatus = status;}
75 
76  ClassDef(TChainElement,2); //A chain element
77 };
78 
79 #endif
80