Re: [ROOT] Change in class version

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Oct 20 2003 - 13:56:29 MEST


Hi Thomas,

This will be OK for the automatic schema evolution algorithm.
The default constructor for your class is called. Your TArrayI
will be initialized to the default.
You can also write a custom Streamer (still using the automatic schema).
See examples, eg in TAxis::Streamer.

Rene Brun

On 
Mon, 20 
Oct 2003, Thomas Bretz wrote:

> Hi,
> 
> what happens, if I have two class versions
> 
> class MyClass : public TObject
> {
>      ClassDef(MyClass, 1)
> }
> 
> and
> 
> class MyClass : public TObject
> {
>      TArrayI fArray;
>      ClassDef(MyClass, 2)
> }
> 
> Now I'm writing objects of version 1 in my file and reading the file 
> using class version 2. Is the fArray data member untouched, freed, 
> cleared? I'm asking, because I use such an array as a lookup table (for 
> accelerating access to another array) I could make reading 'old' files 
> backward compatible, by searching the other array. But therfor I must 
> know whether it is an old file or not. Can I get the information by 
> checking fArray.GetSize()==0?
> 
> Thanks in advance,
> Thomas.
> 



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