Re: Callable inerpreter

From: Onuchin Valeriy (onuchin@sirius.ihep.su)
Date: Tue Jul 27 1999 - 19:39:21 MEST


AASalnikov@lbl.gov wrote:

>   Hi ROOTers,
> 
>   I'm trying to use ROOT as a "callable" interpreter. Say, I have an
> object in the compiled program on which I want to run an interpreted
> code. Let's say I have following code:
> 
>   // --- test1.h - will be processed with |rootcint|
> 
>   class A {
>     public:
>       A(int) {}
>       // ....
>     private:
>       // ....
>   };
> 
>   // --- test2.cxx - this the interpreted code
> 
>   class B {
>     public:
>       B() {}
>       doSomething(const A*) {}
>   };
> 
> Now what I want is to create an object of class A in the compiled code
> and pass it to the B::doSomething(). I have something like this in the
> main():
> 

Hi Andy,
Can you look  at 
http://root.cern.ch/root/html/TMethodCall.html
hope it will help.

Suppose it could look like:

A *a = new A ;       
TMethodCall *m = new TMethodCall();
m->InitMethodWithPrototype(b->IsA(),"doSomething","const A*");
m->Execute(b,"a");
// or init parameters with SetParamPtrs(void* paramArr)

 Best  regards,         Valery



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:36 MET