[ROOT] Re: pointer variables and the default constructor

From: Volker Hejny (V.Hejny@fz-juelich.de)
Date: Thu Jan 24 2002 - 10:58:08 MET


Hi again,

maybe I should a little bit more specific. Consider

class A {
 [...]
 TClonesArray *fA  \\->
}

and 

A::A() {
 fA = new TClonesArray(...);
}

A::~A() {
 delete TClonesArray();
}

When I use SetAutoDelete(false), which is the default, I don't see
any difference with the use of an additional static member fsA.
When reading a tree and the contructor is only called once and
TClonesArray is reused in the same way as in static case.
The disadvantage of the static array is clearly that I cannot
use two objects of this type in parallel. 

>From reading the documentation 3.1c I got the impression that the
default c'tor (at least in the form 'new(address) Class()') is
always called for initialization before an object is read in.
However, this seems not to be the case.

Best regards,
Volker

-- 
Dr. Volker Hejny                Tel: 02461/616853                      ** 
Institut f. Kernphysik          Fax: 02461/613930                     **
---------------------------------------------------------------- **  ** ---  
Forschungszentrum Juelich GmbH, D-52425 Juelich                    **



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