[ROOT] how to embed dictionary to the tree for foreign classes?

From: Valentine Kouznetsov (vk@mail.lns.cornell.edu)
Date: Fri Nov 14 2003 - 22:08:26 MET


Thanks to Rene's help I'm able to embed my ROOT-less class into ROOT Tree
(the class without any knowledge of ROOT). But in order to read that tree and
do some stuff I need to load my dictionary into root.

My question now is how to embed this dictionary to the tree in order to allow 
loading my tree and accessing my class object without loading object's 
dictionary.

What I found that it's possible if I add ClassDef into my class, BUT
my class is ROOT-less and it will need to know where to get this definition.
I don't want to include any ROOT header file into my class definition, but
I would expect that can be done in the dictionary itself.

I'm attaching my class, macros, etc. to this Email.
Here the definitions:
MyClass is ROOT-less aware class
crt.C is a main program to create a root tree with this class
I compile dictionary/shared library using Makefile
and executable to create tree using
g++ -o create_tree -I$ROOTSYS/include crt.C -L$ROOTSYS/lib -lCore -lTree 
-lCint -lm -lstdc++ -ldl MyClass.o mydict.o

So, to be clear in order to have access to my tree with dictionary I need to 
load the macro
  gSystem->Load("libMy.so");
  TFile f("tree.root");
  TTree *T = (TTree*)f.Get("T");
  T->Print();

and I would like to avoid loading my libMy.so and want to embed my dictionary 
into tree itself and generate this tree with my dictionary.

Thank you,
Valentine.







This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:16 MET