From e97de5275d629134da99a38b4f3a581728bbe72e Mon Sep 17 00:00:00 2001 From: Philippe Canal <pcanal@fnal.gov> Date: Thu, 1 Feb 2007 21:57:35 +0000 Subject: [PATCH] 1. Due to a weakness in CINT (privacy level of nested classies is hard to get to), we need re-instate the '#define private public' trick which is still required to properly deal with nested private and protected classes ... This shall be visited again when Cint has been fully upgraded to use Reflex. 2. Delay the construction of the CollectionProxy object to when the TClass object is created. The dictionary now depend on the light weight TCollectionProxyInfo instead of TCollectionProxy (which depends on the I/O). This new object is stored in the TGenericClassInfo. 3. The dependency of TCollectionProxy is added __only__ when required by the content of the dictionary git-svn-id: http://root.cern.ch/svn/root/trunk@17626 27541ba8-7e3a-0410-8455-c3a389f83636 --- utils/src/rootcint.cxx | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/utils/src/rootcint.cxx b/utils/src/rootcint.cxx index aca7fe8ae94..25f0fd87843 100644 --- a/utils/src/rootcint.cxx +++ b/utils/src/rootcint.cxx @@ -1,4 +1,4 @@ -// @(#)root/utils:$Name: $:$Id: rootcint.cxx,v 1.253 2007/01/31 15:47:31 brun Exp $ +// @(#)root/utils:$Name: $:$Id: rootcint.cxx,v 1.254 2007/01/31 19:59:53 pcanal Exp $ // Author: Fons Rademakers 13/07/96 /************************************************************************* @@ -337,6 +337,8 @@ char autold[64]; std::ostream* dictSrcOut=&std::cout; G__ShadowMaker *shadowMaker=0; +bool gNeedCollectionProxy = false; + enum EDictType { kDictTypeCint, kDictTypeReflex, @@ -2476,10 +2478,10 @@ void WriteClassInit(G__ClassInfo &cl) methodTCP="Insert"; break; } - (*dictSrcOut) << " instance.AdoptStreamer(TCollectionProxy::GenClassStreamer(TCollectionProxy::" - << methodTCP << "< " << classname.c_str() << " >()));" << std::endl - << " instance.AdoptCollectionProxy(TCollectionProxy::GenProxy(TCollectionProxy::" - << methodTCP << "< " << classname.c_str() << " >()));" << std::endl; + (*dictSrcOut) << " instance.AdoptCollectionProxyInfo(TCollectionProxyInfo::Generate(TCollectionProxyInfo::" + << methodTCP << "< " << classname.c_str() << " >()));" << std::endl; + + gNeedCollectionProxy = true; } (*dictSrcOut) << " return &instance;" << std::endl << " }" << std::endl; @@ -4561,18 +4563,18 @@ int main(int argc, char **argv) << "//" << std::endl << std::endl << "#include \"RConfig.h\"" << std::endl -// << "#if !defined(R__ACCESS_IN_SYMBOL)" << std::endl -// << "//Break the privacy of classes -- Disabled for the moment" << std::endl -// << "#define private public" << std::endl -// << "#define protected public" << std::endl -// << "#endif" << std::endl - << std::endl; + << "#if !defined(R__ACCESS_IN_SYMBOL)" << std::endl + << "//Break the privacy of classes -- Disabled for the moment" << std::endl + << "#define private public" << std::endl + << "#define protected public" << std::endl + << "#endif" << std::endl + << std::endl; #ifndef R__SOLARIS (*dictSrcOut) << "// Since CINT ignores the std namespace, we need to do so in this file." << std::endl << "namespace std {} using namespace std;" << std::endl << std::endl; - int linesToSkip = 10; // number of lines up to here. + int linesToSkip = 15; // number of lines up to here. #else - int linesToSkip = 07; // number of lines up to here. + int linesToSkip = 12; // number of lines up to here. #endif (*dictSrcOut) << "#include \"TClass.h\"" << std::endl @@ -4583,7 +4585,6 @@ int main(int argc, char **argv) << "#define G__ROOT" << std::endl << "#endif" << std::endl << std::endl << "#include \"RtypesImp.h\"" << std::endl - << "#include \"TCollectionProxy.h\"" << std::endl << "#include \"TIsAProxy.h\"" << std::endl; (*dictSrcOut) << std::endl; #ifdef R__SOLARIS @@ -4966,6 +4967,9 @@ int main(int argc, char **argv) } else { fprintf(fpd, "#include \"%s\"\n", inclf); } + if (gNeedCollectionProxy) { + fprintf(fpd, "\n#include \"TCollectionProxyInfo.h\""); + } } } } -- GitLab