I’m working to integrate the ROOT C/C++ interpreter in a programming language framework that allows the embedding of ROOT scripts.
I developed a shared library (in C++) that executes lines of code.
The execution works as expected by using the following lines of code:
Int_t exit_code = -1; gSystem->LoadAllLibraries(); gROOT->ProcessLine(code_str, &exit_code); gROOT->CloseFiles(); gROOT->EndOfProcessCleanups();
The code runs without errors also for UI elements, but they are not displayed.
I’ve 2 questions about this issue:
- How to handle a TApplication instance (Event loop) within a shared library? I guess a dedicated thread instance is required
I tried the following:
TApplication app("app", &argc_root, argv_root); (...execute the lines of code stated above...) app.Run();
- What considerations need to be taken to guarantee performance and speed when gROOT is executed within a shared library (Thread safe? static loading?)
Thank you very much
ROOT Version: 6.28/06