RE: Template function in LinkDef.h

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Fri, 27 Jun 2008 21:06:29 -0500


Hi,

Please send me a complete running example and I will take a closer look.

Cheers,
Philippe.

-----Original Message-----
From: OKUMURA, Akira [mailto:oxon_at_ceres.phys.s.u-tokyo.ac.jp] Sent: Friday, June 27, 2008 8:59 PM
To: Philippe Canal
Cc: 'ROOT Talk'
Subject: Re: [ROOT] Template function in LinkDef.h

Hello Philippe,

I tryied 4 patterns.

1. w/ "const" & w/ "std::"
2. w/ "const" & w/o "std::"
3. w/o "const" & w/ "std::"
4. w/o "const" & w/o "std::"

But I got the same result in the all pattern. Any suggestion?

Regards,

OKUMURA, Akira oxon_at_ceres.phys.s.u-tokyo.ac.jp Department of Physics, The University of Tokyo 7-3-1 Hongo, Bunkyo-ku, Tokyo 113-0033
TEL/FAX +81 3-5841-4173/4059
Skype : okumura.akira

On 2008/06/27, at 18:26, Philippe Canal wrote:

> Hi,
>
> In the linkdef statement you might need to give the exact parameter
> type including the const-ness. So try:
>
> #pragma link C++ function THealAlmMapTools::Map2Alm(const THealPix&,
> THealAlm<Float_t>&,const std::vector<Double_t>&, Bool_t);
>
> if this does not work, try without the std::
>
> Cheers,
> Philippe.
>
> -----Original Message-----
> From: owner-roottalk_at_root.cern.ch [mailto:owner-
> roottalk_at_root.cern.ch] On
> Behalf Of OKUMURA, Akira
> Sent: Friday, June 27, 2008 6:05 PM
> To: ROOT Talk
> Subject: [ROOT] Template function in LinkDef.h
>
> Hello ROOTers,
>
> I get warnings when I create a dictionary for my library.
>
> $ rootcint -f src/RootHealPixDict.cxx -c -p include/THealAlm.h
> include/
> THealAlmMapTools.h include/THealFFT.h include/THealPix.h include/
> THealUtil.h include/LinkDef.h
> Warning: #pragma link, function
> Map2Alm(THealPix&,THealAlm<Float_t>&,std::vector<Double_t>&,Bool_t)
> not found include/LinkDef.h:56:
> Warning: #pragma link, function
> Map2Alm(THealPix&,THealAlm<Double_t>&,std::vector<Double_t>&,Bool_t)
> not found include/LinkDef.h:57:
>
> Because of this warnings, I cannot call THealAlmMapTools::Map2Alm from
> the root command line even though I succeeded in loading my library.
> These functions are written in THealAlmMapTools.h and .cxx. I do not
> understand why only Alm2Map works while Map2Alm doesn't.
>
> How should I modify my codes? I am using ROOT 5.20.00 on Mac OS X
> Leopard (Intel).
>
> === LinkDef.h ===
> #pragma link C++ namespace THealAlmMapTools;
> #pragma link C++ function
> THealAlmMapTools::Alm2Map(THealAlm<Float_t>&, THealPix&);
> #pragma link C++ function
> THealAlmMapTools::Alm2Map(THealAlm<Double_t>&, THealPix&);
> #pragma link C++ function THealAlmMapTools::Map2Alm(THealPix&,
> THealAlm<Float_t>&, std::vector<Double_t>&, Bool_t);
> #pragma link C++ function THealAlmMapTools::Map2Alm(THealPix&,
> THealAlm<Double_t>&, std::vector<Double_t>&, Bool_t);
>
> === THealAlmMapTools.h ===
>
> namespace THealAlmMapTools {
> template<typename T> void Alm2Map(const THealAlm<T>& alm, THealPix&
> map);
> template<typename T> void Map2Alm(const THealPix& map, THealAlm<T>&
> alm, const std::vector<Double_t>& weight, Bool_t add_alm);
> }
>
> === THealAlmMapTools.cxx ===
>
> namespace THealAlmMapTools {
>
> template<typename T> void Alm2Map(const THealAlm<T>& alm, THealPix&
> map)
> {
> (snip)
> }
> template<typename T> void Map2Alm(const THealPix& map, THealAlm<T>&
> alm, const std::vector<Double_t>& weight, Bool_t add_alm)
> {
> (snip)
> }
>
> template void Alm2Map(const THealAlm<Float_t>& alm, THealPix& map);
> template void Alm2Map(const THealAlm<Double_t>& alm, THealPix& map);
> template void Map2Alm(const THealPix& map, THealAlm<Float_t>& alm,
> const std::vector<Double_t>& weight, Bool_t add_alm);
> template void Map2Alm(const THealPix& map, THealAlm<Double_t>& alm,
> const std::vector<Double_t>& weight, Bool_t add_alm);
>
> }
> Regards,
>
> OKUMURA, Akira oxon_at_ceres.phys.s.u-tokyo.ac.jp
> Department of Physics, The University of Tokyo
> 7-3-1 Hongo, Bunkyo-ku, Tokyo 113-0033
> TEL/FAX +81 3-5841-4173/4059
> Skype : okumura.akira
>
>
Received on Sat Jun 28 2008 - 04:06:52 CEST

This archive was generated by hypermail 2.2.0 : Sat Jun 28 2008 - 05:50:08 CEST