Reflex dictionary: problem with Boost-related typedef

Hello, I’m trying to obtain Reflex dictionary for a class which uses a boost::unordered_map; this makes rootcint go crazy, so my plan is to go with Reflex and then use Cintex. I have a problem with this typedef:

typedef boost::unordered_map<string, IDataObj*> DataMap;

IDataObj is a data object class defined by me (I can post its declaration if it is relevant). I then use the type DataMap inside another class DataService. All of IDataObj, typedef and DataService declarations are in the same header file DataService.h. I run genreflex on it:

$ genreflex /home/mori/analysis/CALET/AnalizerPrototype/include/services/DataService.h
--->> genreflex: INFO: Using gccxml from /usr/bin/gccxml
--->> genreflex: INFO: Parsing file /home/mori/analysis/CALET/AnalizerPrototype/include/services/DataService.h with GCC_XML OK
--->> genreflex: INFO: Generating Reflex Dictionary
class DataService
class IDataObj
class boost::unordered::unordered_map<std::basic_string<char>,IDataObj*,boost::hash<std::basic_string<char> >,std::equal_to<std::basic_string<char> >,std::allocator<std::pair<const std::basic_string<char>,IDataObj*> > >

And as far as I understand the DataService_rflx.cpp file is produced without errors. But when I try to compile it with gcc I many errors; the most important in my opinion is:

/home/mori/analysis/CALET/AnalizerPrototype/Debug/src/services/DataService_rflx.cpp:123:212: error: wrong number of template arguments (4, should be 5)

At line 123 of DataService_rflx.cpp there is:

::boost::unordered::detail::table_impl<boost::unordered::detail::map<std::allocator<std::pair<const std::basic_string<char>,IDataObj*> >,std::basic_string<char>,IDataObj*,boost::hash<std::basic_string<char> > > > table_;

It seems that the code generator doesn’t handle well the template arguments.
The most important thing is that if I remove the typedef declaration and replace DataMap with boost::unordered_map<string, IDataObj*> everywhere then everything works; I can compile without errors and load the DataService dictionary library using PyROOT and CIntex. This can be a solution for my problem which I can live with, but nevertheless this issue can be a blocker in some other cases. My system features gcc 4.7.1, gccxml 0.9.0 (compiled today from cvs) and genreflex from root 5.32.00.
Thanks in advance for the help. Sorry if I posted in the wrong section but there is not a Reflex section and since this is a dictionary-related question I thought that the CINT section would be the most appropriate…

[quote]It seems that the code generator doesn’t handle well the template arguments.[/quote]This is very plausible :frowning:. The code generator is being deprecated and we should have a replacement in the next few months (based on llvm/clang/cling). So unless there is no work around, we do not plan on updating genreflex.

Cheers,
Philippe.

Ok Philippe, thanks. I knew about cling and I was supposing that it would be based on Reflex too for its dictionaries but now I think I was wrong. I also suppose that the dictionaries it will use will work with PyROOT as well.

Hi,

Yes, PyROOT is being updated to no longer relying on CINT (nor Reflex).

Cheers,
Philippe.