@@ -1281,6 +1281,17 @@ bool ROOT::TMetaUtils::HasDirectoryAutoAdd(const clang::CXXRecordDecl *cl, const
1281
1281
return CheckPublicFuncWithProto (cl,name,proto,interp, false /* diags*/ );
1282
1282
}
1283
1283
1284
+ // //////////////////////////////////////////////////////////////////////////////
1285
+ // / Return true if the class has a method Browse(TBrowser*) const
1286
+
1287
+ bool ROOT::TMetaUtils::HasBrowse (const clang::CXXRecordDecl *cl, const cling::Interpreter &interp)
1288
+ {
1289
+ const char *proto = " TBrowser*" ;
1290
+ const char *name = " Browse" ;
1291
+
1292
+ return CheckPublicFuncWithProto (cl,name,proto,interp, false /* diags*/ , true /* objectIsConst */ );
1293
+ }
1294
+
1284
1295
// //////////////////////////////////////////////////////////////////////////////
1285
1296
// / Return true if the class has a method Merge(TCollection*,TFileMergeInfo*)
1286
1297
@@ -1811,6 +1822,9 @@ void ROOT::TMetaUtils::WriteClassInit(std::ostream& finalString,
1811
1822
if (HasCustomConvStreamerMemberFunction (cl, decl, interp, normCtxt)) {
1812
1823
finalString << " static void conv_streamer_" << mappedname.c_str () << " (TBuffer &buf, void *obj, const TClass*);" << " \n " ;
1813
1824
}
1825
+ if (HasBrowse (decl, interp)) {
1826
+ finalString << " static void browse_" << mappedname.c_str () << " (const void *obj, TBrowser *b);" << " \n " ;
1827
+ }
1814
1828
if (HasNewMerge (decl, interp) || HasOldMerge (decl, interp)) {
1815
1829
finalString << " static Long64_t merge_" << mappedname.c_str () << " (void *obj, TCollection *coll,TFileMergeInfo *info);" << " \n " ;
1816
1830
}
@@ -1991,6 +2005,9 @@ void ROOT::TMetaUtils::WriteClassInit(std::ostream& finalString,
1991
2005
// We have a custom member function streamer or an older (not StreamerInfo based) automatic streamer.
1992
2006
finalString << " instance.SetConvStreamerFunc(&conv_streamer_" << mappedname.c_str () << " );" << " \n " ;
1993
2007
}
2008
+ if (HasBrowse (decl, interp)) {
2009
+ finalString << " instance.SetBrowse(&browse_" << mappedname.c_str () << " );" << " \n " ;
2010
+ }
1994
2011
if (HasNewMerge (decl, interp) || HasOldMerge (decl, interp)) {
1995
2012
finalString << " instance.SetMerge(&merge_" << mappedname.c_str () << " );" << " \n " ;
1996
2013
}
@@ -2609,6 +2626,12 @@ void ROOT::TMetaUtils::WriteAuxFunctions(std::ostream& finalString,
2609
2626
finalString << " // Wrapper around a custom streamer member function." << " \n " << " static void conv_streamer_" << mappedname.c_str () << " (TBuffer &buf, void *obj, const TClass *onfile_class) {" << " \n " << " ((" << classname.c_str () << " *)obj)->" << classname.c_str () << " ::Streamer(buf,onfile_class);" << " \n " << " }" << " \n " ;
2610
2627
}
2611
2628
2629
+ if (HasBrowse (decl, interp)) {
2630
+ finalString << " // Wrapper around the browse function." << " \n "
2631
+ << " static void browse_" << mappedname.c_str () << " (const void *obj, TBrowser *b) {" << " \n "
2632
+ << " return ((const " << classname.c_str () << " *)obj)->Browse(b);" << " \n " << " }" << " \n " ;
2633
+ }
2634
+
2612
2635
if (HasNewMerge (decl, interp)) {
2613
2636
finalString << " // Wrapper around the merge function." << " \n " << " static Long64_t merge_" << mappedname.c_str () << " (void *obj,TCollection *coll,TFileMergeInfo *info) {" << " \n " << " return ((" << classname.c_str () << " *)obj)->Merge(coll,info);" << " \n " << " }" << " \n " ;
2614
2637
} else if (HasOldMerge (decl, interp)) {
0 commit comments