Re: I/O of custom objects in CINT?

Nick van Eijndhoven (Nick@fys.ruu.nl)
Thu, 2 Oct 1997 09:44:57 +0200 (MET DST)


*** Robert Casties wrote :
>
> Hello!
>
> I've tried for some time now to create objects in CINT which can be put in
> TTrees, but it didn't work out. Is there some general limitation on doing
> that? Do strameable objects have to be compiled?
>
> I derived my objects from TObject, used ClassDef and ClassImp macros
> (copied from Rtypes.h because of the #include problem) and Streamer
> methods created by rootcint.
>
> If I load my files with ".L" I can use the classes and see the
> descriptions with ".class". But if I add a branch to a tree with:
> myTree->Branch("mybranch", "TmyClass", &gMyClass, 320000, 0);
> then it is not visible (branch name is empty) with TTree::Print and
> TTree::Write causes a segfault.
>
> The same works fine with ROOTs compiled classes.
>
> I can give more details if needed. (System used: 1.03/03 on Linux)
>
> Thanks
> Robert
>
>
Hi Robert,
Quite some time ago I encountered the same problem and the ROOT team
indeed told me that this is ONLY possible for compiled classes for the
moment. I was told by Valery that it has something to do with the fact
that CINT has to know some address table for your classes, which differ
for each compiler and each platform.
However, Rene told me that people (I assume Masa) are working on it.
It indeed would be nice to have all this functionality also for interactively
loaded macros, since it would make testing a lot more easy (now one has
to compile and link (or create shared lib) before one can try things out
where I/O is involved).

Cheers,
Nick.

*----------------------------------------------------------------------*
Dr. Nick van Eijndhoven Department of Subatomic Physics
email : nick@fys.ruu.nl Utrecht University / NIKHEF
tel. +31-30-2532331 (direct) P.O. Box 80.000
tel. +31-30-2531492 (secr.) NL-3508 TA Utrecht
fax. +31-30-2518689 The Netherlands
WWW : http://www.fys.ruu.nl/~nick Office : Ornstein lab. 172
----------------------------------------------------------------------
tel. +41-22-7679751 (direct) CERN PPE Division / ALICE exp.
tel. +41-22-7675857 (secr.) CH-1211 Geneva 23
fax. +41-22-7679480 Switzerland
CERN beep : 13+7294 Office : B 160 1-012
*----------------------------------------------------------------------*