Hi, One of the reason why I did not like the idea of printing a warning if a non-streamable object was not also marked with //! is that it does not match well with the case where you need to generate the I/O for a library you can not instruments. For example if you have a 3rd party library like: class TotallyUnstreamable {....}; class ImportantClass { private: TotallyUnstreamable *cachedObject; }; With the current implementation, you can generate the dictionary and save the 'ImportantClass' without any warning. (By compiling an extra file containing: ClassVersion(TotallyUnstreamble,0); If we were to issue a warning in the case where the comment //! is not there, this warning would be irremovable (well .... we would have to introduce yet another API to allow for its removal). However, it is not clear which is more annoying: - no warning when an object without //! is not saved (could be a surprise) - irremovable warning in the (rare?) case described above. Cheers, Philippe. -----Original Message----- From: Axel Naumann [mailto:axel@fnal.gov] Sent: Friday, October 17, 2003 5:20 PM To: cstrato@aon.at; Philippe Canal Cc: roottalk@pcroot.cern.ch Subject: RE: [ROOT] cannot create object of class TIter Hi, I believe this is a great idea by Philippe. It is still general: a member is skipped if it doesn't have a streamer (is that right, Philippe, did I interpret that correctly?). So there's no real change if you stick to the old rules, it just simplifies life a bit: instead of root just failing it will do the best job it can storing an object. But I think a warning should be issued if there is no //! to make sure the author of the class knows what's happening. Maybe also a hint in the class documentation would be helpful, stating whether it's streamable or not. I'll add the latter over the weekend, if people (rootdev? you?) think it's helpful. Axel. > -----Original Message----- > From: owner-roottalk@pcroot.cern.ch > [mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of cstrato > Sent: Friday, October 17, 2003 4:25 PM > To: Philippe Canal > Cc: roottalk@pcroot.cern.ch > Subject: Re: [ROOT] cannot create object of class TIter > > > Dear Philippe > > Although this may be helpful for root programers, I am not sure if > this is a good idea for the following reason: > > Until now there is a clear rule, that you have to use //! if you want to > prevent that an object is saved. People who are reading the header > files can see immediately, which objects will not be saved. Now you > are introducing exceptions, which make the code less readable. > > In my opinion it would be better to list all classes that are not savable, > in the root manual at the page where //! is explained. > > However, please regard this as my personal opinion. > > Best regards > Christian > _._._._._._._._._._._._._._._._ > C.h.i.s.t.i.a.n S.t.r.a.t.o.w.a > V.i.e.n.n.a A.u.s.t.r.i.a > _._._._._._._._._._._._._._._._ > > > > Philippe Canal wrote: > > >Hi Ondrej, > > > >We updated the ROOT code in CVS so that you original code would work > >properly. I.e. it would __silently__ not save your TIter object. To > >__know__ that the TIter object are not saveable you have to look up the > >class definition/documentation and notice the statement: > > ClassDef(TIter,0); > >A few other classes in the ROOT code are not saveable. From now > on you will > >be able to have data member to those and the system will > automatically mark > >them as transient. > > > >Cheers, > >Philippe. > > > > > > > > > > >
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:16 MET