TGeoIteratorPlugin::fIterator is private

Dear rooters,

TGeoIteratorPlugin::fIterator is used in the function void iterplugin::ProcessNode() in tutorials/geom/iterplugin.cxx. But it is defined as a private variable:

root.cern.ch/root/htmldoc/TGeoIt … :fIterator

for some reason it can be compiled in ROOT interactive session using .L iterplugin.cxx+

I tried to compile it with a stand alone program, but the compiler complains:

g++ -O2 -Wall -fPIC -pthread -m64 -I/usr/local/root_v5.26.00b/include -I…/…/include/XMan -c -o GeomPainterPlugin.o GeomPainterPlugin.cc
/usr/local/root_v5.26.00b/include/TGeoNode.h: In member function ‘virtual void GeomPainterPlugin::ProcessNode()’:
/usr/local/root_v5.26.00b/include/TGeoNode.h:222: error: ‘const TGeoIterator* TGeoIteratorPlugin::fIterator’ is private
GeomPainterPlugin.cc:19: error: within this context
/usr/local/root_v5.26.00b/include/TGeoNode.h:222: error: ‘const TGeoIterator* TGeoIteratorPlugin::fIterator’ is private
GeomPainterPlugin.cc:21: error: within this context
make: *** [GeomPainterPlugin.o] Error 1

Could somebody explain why?

Thanks, Jing

Hi Jing,

Indeed, your observation is correct - CINT is defining private to be public, that’s why it works. I changed the TGeoIteratorPlugin class and made fIterator protected, but currently ROOT is being stamped for the coming release so the patch will appear soon after.

Cheers,

Dear Andrei,

thanks a lot for your quick reply. I will just wait for the patch. Meanwhile I will change the code by myself locally.

Cheers, Jing