Re: [ROOT] Auto Evolution

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Mar 20 2002 - 18:04:59 MET


Hi Thomas,

Thomas Bretz wrote:
> 
> Hi rooters,
> 
> how is the following case handled by the auto evolution scheme:
> 
> The old class version has a definition like:
> Int_t fMyVar[700];
> 
> and the new one has it with a different size...

It depends on the new size. If the new definition is,eg;
  Int_t fMyvar[2000];
no problems in reading the old versions. Only 700 elements will be set
in the new array. the elements 700->1999 will have the values defined
by the default constructor.
If you change to
  Int_t fMyvar[500]; 
it will not work. There are protections missing in the current code
for this case. I am hesitating to support this case. Supporting this case
will make inefficient the general case. In TStreamerInfo::ReadBuffer,
one should read the min(current size, old size) in the current class,
then read the other elements into some scratch space.
If you foresee this situation, you better use a dynamic arrray.

Rene Brun

> 
> What happens if a read with an old class definition from a new file and
> vice versa?
> 
> Best regards,
> Thomas.



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