Re: Auto-documentation, Streamers, and virtual functions

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Thu Feb 17 2000 - 10:20:44 MET


Hi George,

   much better would be to make a stand alone program "rootdoc" that
works like "rootcint", in which case you would not need any special
macros at all. The ClassDef macros are only needed to have access
to the cint rtti from compiled code, but in rootdoc all the info
can be directly obtained from cint's memory.

Any volunteers.


Cheers, Fons.


On Wed, Feb 16, 2000 at 01:50:03PM -0500, George Heintzelman wrote:
> 
> Hi, Rooters,
> 
> As Root currently stands, in order to use the automatic documentation 
> system one has to use the ClassDef() and ClassImp() macros. There are 
> classes for which this is an imposition, but also where you would 
> nevertheless like to have documentation available. The two cases in 
> particular are:
> 
> 1) Classes which should never be read and written, for which a Streamer 
> is declared (and if you are careless, auto-generated) anyway.
> 
> 2) Classes which wrap very small amounts of data, eg. smart pointers, 
> which do not have their own virtual functions and for which the 
> addition of the virtual functions IsA, ShowMembers and Streamer adds a 
> significant (up to a factor of 2) amount to the size of the object.
> 
> Looking carefully at the definitions of the macros, it appears that it 
> should be feasible to extract the parts needed for documentation 
> generation and use only those in a documentation generation. There are 
> two questions I want to ask:
> 
> 1) Will doing this create any unintended side effects? I am not 
> entirely familiar with all the ways Root uses its dictionary, so I am 
> unsure of this.
> 2) If not, could this be added to the Root distribution?
> 
> The only real change needed (as far as I can tell) is to write a 
> ClassDefDoc macro as a stripped-down ClassDef, which I've reproduced 
> here:
> 
> #define ClassDefDoc(name,id) \
> private: \
>   static TClass *fgIsA; \
> public: \
>    static const char *DeclFileName() { return __FILE__; } \
>    static int DeclFileLine() { return __LINE__; } \
>    static const char *ImplFileName(); \
>    static int ImplFileLine(); \
>    static Version_t Class_Version() { return id; } \
>    static TClass *Class(); \
>    static void Dictionary();
> 
> I've tried using this macro in a non-streamed class of mine, and as far 
> as I could tell everything worked correctly; the class was correctly 
> documented in the output.
> 
> George Heintzelman
> gah@bnl.gov
> 
> 

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7677910



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:19 MET