66 const char *bracket = strchr(name,
'[');
77 fLenType(lf.fLenType),
79 fIsRange(lf.fIsRange),
80 fIsUnsigned(lf.fIsUnsigned),
81 fLeafCount(lf.fLeafCount),
169 char* bleft = (
char*) strchr(name,
'[');
174 Int_t nch = strlen(bleft);
175 char* countname =
new char[nch+1];
176 strcpy(countname, bleft);
177 char* bright = (
char*) strchr(countname,
']');
184 char *bleft2 = (
char*) strchr(countname,
'[');
186 nch = strlen(countname);
190 Error(
"GetLeafCounter",
"TLeaf %s is not setup properly, fBranch is null.",
GetName());
205 if (!leaf && strchr(
GetName(),
'.')) {
206 char* withdot =
new char[strlen(
GetName())+strlen(countname)+1];
208 char* lastdot = strrchr(withdot,
'.');
209 strcpy(lastdot, countname);
214 if (!leaf && strchr(countname,
'.')) {
224 sscanf(bleft2,
"[%d]", &i);
230 bleft = (
char*) strchr(bleft2,
'[');
234 sscanf(bleft,
"[%d]", &i);
243 for (i = 0; i < nch; i++) {
244 if (!isdigit(countname[i])) {
251 sscanf(countname,
"%d", &countval);
253 sscanf(bleft2,
"[%d]", &i);
259 bleft = (
char*) strchr(bleft2,
'[');
263 sscanf(bleft,
"[%d]", &i);
281 if (len > fLeafCount->GetMaximum()) {
282 Error(
"GetLen",
"Leaf counter is greater than maximum! leaf: '%s' len: %d max: %d",
GetName(), len, fLeafCount->GetMaximum());
283 len = fLeafCount->GetMaximum();
313 if (!calledFromDestructor) {
317 fNdata = (fLeafCount->GetMaximum() + 1) * fLen;
339 if (
IsZombie() && (fLen == -1) && leaf) {
352 void TLeaf::Streamer(
TBuffer &b)
virtual Int_t GetLen() const
Return the number of effective elements of this leaf.
virtual ~TLeaf()
Destructor.
virtual const char * GetTitle() const
Returns title of object.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
Int_t GetLast() const
Return index of last object in array.
TString & ReplaceAll(const TString &s1, const TString &s2)
Buffer base class used for serializing objects.
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
virtual TObject * Remove(TObject *obj)
Remove object from array.
TBranch * GetBranch() const
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void SetRange(Bool_t range=kTRUE)
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
The TNamed class is the base class for all named ROOT classes.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Int_t fLen
Number of elements in fAddress data buffer.
virtual void SetAddress(void *add=0)
virtual void FillBasket(TBuffer &b)
Pack leaf elements in Basket output buffer.
virtual TLeaf * GetLeafCounter(Int_t &countval) const
Return a pointer to the counter of this leaf.
Using a TBrowser one can browse all ROOT objects.
TNamed & operator=(const TNamed &rhs)
TNamed assignment operator.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t TestBit(UInt_t f) const
virtual TLeaf * FindLeaf(const char *name)
Find leaf..
virtual const char * GetName() const
Returns name of object.
virtual void SetLeafCount(TLeaf *leaf)
Set the leaf count of this leaf.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual void Browse(TBrowser *b)
Browse the content of this leaf.
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
TObjArray * GetListOfLeaves()
Int_t GetEntries() const
Return the number of objects in array (i.e.
Int_t ResetAddress(void *add, Bool_t destructor=kFALSE)
Helper routine for TLeafX::SetAddress.
A TTree object has a header with a name and a title.
TLeaf & operator=(const TLeaf &)
Assignment operator.
A TTree is a list of TBranches.
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual TObjArray * GetListOfLeaves()