RE:[ROOT] CINT: templated method skipped

From: Masaharu Goto (MXJ02154@nifty.ne.jp)
Date: Sun Jul 08 2001 - 23:39:20 MEST


Hello Axel,

Let me answer your question.

Cint dictionary does not include template itself. As you know
template is not a function. It is a template for series of
functions.  Unless you specify template argument, there is no
way to determine which function you want to use. This fact is
described in Cint documentation that "Cint can precompile 
instantiated template class/function, but can not precompile
template itself."  This is a C++ language limitation.
And it is most natural to skip this without warning because
this is only a template, not a real function.

In order to include the template function, you need to explicitly
instantiate it. Such instantiation can be done by #pragma link 
statement.

  #pragma link C++ functoin seed::AssignSeedData(seed::TSeedData<int>&
                                                 ,const TString&);

I need to tell you that this functionality was added recently. So,
there may be some problem. Please let me know if this does not work.


Finally,  Cint needs wrapper function in order to call a compiled
function.  In some operating system, it will be possible to do this
without a wrapper, but the solution will be platforme dependent.

Thank you
Masaharu Goto



>Hi,
>
>how can I convince CINT to add a method like
>
>       template <class T>
>               seed::TEventSample& AssignSeedData(seed::TSeedData<T>& sd, 
const TString&
>strSeed);
>
>to the list of methods of my class? Why is it skipping it without warning?
>The dictionary for this class is still build, everything works fine, CINT
>just simply skipps this method. (yesterday's cvs root.)
>
>Okay, in principle I know the answer: Because CINT needs specializations for
>the templates. But again, why doesn't CINT issue a warning here? And how can
>I work around that problem? Should I define a non-templated base class of
>the seed::TSeedData and hand a base class pointer to AssignSeedData? Or does
>handing over a pointer to the templated class help (e.g. due to some
>automatic casting to void* by the dictionary)?
>
>Last resort: Is there a way to tell CINT to build the dictionary for a
>method without adding the wrapper for this method?
>
>Regards, Axel.
>
>----- End forwarded message -----
>
>-- 
>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 01 2002 - 17:50:51 MET