Dear rooters,
I recently wrote a C++ class that was not a priori dedicated to root.
This class is suppose to read from a stream and place the result in a STL vector.
Since this STL vector can be of any “simple” kind (int, float, …, string) I decided that the method of my class that will actually do this job will be a template.
Here a shorten version of the class definition (few more methods are in fact defined see below) :
[code]#include
#include
class ConfigReader{
public:
ConfigReader();
~ConfigReader();
template int Read(string, std::vector &) ;
};
[/code]
Now, I decided to use it within root (actually within a TTree class that is indirectly call from CINT via a macro). The compilation went fine and the creation of the *.so too (I believe I need a *.so… but this can be discussed later).
I load the generated libConfigReader.so – that contains the ConfigReader class – in CINT
gSystem->Load("libConfigReader.so");
Then I check with the auto-completion that ConfigReader is found : Ok.
root 0> ConfigReader::
~ConfigReader
ConfigReader
AddFile
FindAllToken
FindTokenInFile
Dump
PrintListofFiles
PrintListofToken
GetListofFiles
ConfigReader
operator=
Concerning the methods all are found except the one based on a template, including Read
I concluded that I may need to instantiate Read with the possible types. I found many discussions on this forum about instantiating a class with #pragma but nothing about methods. And I must admit that I am a little bit lost with all the #pragma stuff.
Is there a (if possibly simple !) solution to this problem ?
Thank you in advance
Best
Julien