ROOT  6.06/09
Reference Guide
TChainElement.cxx
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 
12 /** \class TChainElement
13 A TChainElement describes a component of a TChain.
14 */
15 
16 #include "TTree.h"
17 #include "TChainElement.h"
18 #include "Riostream.h"
19 #include "TROOT.h"
20 
22 
23 ////////////////////////////////////////////////////////////////////////////////
24 /// Default constructor for a chain element.
25 
26 TChainElement::TChainElement() : TNamed(),fBaddress(0),fBaddressType(0),
27  fBaddressIsPtr(kFALSE), fBranchPtr(0)
28 {
29  fNPackets = 0;
30  fPackets = 0;
31  fEntries = 0;
32  fPacketSize = 100;
33  fStatus = -1;
34  ResetBit(kHasBeenLookedUp);
35 }
36 
37 ////////////////////////////////////////////////////////////////////////////////
38 /// Create a chain element.
39 
40 TChainElement::TChainElement(const char *name, const char *title)
41  :TNamed(name,title),fBaddress(0),fBaddressType(0),
42  fBaddressIsPtr(kFALSE), fBranchPtr(0)
43 {
44  fNPackets = 0;
45  fPackets = 0;
46  fEntries = 0;
47  fPacketSize = 100;
48  fStatus = -1;
50 }
51 
52 ////////////////////////////////////////////////////////////////////////////////
53 /// Default destructor for a chain element.
54 
56 {
57  delete [] fPackets;
58 }
59 
60 ////////////////////////////////////////////////////////////////////////////////
61 /// Initialize the packet descriptor string.
62 
64 {
66  delete [] fPackets;
67  fPackets = new char[fNPackets+1];
68  for (Int_t i=0;i<fNPackets;i++) fPackets[i] = ' ';
69  fPackets[fNPackets] = 0;
70 
71 }
72 
73 ////////////////////////////////////////////////////////////////////////////////
74 /// List files in the chain.
75 
77 {
79  std::cout << GetTitle() << "tree:" << GetName() << " entries=";
81  std::cout << "<not calculated>";
82  else
83  std::cout << fEntries;
84  std::cout << '\n';
85 }
86 
87 ////////////////////////////////////////////////////////////////////////////////
88 /// Set number of entries per packet for parallel root.
89 
91 {
92  fPacketSize = size;
93 }
94 
95 ////////////////////////////////////////////////////////////////////////////////
96 /// Set/Reset the looked-up bit
97 
99 {
100  if (y)
102  else
104 }
105 
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:52
const char Option_t
Definition: RtypesCore.h:62
ClassImp(TChainElement) TChainElement
Default constructor for a chain element.
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual void SetLookedUp(Bool_t y=kTRUE)
Set/Reset the looked-up bit.
A TChainElement describes a component of a TChain.
Definition: TChainElement.h:30
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:732
virtual void SetPacketSize(Int_t size=100)
Set number of entries per packet for parallel root.
char * fPackets
True if the address is a pointer to an address.
Definition: TChainElement.h:46
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
virtual ~TChainElement()
Default destructor for a chain element.
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
Long64_t fEntries
Definition: TChainElement.h:38
virtual void CreatePackets()
Initialize the packet descriptor string.
Double_t y[n]
Definition: legend1.C:17
#define name(a, b)
Definition: linkTestLib0.cpp:5
virtual void ls(Option_t *option="") const
List files in the chain.
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
Definition: TROOT.cxx:2461
void ResetBit(UInt_t f)
Definition: TObject.h:172
TChainElement()
Address of user branch pointer (to updated upon loading a file)
static constexpr Long64_t kMaxEntries
Definition: TTree.h:217