Re: adding arrays of objects to a TMapFile

Rene Brun (Rene.Brun@cern.ch)
Wed, 10 Mar 1999 14:00:34 +0000


Stephen Markacs wrote:
>
> Is there a way to add an array of objects to a TMapFile? I can't use
> TObjArray or TClonesArray because they don't derive from TNamed. I tried
> to make my own object that derived from both TClonesArray and TNamed, but
> ran into problems because they both derive from TObject and the compiler
> complained the delete method was ambiguous because they both had one. I
> tried virtual inheritance to get around this, but it didn't work. Is
> there some straightforward way?
>
> S t e p h e n M a r k a c s
> stephen@phys.columbia.edu
> http://phys.columbia.edu/~stephen/

Hi Stephen,
You just have to create a small class derived from TNamed
class myClass : public TNamed {
TObjArray *fArray;

Rene Brun