Equivalent of Api.h in ROOT v6

In my code that uses ROOT, once started it asks for a string which is then used as
a C++ code line to be executed (as a dynamically loaded library, I guess).
To do this I used Api.h in ROOT v5.
Api.h does not exist anymore in ROOT v6.
Is there a way in ROOT v6 to do again my “string to code to execute” feature?
Is there in ROOT v6 some equivalent to Api.h ?

gInterpreter->Declare("some C++ source code");

gROOT->ProcessLine("some ROOT command");

@Axel @pcanal I do not use gROOT or gInterpreter. My code is compiled and uses ROOT library. Part of it (that does not work anymore because of the absence of Api.h) is attached below. It creates a new class VViewerSelector that will be used each time I want to add some code loaded dynamically.
VViewerSelectorCint.h (2.1 KB) VViewerSelectorCint.cc (6.5 KB) VViewerSelector.cc (4.7 KB) VViewerSelector.h (2.0 KB)


With ROOT 6 this can all go away. You simply #include the “interpreted” class’s source file and off you go. Please get rid of VViewerSelectorCint altogether, inheriting interpreted selectors from TSelector directly. Can you confirm that this does the trick?

Cheers, Axel.

Not sure to understand what you mean by including the interpreted class’s source file. Where should I put the #include and what is the “interpreted” class’s source file?
Do you have a simple example of how to do this and get rid of Api.h ?

I guess you would need to show your full application. That means how you really use these classes.

In ROOT 6, you could simply “parse” the source code of your class using e.g. something like (add “++” to get it compiled by ACLiC):
gROOT->ProcessLine(".L MyClass.cxx");
gInterpreter->Declare("#include \"MyClass.cxx\"");

Thanks for your help and sorry for the delay of my answer.
The full application can be retrieved from http://lappweb.in2p3.fr/virgo/dataDisplay
The main aim of the VViewerSelector class is to provide the possibility to convert a “Operation on Channels” string into a function available in a dynamically loaded library.
My knowedge of ROOT5 or ROOT6 is too poor to understand if Api.h is really needed in this context.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.