RE: [ROOT] root(cint) and template

From: Brett Viren (bv@bnl.gov)
Date: Fri May 11 2001 - 19:48:15 MEST


Jacek M. Holeczek writes:
 > Something got shorted in my mind ... and I can't recall how to make my
 > nice "template <class _FLT> class Complex" visible in ROOT (from a shared
 > library). I don't want to inherit from TObject, nor to use ClassDefT(2) as
 > they both add private data members.
 > So, how should the LinkDef look like ?

I haven't been following this thread closely so I am not sure if I
have the correct idea of what you are trying to do, but for templated
classes you need to put a line in the LinkDef file for each templated
type you want to instantiate.  Then compile your code and generated
dictionary to a .so and link it in to a ROOT exec.  You will only be
able to instantiate templates which have been declared in the
LinkDef.h (at least this is how things worked last I tried).  

You can see an example here of a templated class which can go through
ROOT I/O:

http://minos.phy.bnl.gov/~bviren/minos/software/Registry/

The templated class is in RegistryItemXXX.{cxx,h}.  See LinkDef.h for
the necessary declarations.

-Brett.



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:45 MET