RE: [ROOT] A couple of root dictionary questions

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Sep 25 2002 - 09:13:46 MEST


Hi,

If you look at the Event.h example, you will see the following members:
   char      *fEventName;    //run+event number in character format
   Int_t      fNvertex;
   Float_t   *fClosestDistance;   //[fNvertex]

The automatically generated Streamer will be able to stream fEventname
as well as fClosestDistance. The comment field [fNvertex] indicates
that another data member (must be an int) contains the effective length
of the array.
For this to work, you must specify the "+" in the #pragma statement
in the LinkDef.h file.
I take this opportunity to indicate once more that you should always use
the option "+" in the pragma if you want to take advantage of the
I/O facilities introduced in version 3, in particular the automatic
schema evolution.

Rene Brun


On Tue, 24 Sep 2002, Salkind, Lou wrote:

> Rene,
> 
> Sorry to be stupid here, but after rereading the things you suggested, I
> still don't know the answer to either of my questions.
> 
> For question 1), are you saying that if I want to stream a string stored in
> a class as an old C style char * pointer, I would have to write a specific
> streamer for that class that knew how to write out an object (presumably by
> doing a strlen(), streaming the count, and then streaming the bytes)?
> 
> For question 2), I am not sure how the ios references in the Dict.cxx file
> (it has code that does G__search_typename2("ios& (*)(ios&) ") ultimately get
> resolved.  Is there a file or library I need to include?  I am including all
> the libraries that are used in building make Event.
> 
> -----Original Message-----
> From: Rene Brun [mailto:brun@pcbrun.cern.ch] 
> Sent: Tuesday, September 24, 2002 10:39 AM
> To: Salkind, Lou
> Cc: 'roottalk@pcroot.cern.ch'
> Subject: Re: [ROOT] A couple of root dictionary questions
> 
> 
> Hi Lou,
> 
> Please read chapter about Streaming at page 201 of the Users Guide. Read
> section "Dynamic Arrays" See a concrete example at
> $ROOTSYS/test/Event.h,cxx, MainEvent.cxx. To build this example, run 
> gmake Event
> 
> You do not need to include <iostream.h> on Linux.
> Should be <iostream> by the way.
> 
> Rene Brun
> 
> On Tue, 24 Sep 2002, Salkind, Lou wrote:
> 
> > Dear Rooters,
> > 
> > I have created a LinkDef.h file for my application, but I am getting 
> > the following errors/warnings:
> > 
> > 1) When building the dictionary with rootcint (RedHat 7.3, gcc 2.96), 
> > all "char *" strings in my classes generate an error such as
> >        Error:  ** Datamember XXX::comment: no size indication!
> >        Error:  ** Datamember XXX::comment: pointer to fundamental type 
> > (need manual intervention) Is there a simple way to stream char * 
> > strings to a file?
> > 
> > 2) When I start up my application, I get the error
> >        Error: class,struct,union or type ios not defined  FILE: LINE:0
> >        *** Interpreter error recovered ***
> > I am including iostream.h from the root/cint/include directory in my 
> > rootcint command.  Is there any way to get the appropriate ios 
> > definitions included by rootcint?
> > 
> > Any help would be appreciated.
> > 
> 



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