Re: [ROOT] TList Unique entry

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Wed Jun 04 2003 - 21:33:23 MEST


Hi Jean-Eric,

  this cannot be done automatically, you have to make some add method
that first looks if the object is already in the list (like
list->FindObject(newObj)) and only add the method if FindObject()
returns 0.

Cheers, Fons.


On Wed, 2003-06-04 at 16:05, Jean-Eric Campagne wrote:
> Hello,
> 
> If I make add twice  the same instance of an object in a TList, then at the 
> Delete phase of the TList there is a crash for known reason.
> How, I can ask the TList to keep Unique Instance of an Object?
> 
> Regards
> Jean-Eric Campagne
> 
> ...........................................................................
> .LAL - IN2P3 - CNRS
> .LAL - B.P 34 - 91898 Orsay Cedex - France
> .Piece 108
> .Tel +33 (0)1 64 46 84 29
> .Fax +33 (0)1 64 46 83 97
> ...........................................................................
-- 
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 7679480



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