[ROOT] Questions on using the Meta Classes

From: Pere Mato (Pere.Mato@cern.ch)
Date: Thu Jan 17 2002 - 18:26:44 MET


Hi All,

  I am trying to make an exercise of interfacing ROOT with Python using the
API provided by the ROOT Meta classes (TClass, TMethod, TDataMember, etc.)
and I have several questions:

- How to call a constructor with arguments. The method TClass::New() calls
only the default constructor. I naively tried to call the class constructor
method as a normal method using TObject::Execute(...) immediately after the
object has been created with TClass::New() but it does not seem to work.

- How to get the return value of a function/method call. The method
TObject::Execute(...) does not give you this possibility. Also the method
TMethodCall::Execute(...) allows only to return either a long, double or a
string but nothing else.

- How I can pass a "complex" data type as an argument to a method. In
particular, how I can give a TObject* as argument. The way I understand the
method TObject::Execute() works is by constructing a string with comma
separated argument values. In the case of being within the CINT interpreter
it seems that you can pass the name of a CINT variable pointing to your
complex data type. But if you are not in CINT, which is exactly my case I do
not see how I can do it.

  Thanks in advance for any hint or suggestion,

------------------------------------------------------------
Pere Mato  CERN, EP Division, CH 1211 Geneva 23, Switzerland
           e-mail: Pere.Mato@cern.ch    tel: +41 22 76 78696
           fax:  +41 22 76 79425        gsm: +41 79 20 10855



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:38 MET