@@ -1276,6 +1276,17 @@ bool ROOT::TMetaUtils::HasDirectoryAutoAdd(const clang::CXXRecordDecl *cl, const
1276
1276
return CheckPublicFuncWithProto (cl, name, proto, interp, false /* diags*/ );
1277
1277
}
1278
1278
1279
+ // //////////////////////////////////////////////////////////////////////////////
1280
+ // / Return true if the class has a method Browse(TBrowser*) const
1281
+
1282
+ bool ROOT::TMetaUtils::HasBrowse (const clang::CXXRecordDecl *cl, const cling::Interpreter &interp)
1283
+ {
1284
+ const char *proto = " TBrowser*" ;
1285
+ const char *name = " Browse" ;
1286
+
1287
+ return CheckPublicFuncWithProto (cl, name, proto, interp, false /* diags*/ , true /* objectIsConst */ );
1288
+ }
1289
+
1279
1290
// //////////////////////////////////////////////////////////////////////////////
1280
1291
// / Return true if the class has a method Merge(TCollection*,TFileMergeInfo*)
1281
1292
@@ -1806,6 +1817,9 @@ void ROOT::TMetaUtils::WriteClassInit(std::ostream& finalString,
1806
1817
if (HasCustomConvStreamerMemberFunction (cl, decl, interp, normCtxt)) {
1807
1818
finalString << " static void conv_streamer_" << mappedname.c_str () << " (TBuffer &buf, void *obj, const TClass*);" << " \n " ;
1808
1819
}
1820
+ if (HasBrowse (decl, interp)) {
1821
+ finalString << " static void browse_" << mappedname.c_str () << " (const void *obj, TBrowser *b);" << " \n " ;
1822
+ }
1809
1823
if (HasNewMerge (decl, interp) || HasOldMerge (decl, interp)) {
1810
1824
finalString << " static Long64_t merge_" << mappedname.c_str () << " (void *obj, TCollection *coll,TFileMergeInfo *info);" << " \n " ;
1811
1825
}
@@ -1986,6 +2000,9 @@ void ROOT::TMetaUtils::WriteClassInit(std::ostream& finalString,
1986
2000
// We have a custom member function streamer or an older (not StreamerInfo based) automatic streamer.
1987
2001
finalString << " instance.SetConvStreamerFunc(&conv_streamer_" << mappedname.c_str () << " );" << " \n " ;
1988
2002
}
2003
+ if (HasBrowse (decl, interp)) {
2004
+ finalString << " instance.SetBrowse(&browse_" << mappedname.c_str () << " );" << " \n " ;
2005
+ }
1989
2006
if (HasNewMerge (decl, interp) || HasOldMerge (decl, interp)) {
1990
2007
finalString << " instance.SetMerge(&merge_" << mappedname.c_str () << " );" << " \n " ;
1991
2008
}
@@ -2604,6 +2621,13 @@ void ROOT::TMetaUtils::WriteAuxFunctions(std::ostream& finalString,
2604
2621
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 " ;
2605
2622
}
2606
2623
2624
+ if (HasBrowse (decl, interp)) {
2625
+ finalString << " // Wrapper around the browse function." << " \n "
2626
+ << " static void browse_" << mappedname.c_str () << " (const void *obj, TBrowser *b) {" << " \n "
2627
+ << " return ((const " << classname.c_str () << " *)obj)->Browse(b);" << " \n "
2628
+ << " }" << " \n " ;
2629
+ }
2630
+
2607
2631
if (HasNewMerge (decl, interp)) {
2608
2632
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 " ;
2609
2633
} else if (HasOldMerge (decl, interp)) {
0 commit comments