Check the method TTable::EntryLoop from $ROOTSYS/table/src/TTable.cxx.
It does for the TTable objects the same thing you want for yours.
There are two options there with BYTECODE and without BYTECODE.
Hope this helps, Valeri
From: owner-roottalk_at_root.cern.ch on behalf of Borse, Ganesh
Sent: Tue 12/4/2007 11:36 PM
To: roottalk_at_root.cern.ch; 'cint_at_root.cern.ch'
Subject: [ROOT] Embedding CINT in C++ application
Hi,
Is it possible to embed ROOT CINT in C++ application & use it for doing dynamic expressions parsing, compilation and then multiple run time evaluations those expressions?
I can see the root/bin/cint has all its logic in root/lib/libCint.so, with ldd command.
E.g, I have the expressions as below:
((size < 1000) && (vol < (0.001 * ADV)) && (prod == "Stock") && strstr("ABCD,EFGH,HIJK,NEWONE,song,JUNK,DONE",ordClient))
The variables size, ADV, vol, etc. will be changing at runtime. So, I would like to create function which will take these variables as input arguments & return the result of evaluated expression.
Since, these expressions, the number & type of these variables is not at compilation time, I cannot create & compile these function at compiling my application.
Hence, I need to use some kind of interpreter which can take these expressions, etc as source code & compile them.
I tried to use Python & Perl interpreters for embedding them in C++ application. But they don't provide the required performance level.
Also, the syntax of the expressions is to be same that in these scripting languages. Hence, it is little tedious to use them.
May you please guide me, if I can use cint for this? What are the functions, APIs & include headers, etc. I need to use for this?
A sample program of the same thing which I am doing with Cpython API (embedding Python in C) is attached here.
Thanks and Regards,
Ganesh
<<testeval.cpp>>
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
This archive was generated by hypermail 2.2.0 : Wed Dec 05 2007 - 23:50:01 CET