RE: TNamed() without a name

From: Fine, Valeri <fine_at_bnl.gov>
Date: Tue, 13 Apr 2010 15:44:45 -0400

> > I discussed with Fons, it's a pretty common issue. We could put the
> > random string generator into TString. Could you suggest a function?

As far as I know there is no common "TNamed-related" problem that can be resolved with the single silver bullet ("random string generator"). There are several separated issues. Each needs its own carefully crafted solution.

Which concrete class / issue are we discussing right now?

For example, for the histogram objects (subclasses of TH1) it is sufficient to invoke the static method:

           TH1::AddDirectory(false);

See: void TH1::Build() as well

Thank you,
Valeri  

> I'm not sure whether we need a random string, I can't think of an
> application where a unique string wouldn't be sufficient.
>
> I've attached a prototype of a TUniqueString class with a static
counter
> protected by a TMutex. To prevent collisions of strings originating
> from different ROOT instances, a TUUID is prepended.
>
> (The whole thing could be integrated into TString easily, but I'm not
> sure, whether it would a problem if TString depended on TMutex.)
>
> What do you think?
>
> Funnily, the implementation crashes CINT (ROOT 5.26/00b) when running
as
> a script, but works well when running compiled. (I haven't tested
> against the trunk.)
>
> Cheers!
>
> Thiemo
>
> --
> +-----------------------------------+--------------------------+
> | Dipl.-Phys. Thiemo Nagel | |
> | Technische Universitaet Muenchen | Room PH1 3276 |
> | Physik-Department E18 | |
> | James-Franck-Strasse | Phone +49 89 289-12379 |
> | D-85747 Garching | Fax +49 89 289-12570 |
> +-----------------------------------+--------------------------+
Received on Tue Apr 13 2010 - 21:44:51 CEST

This archive was generated by hypermail 2.2.0 : Wed Apr 14 2010 - 17:50:01 CEST