Logo ROOT  
Reference Guide
TFriendProxyDescriptor.cxx
Go to the documentation of this file.
1// @(#)root/base:$Id$
2// Author: Philippe Canal 13/05/2003
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun, Fons Rademakers and al. *
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 TFriendProxyDescriptor
13Hold the processed information about a Friend TTree while
14TTreeProxyGenerator is parsing the TTree information.
15Also contains the routine use to generate the appropriate code
16fragment in the result of MakeProxy.
17*/
18
21#include "TList.h"
22
24
25namespace ROOT {
26namespace Internal {
27
29 const char *aliasname,
30 Int_t index) :
31 TNamed(treename,aliasname),
32 fDuplicate(kFALSE),
33 fIndex(index)
34 {
35 // Constructor
36 }
37
39 {
40 // Return true if this descriptor and the other are equivalent (describe the
41 // same entity).
42
43 if ( !other ) return kFALSE;
44 if ( strcmp(GetName(),other->GetName()) ) return kFALSE;
45
48
49 if ( fListOfTopProxies.GetSize() != other->fListOfTopProxies.GetSize() ) return kFALSE;
51 TIter othnext(&other->fListOfTopProxies);
52 while ( (desc=(TBranchProxyDescriptor*)next()) ) {
53 othdesc=(TBranchProxyDescriptor*)othnext();
54 if (!desc->IsEquivalent(othdesc) ) return kFALSE;
55 }
56 return kTRUE;
57 }
58
59 void TFriendProxyDescriptor::OutputClassDecl(FILE *hf, int offset, UInt_t maxVarname)
60 {
61 // Print the declaration needed for this descriptor.
62
63 fprintf(hf,"%-*sstruct TFriendPx_%s : public TFriendProxy {\n", offset," ", GetName() );
64 fprintf(hf,"%-*s TFriendPx_%s(TBranchProxyDirector *director,TTree *tree,Int_t index) :\n",
65 offset," ", GetName() );
66 fprintf(hf,"%-*s %-*s(director,tree,index)",offset," ",maxVarname,"TFriendProxy");
69 while ( (data = (TBranchProxyDescriptor*)next()) ) {
70 fprintf(hf,",\n%-*s %-*s(&fDirector,\"%s\")",
71 offset," ",maxVarname, data->GetDataName(), data->GetBranchName());
72 }
73 fprintf(hf,"\n%-*s { }\n",offset," ");
74
75 fprintf(hf, "\n%-*s // Proxy for each of the branches and leaves of the tree\n",offset," ");
76 next.Reset();
77 while ( (data = (TBranchProxyDescriptor*)next()) ) {
78 data->OutputDecl(hf, offset+3, maxVarname);
79 }
80 fprintf(hf,"%-*s};\n",offset," ");
81 }
82
83 void TFriendProxyDescriptor::OutputDecl(FILE *hf, int offset, UInt_t maxVarname)
84 {
85 // Print the declaration needed for this descriptor.
86
87 TString typeName = "TFriendPx_";
88 typeName += GetName();
89 fprintf(hf,"%-*s%-*s %s;\n",
90 offset," ",maxVarname,typeName.Data(),GetTitle());
91 }
92
93} // namespace Internal
94} // namespace ROOT
int Int_t
Definition: RtypesCore.h:43
unsigned int UInt_t
Definition: RtypesCore.h:44
const Bool_t kFALSE
Definition: RtypesCore.h:90
bool Bool_t
Definition: RtypesCore.h:61
const Bool_t kTRUE
Definition: RtypesCore.h:89
#define ClassImp(name)
Definition: Rtypes.h:361
void OutputDecl(FILE *hf, int offset, UInt_t maxVarname)
Bool_t IsEquivalent(const TBranchProxyDescriptor *other, Bool_t inClass=kFALSE)
void OutputDecl(FILE *hf, int offset, UInt_t maxVarname)
Bool_t IsEquivalent(const TFriendProxyDescriptor *other)
void OutputClassDecl(FILE *hf, int offset, UInt_t maxVarname)
TFriendProxyDescriptor(const TFriendProxyDescriptor &b)
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition: TCollection.h:182
void Reset()
Definition: TCollection.h:252
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
Basic string class.
Definition: TString.h:131
const char * Data() const
Definition: TString.h:364
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: StringConv.hxx:21