Interface libRuby with SWIG -- accessing underlying object

Hi everyone,

after having compiled Root the traditional way it now has Ruby support, which is a great feature. Writing Root scripts in Ruby is a breeze!

However, motivated by this success I tried to also wrap a simple analysis class originally generated by Root using SWIG. Although I can use both Root Ruby objects and my SWIG-wrapped object at the same time, but interaction is a problem because internally the objects are represented differently. For example, the constructor of my class takes a TTree * as parameter:

Since SWIG does not know about TTrees it cannot convert a ruby TTree (or TChain) to a C++ TTree automatically.

My naive idea to solve this is to write a SWIG typemap that is called for this conversion and get the underlying TTree * from the libRuby object explicitely. Is there documentation on the libRuby interface where I can find out which function to call? Or is this approach flawed to begin with? Thanks in advance.



My apologies for the delayed answer, but in the middle of February I relocated from Athens to Crete, since I am taking a Master Course in Computer Science at the University of Crete. I am still in the establishment phase and I have not enough time to browse the forum in a per day basis.

Please, contact me via e-mail in order to discuss your approach in its technical depth. You can reach me via e-mail using the following addresses:

elathan at csd uoc gr (University of Crete)
elathan at ics forth gr (Institute of Computer Science/FoRTH)