29 ClassImp(ROOT::Internal::TBranchProxyDescriptor);
34 TBranchProxyDescriptor::TBranchProxyDescriptor(
const char *dataname,
36 const char *branchname,
40 TNamed(dataname,type),fBranchName(branchname),fIsSplit(split),fBranchIsSkipped(skipped),fIsLeafList(isleaflist)
44 fDataName = GetName();
45 if (fDataName.Length() && fDataName[fDataName.Length()-1]==
'.') fDataName.Remove(fDataName.Length()-1);
47 fDataName.ReplaceAll(
".",
"_");
48 fDataName.ReplaceAll(
":",
"_");
49 fDataName.ReplaceAll(
"<",
"_");
50 fDataName.ReplaceAll(
">",
"_");
51 if (!isalpha(fDataName[0])) fDataName.Insert(0,
"_");
52 fDataName.ReplaceAll(
" ",
"");
53 fDataName.ReplaceAll(
"*",
"st");
54 fDataName.ReplaceAll(
"&",
"rf");
58 const char *TBranchProxyDescriptor::GetDataName()
64 const char *TBranchProxyDescriptor::GetTypeName()
70 const char *TBranchProxyDescriptor::GetBranchName()
73 return fBranchName.Data();
76 Bool_t TBranchProxyDescriptor::IsEquivalent(
const TBranchProxyDescriptor *other,
81 if ( !other )
return false;
82 if ( other ==
this )
return true;
88 if ( fBranchName != other->fBranchName )
return false;
90 if ( fIsSplit != other->fIsSplit )
return false;
91 if ( fBranchIsSkipped != other->fBranchIsSkipped)
return false;
92 if ( strcmp(GetName(),other->GetName()) )
return false;
93 if ( strcmp(GetTitle(),other->GetTitle()) )
return false;
97 Bool_t TBranchProxyDescriptor::IsSplit()
const
103 void TBranchProxyDescriptor::OutputDecl(FILE *hf,
int offset, UInt_t maxVarname)
106 fprintf(hf,
"%-*s%-*s %s;\n", offset,
" ", maxVarname, GetTypeName(), GetDataName());
109 void TBranchProxyDescriptor::OutputInit(FILE *hf,
int offset,
115 const char *subbranchname = GetBranchName();
116 const char *above =
"";
117 if (strncmp(prefix,subbranchname,strlen(prefix))==0
118 && strcmp(prefix,subbranchname)!=0) {
119 subbranchname += strlen(prefix)+1;
120 above =
"ffPrefix, ";
123 if (fBranchIsSkipped) {
124 fprintf(hf,
"\n%-*s %-*s(director, obj.GetProxy(), \"%s\", %s\"%s\")",
125 offset,
" ", maxVarname, GetDataName(), GetDataName(), above, subbranchname);
128 if (above[0]==
'\0') {
129 fprintf(hf,
"\n%-*s %-*s(director, \"%s\", \"\", \"%s\")",
130 offset,
" ", maxVarname, GetDataName(), subbranchname, GetDataName());
132 fprintf(hf,
"\n%-*s %-*s(director, %s\"%s\", \"%s\")",
133 offset,
" ", maxVarname, GetDataName(), above, subbranchname, GetDataName());
136 fprintf(hf,
"\n%-*s %-*s(director, %s\"%s\")",
137 offset,
" ", maxVarname, GetDataName(), above, subbranchname);
142 fprintf(hf,
"\n%-*s %-*s(director, obj.GetProxy(), \"%s\")",
143 offset,
" ", maxVarname, GetDataName(), GetBranchName() );