Re: [ROOT] const correctness request for TKey and ROOT classes

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Wed Nov 15 2000 - 14:47:56 MET


Hi Alexander,

   exception support will only come when all compilers support it in
an efficient and portable way. For the time being that is not at all the
case. So this will have to wait still some years (I am afraid).
What is on our list is better template and STL support. Recent compilers
are getting better, although most are not yet good/complete enough.

There will be no ROOT-Qt integration BUT it will soon be possible to
use the two systems together, where to Qt GUI and eventloop can drive
ROOT.

Doxygen is nice, but I like the format of THtml better. Of course you
are free to use doxygen for your classes since it is a standalone tool.
We plan to package THtml also as standalone tool, like rootcint.


Cheers, Fons.



Alexander Zvyagin wrote:
> 
> Dear ROOT developers,
> 
> do you have plans to support C++ exception? What is about Qt-ROOT
> integration? What do you think about usage of standard tools for
> C++ classes documantation (like doxygen) instead of THtml?
> 
> With best wishes,
> Alexander Zvyagin.
> 
> On Tue, 14 Nov 2000, Rene Brun wrote:
> 
> >Hi Matt,
> >We agree with the principle to make root more "const correct".
> >This has already been mentionned a few times in this list (George H. in
> >particular).
> >However, as you say, this implies a non compatible interface.
> >We are currently discussing a major upgrade of the Root system (a version 3.0).
> >This new version will include an important upgrade of the Root I/O system with:
> >  - the introduction of an automatic schema evolution facility
> >  - extended support for more C++ constructs.
> >  - Full support for STL
> >  - self-describing file format
> >  - automatic regeneration of the class code from the dictionary in the file.
> >All these new features are currently implemented in our private development
> >version. Wew are now in a testing phase with large applications.
> >
> >We could take this opportunity to review the interface.
> >
> >Rene Brun
> >
> >Matthew D. Langston wrote:
> >>
> >> Hi ROOT Team,
> >>
> >> I continually run into a lot of situations where I have to use const_cast on
> >> pointers to objects of ROOT classes in order to get my code to compile.  May
> >> I request that all of the getters be changed to const member functions in
> >> the ROOT classes please where it makes sense?
> >>
> >> For a specific example of where this can easily bite a developer, I have
> >> some very old ROOT code that I was just hacking on that calls TKey::GetName
> >> (which is inherited from TNamed).  I needed to go back and change a small
> >> piece of this legacy code to get the cycle number of the TKey in addition to
> >> its name.  However, calling TKey::GetCycle() caused my C++ compiler to spew
> >> out pages and pages of const errors from the legacy code.
> >>
> >> The problem was that this legacy code is passed a "const TKey*" (to insure,
> >> for safety reasons, that it doesn't change the TKey).  However,
> >> TKey::GetCycle  (and most of the other getters in TKey) are non-const member
> >> functions.  The work around was that I had to violate const correctness for
> >> large pieces of my legacy code.
> >>
> >> I was about to go through all of the ROOT base classes that my legacy code
> >> depends on and change the getters to const member functions, and send you a
> >> patch of the differences.  However, I wanted to check with you first, as I
> >> didn't want to go to the trouble of making such sweeping changes if you
> >> wouldn't accept them for reasons that I might not currently appreciate.
> >>
> >> Would you mind commenting in this please?  Do you think my proposal of
> >> making ROOT more const correct is a good idea?  If so, would you prefer to
> >> do the changes instead of receiving a patch from me?
> >>
> >> I should point out that my proposed changes will constitute breaking the
> >> ROOT interfaces for all previous releases of ROOT, and would therefore break
> >> all user code for future releases ROOT.  However, I would argue that my
> >> proposed "const correct" changes would break code that should be broken, and
> >> would make ROOT, and all user code that depends on ROOT, more robust and
> >> stable.
> >>
> >> Thank you for considering these changes.
> >>
> >> Regards, Matt
> >>
> >> --
> >> Matthew D. Langston
> >> SLD, Stanford Linear Accelerator Center
> >> langston@SLAC.Stanford.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:37 MET