RE: [ROOT] problem with IO of Object with different ROOT versions

From: Philippe Canal (pcanal@fnal.gov)
Date: Fri Jun 20 2003 - 21:33:46 MEST


Hi Benoit,

Actually you should not need to implement you own operator<<.
However there is a bug (I am tracking it down) that broke the default
operator<< for instrumented classes not inheriting from TObject.

Cheers,
Philippe.

-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Rene Brun
Sent: Friday, June 20, 2003 9:08 AM
To: Benoit Revenu
Cc: root talk
Subject: Re: [ROOT] problem with IO of Object with different ROOT
versions


Hi Benoit,

Classes not deriving from TObject (like your class Data) require
the implementation of an operator << in case you have members
of the type
  Data *Fadc;
like in your class Detector.

You have 3 options:

 - implement the operator << for Data
or
 - derive Data from TObject
or
 - simply declare
  Data *Fadc;  //->

Declaring the string "->" as first characters in the data member comment
field
tells Root that it can assume that the pointer Fadc is not null (your case).
In this case, there is no need for an operator

Rene Brun

Benoit Revenu wrote:
>
> Dear rooters,
>
> I'm trying to write some object using the TObject etc. functionalities.
> Everything works well with root 3-03-09 but it fails with 3-04-02 and
> 3-05-05 with exactly the same code.
>
> The files are given in attachment, the code is very simple (stupid test
> classes but producing the problem I have).
>
> I would like these progs to work in any root versions... What changes has
> been done in recent root releases so that it does not work anymore ?
>
>         Thanks for any advice
>
>         Benoit
>
>   ------------------------------------------------------------------------
--------
>            Name: io.h
>    io.h    Type: Plain Text (TEXT/PLAIN)
>        Encoding: BASE64
>
>             Name: io.cc
>    io.cc    Type: Plain Text (TEXT/PLAIN)
>         Encoding: BASE64
>
>                   Name: ioLinkDef.h
>    ioLinkDef.h    Type: Plain Text (TEXT/PLAIN)
>               Encoding: BASE64
>
>                    Name: requirements
>    requirements    Type: Plain Text (TEXT/PLAIN)
>                Encoding: BASE64



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