Here’s what I would like to do, and I’d like to know if TClassGenerator is the way to go.
I open a root file containing a TTree of some custom classes. If I did not load my custom library prior to the opening I know I will get messages like :
Warning in TClass::TClass: no dictionary for class Custom is available
But I know the relationship class name <-> library to load. Could I use a TClassGenerator to trig the loading of the library which contains Custom dictionary ?
If so, well, a code sample of TClassGenerator implementation would be greatly appreciated.
Your solution 1 is what I would have done, but I was wondering about how to implement the other GetClass method : GetClass(const std::type_info& tif, Bool_t load). Is that one needed too ?
BTW, I’m afraid I current cannot use rlibmap, as it seems it’s a “late” addition (I use ROOT 3.05). But sounds good. Is there some doc. for it ; where is the .rootmap read in ?
rlibmap with linkdef file is new to ROOT 4.00.06.
For the other signature of TClassGenerator I recomment you just implement it as something like:
Error("GetClass with typeid. This should not have been called\n").
Assert(0);
return 0;
I.e. since you would get there if your library is not loaded, it should not be possible to pass it a typeid (which would require the library).
I guess for the time being (until we upgrade to latest and greatest ROOT), I’ll make a TClassGenerator which reads a rootmap-type file (so when we upgrade, I’ll simply remove my own class generator and let’s root do the job
Now the question is how can I specify library dependencies in my rootmap file, or may be my question is : what kind of file should I put in the -d option of rlibmap ?
I’ve done a checkout of root from cvs, and can not find the system.rootmap file in the directory I got, is that normal ?
Also, under ROOT-3.05/07 (Linux RH8), I tried to make my own class generator, and it seems it’s continuously being called with classname=short, double, int etc… Is that a feature or …