ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 "TChainElement.h"
17 #include "TBuffer.h"
18 #include "TTree.h"
19 #include "Riostream.h"
20 #include "TROOT.h"
21 
23 
24 ////////////////////////////////////////////////////////////////////////////////
25 /// Default constructor for a chain element.
26 
27 TChainElement::TChainElement() : TNamed(),fBaddress(0),fBaddressType(0),
28  fBaddressIsPtr(kFALSE), fBranchPtr(0)
29 {
30  fNPackets = 0;
31  fPackets = 0;
32  fEntries = 0;
33  fPacketSize = 100;
34  fStatus = -1;
35  ResetBit(kHasBeenLookedUp);
36 }
37 
38 ////////////////////////////////////////////////////////////////////////////////
39 /// Create a chain element.
40 
41 TChainElement::TChainElement(const char *name, const char *title)
42  :TNamed(name,title),fBaddress(0),fBaddressType(0),
43  fBaddressIsPtr(kFALSE), fBranchPtr(0)
44 {
45  fNPackets = 0;
46  fPackets = 0;
47  fEntries = 0;
48  fPacketSize = 100;
49  fStatus = -1;
51 }
52 
53 ////////////////////////////////////////////////////////////////////////////////
54 /// Default destructor for a chain element.
55 
57 {
58  delete [] fPackets;
59 }
60 
61 ////////////////////////////////////////////////////////////////////////////////
62 /// Initialize the packet descriptor string.
63 
65 {
67  delete [] fPackets;
68  fPackets = new char[fNPackets+1];
69  for (Int_t i=0;i<fNPackets;i++) fPackets[i] = ' ';
70  fPackets[fNPackets] = 0;
71 
72 }
73 
74 ////////////////////////////////////////////////////////////////////////////////
75 /// List files in the chain.
76 
78 {
80  std::cout << GetTitle() << "tree:" << GetName() << " entries=";
82  std::cout << "<not calculated>";
83  else
84  std::cout << fEntries;
85  std::cout << '\n';
86 }
87 
88 ////////////////////////////////////////////////////////////////////////////////
89 /// Set number of entries per packet for parallel root.
90 
92 {
93  fPacketSize = size;
94 }
95 
96 ////////////////////////////////////////////////////////////////////////////////
97 /// Set/Reset the looked-up bit
98 
100 {
101  if (y)
103  else
105 }
106 
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.
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
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:2501
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:221