Re: [ROOT] static member variables

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Sun Dec 31 2000 - 01:43:05 MET


Hi Dave,

   static class members are not part of an object and thus not written with
the object. You could store them seperately by collecting these values
in a special "status" object or, if they make sense for each object, make
them normal data members.

Don't use the + in the LinkDef.h and you get the CINT (actually rootcint)
generated Streamers() back (the automatic ones do basically the same but
then on-the-fly).

Cheers, Fons.


On Fri, Dec 29, 2000 at 05:10:42PM -0800, Dave Casper wrote:
> 
> 	Hi,
> 
> How does Root handle static member variables in a persistent class?
> 
> Specifically, if I have a static member variable in a class which is written
> to a TTree, is that variable saved and later restored when I read the TTree?
> 
> With v2.25, I would have probably been able to understand something from the
> CINT-generated Streamer method, but with 3.00, it is less transparent.
> 
> Dave
> dcasper@uci.edu

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7677910



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:40 MET