Thread: [Doxygen-users] problem with class hierarchies with templates
Brought to you by:
dimitri
From: Kris T. <kri...@cs...> - 2001-06-13 22:15:48
|
Hi, this is essentially a repost of a half-year old question, prompted by the following in the Changelog of version 1.2.8.1 --------------------- The dot generated inheritance and collaboration graphs for classes should now show the proper template instantation for the derived/used classes. For instance it should show that class S uses class V (indirectly) in the following example: class V {}; template<class T> class U1 { T *m_t; }; template<class T> class U2 { U1<T> *m_t; }; template<class T> class B1 { U2<T> *m_t; }; template<class T> class B2 : public B1<T> {}; class S : public B2<V> {}; --------------------- So, I went and tried this new version on my code. However, the Class Hierarchy (as documented in hierarchy.html) is still wrong. The simplest example of my problem is the following hierarchy //! V class V {}; //! K template <class T> class K : public T {}; //! KV class KV : public K<V> {}; In the Class Hierarchy, it is not recognised that the hierarchy is KV : K<V> : V. (It just mentions KV: K) Dimitri mentioned at the time that handling the above example wouldn't be too difficult, but he wasn't sure about the most general case. I'm sort of thinking that a fix for the simple cases would make already a lot of people happy... Any developments? (This problem really screws up the documentation of our project). Just doing what the Changelog tells me: --------------------- Please report any example of class hierarchies that are not shown properly. --------------------- All the best, Kris Thielemans PS: please reply to me personally as well, as I'm not on the mailing list anymore. |
From: Kris T. <kri...@ic...> - 2001-06-14 09:50:02
Attachments:
p.dox
|
Hi, further on this problem. I've enabled the dot graphs now. And I am surprised with the result. First the hierarchy again: > The simplest > example of my problem is the following hierarchy > //! V > class V {}; > //! K > template <class T> class K : public T {}; > //! KV > class KV : public K<V> {}; > what is the result? DOT ENABLED ----------- - In the Class Hierarchy (hierarchy.html), it is not recognised that the hierarchy is KV : K<V>: V. (It just mentions KV: K). This is also true for the graphical hierarchy. - in the Inheritance diagram of K, I get confusingly KV : K : T (I'd prefer KV : K<T> : T and some indication that T is a template parameter) - in the Inheritance diagram of KV, I get CORRECTLY KV : K<V> : V DOT DISABLED ----------- - The Class Hierarchy (hierarchy.html) is the same. - in the Inheritance diagram of K, I get now KV : K - in the Inheritance diagram of KV, I get now KV : K<V> It's strange that the inheritances are different when dot is dis/enabled. I hope that it's easy to fix this, as at least one diagram was correct... Attached is my doxygen input file I used. All the best, Kris Thielemans PS: I'm on the mailing list again |
From: Kris T. <kri...@ic...> - 2001-06-18 11:16:52
|
Hi, although nobody seems to be interested in my problem, I'm plodding on... Last time, I told you that the DOT generated inheritance graphs are ok for the example I tried. Now I have a case where they aren't. It happens when a default template parameter is used. The hierarchy ------------- //! A template <typename Base> class AddParser : public Base {}; //! bla template < typename Base, typename Parent = AddParser<Base> > class Intermediate : public Parent {}; //! bla class myBase {}; //! This will be shown as derived from Base class Leaf : public Intermediate< myBase > {}; //! This will be shown CORRECTLY as derived from myBase class Leaf2 : public Intermediate< myBase,AddParser<myBase> > {}; Inheritance as shown in the DOT enabled graphs: ------------------------------------------------- myBase : WRONG: is shown as having NO derived classes AddParser : Base PARTIALLY CORRECT: - the graph does not show that Base is a template parameter (that's a refinement) - It does not show Intermediate<> as derived class (but one can argue this is ok I guess) Intermediate : AddParser<Base> : Base and 'below' Intermediate, there are Leaf and Leaf2 CORRECT: although Intermediate does show any template arguments, so maybe it is confusing to see that Leaf and Leaf2 are derived classes, but it is also helpful Leaf:Intermediate<myBase>: AddParser<Base> : Base WRONG: it is not correctly inferred that Leaf derives from myBase, i.e. the template parameter Base is not determined correctly Leaf2:Intermediate<myBase>: AddParser<myBase> : myBase CORRECT Note that the inheritance diagram of myBase is a disappointment... I now noticed that in my previous example (see below) also class V is shown as having no derived classes... Is anyone interested in this at all except me? All the best, Kris > further on this problem. I've enabled the dot graphs now. And I > am surprised > with the result. First the hierarchy again: > > > The simplest > > example of my problem is the following hierarchy > > //! V > > class V {}; > > //! K > > template <class T> class K : public T {}; > > //! KV > > class KV : public K<V> {}; > > > > what is the result? > > DOT ENABLED > ----------- > - In the Class Hierarchy (hierarchy.html), it is not recognised that the > hierarchy > is KV : K<V>: V. (It just mentions KV: K). This is also true for the > graphical hierarchy. > > - in the Inheritance diagram of K, I get confusingly > KV : K : T > (I'd prefer KV : K<T> : T and some indication that T is a template > parameter) > > - in the Inheritance diagram of KV, I get CORRECTLY > KV : K<V> : V > > > DOT DISABLED > ----------- > - The Class Hierarchy (hierarchy.html) is the same. > > - in the Inheritance diagram of K, I get now > KV : K > > - in the Inheritance diagram of KV, I get now > KV : K<V> > > > It's strange that the inheritances are different when dot is > dis/enabled. I > hope that it's easy to fix this, as at least one diagram was correct... > > > Attached is my doxygen input file I used. > > > All the best, > > > Kris Thielemans > > PS: I'm on the mailing list again > > |
From: Dimitri v. H. <di...@st...> - 2001-06-18 20:22:23
|
On Mon, Jun 18, 2001 at 12:15:12PM +0100, Kris Thielemans wrote: > Hi, > > although nobody seems to be interested in my problem, I'm plodding on... I am interested, but as Christoph said, also very busy with other things. I have tried to improve the way doxygen handles templates just for dot generated inheritance and collaboration graphs. As a result the other graphs and hierarchies will not be different from before (and thus rather broken for templates). I plan to improve this later on (some help might speed things up!). > Last time, I told you that the DOT generated inheritance graphs are ok for > the example I tried. Now I have a case where they aren't. It happens when a > default template parameter is used. I'll look at your example and try to fix doxygen. Regards, Dimitri |
From: Kris T. <kri...@ic...> - 2001-06-14 10:19:40
|
Hi, I made a latex mistake in one of the formulas between \f[ and \f] (I used \elem which is not defined in latex/tex). The result was that doxygen hang. Aborting it (with Ctrl-C) kept latex running in the background. I had to kill that by hand. (I guess this was lucky, otherwise I wouldn't have known it was latex which was given me the problem). When running latex _formulas.tex by hand, latex stopped with its familiar error, and waited for input (I had to type x to get out), so I guess that is what was happening as well. I guess the latex process should be run such that it never prompts the user for input. This can be done by inserting the \batchmode command at the start of the latex file. I'm using doxygen 1.2.8.1 on NT. All the best, Kris Thielemans Imaging Research Solutions Ltd Cyclotron Building Hammersmith Hospital Du Cane Road London W12 ONN, United Kingdom Phone on : +44 (020)8383 3731 FAX on : +44 (020)8383 2029 web site address: http://www.irsl.org/~kris |
From: Luigi B. <lui...@ri...> - 2001-06-14 13:32:08
|
At 11:18 AM 6/14/01 +0100, Kris Thielemans wrote: >I guess the latex process should be run such that it never prompts the user >for input. This can be done by inserting the \batchmode command at the start >of the latex file. Kris, in the configuration file there's a LATEX_BATCHMODE tag that you can set to YES to this effect. Bye, Luigi |
From: Kris T. <kri...@ic...> - 2001-06-14 14:09:12
|
Thanks Luigi! > in the configuration file there's a LATEX_BATCHMODE tag that you > can set to YES to this effect. > I guess I'm arguing then that this should be the default setting, or maybe that this keyword only applies for generating latex doc, but not for the formulas. (Somehow, you'd want to warn the user though if there was a problem with latexing _formulas.tex). Kris |
From: Kris T. <kri...@cs...> - 2001-08-29 12:36:56
|
Hi, this is just to report experiences with templated class hierarchies with the latest doxygen. Sorry to keep banging on about this, but my class hierarchies are becoming ever more complicated and doxygen doesn't seem to keep up :-) First of all, when HAVE_DOT=YES, the inheritance diagrams seem to be much better now. Great ! The class hierarchies page is still incomplete. This might be by design though (see one of my previous emails on the difficulty in starting from base-level with templated hiearchies). Unfortunately, it looks like the non-dot inheritance diagrams reflect the situation of the 'class hierarchies page', instead of the dot-generated hierarchies. I don't see any particular reason for this, but as I have dot now, I'll live with it (I would put it in the doxygen doc somewhere though Dimitri). First, an illustration of 'incompleteness' of the class hierarchy: //! Base class Base {}; //! B template <class A> class B {}; //! B2 class B2 : public B<Base> {}; The class hierarchy (and non-dot inheritance graph) does not show that B2 is derived from B. Unfortunately, even the dot-generated inheritance diagrams can have problems. I spotted the following 2 remaining problems: problem 1: ---------- doxygen can get confused when the name of the template parameter is the same as the name of a class. Example: //! Base class Base {}; //! E template <class BASE> class E: public BASE{}; //! F class F : public E<Base> {}; //! EE template <class Base> class EE: public Base{}; //! FF class FF : public EE<Base> {}; As far as C++ goes, E,F and EE,FF are exactly the same. Doxygen's output differs in 3 ways though: - in the class hierarchies page, FF is show as derived from EE<Base> (but not from Base), while F is not shown to be derived from E<Base>. - in F's inheritance diagram, there is an orange arrow splitting off from E<Base> to E<BASE>. This isn't there in FF's diagram - in Base's inheritance diagram, E<Base>,F appear, but EE<Base>,FF not. problem 2: ---------- a problem with default template parameters Example: //! Base class Base {}; //! E template <class BASE> class E: public BASE{}; //! Base2 class Base2{}; //! WithDefault template <class X,class A=E<X> > class WithDefault : public A {}; //!UseDefault class UseDefault:public WithDefault<Base2> {}; //!NoDefault class NoDefault:public WithDefault<Base2,E<Base> > {}; As far as C++ goes, UseDefault and NoDefault are again the same. However, doyxgen infers only for NoDefault the correct hierarchy. For UseDefault, the dot graph shows it's derived from E<X> (which is derived from X). That is, it failed to fill in the X template parameter. Hopefully these 2 are not too difficult to fix... Many thanks Dimitri for all your work! Kris |
From: Jeff G. <je...@cr...> - 2001-09-02 18:08:07
|
For the last 24 hours I have been trying to download a binary update from the download page, but the ftp server appears to be down. Anyone else having trouble? Jeff |
From: Roberto B. <ba...@cs...> - 2001-09-02 21:41:14
|
Jeff Garland wrote: > > For the last 24 hours I have been trying to download a binary update from the > download page, but the ftp server appears to be down. Anyone else having > trouble? Same problem: ftp.stack.nl refuses my connection attempts. All the best, Roberto -- Roberto Bagnara Computer Science Group Department of Mathematics, University of Parma, Italy http://www.cs.unipr.it/~bagnara/ mailto:ba...@cs... |
From: Dimitri v. H. <di...@st...> - 2001-09-03 07:57:10
|
On Sun, Sep 02, 2001 at 11:41:00PM +0200, Roberto Bagnara wrote: > Jeff Garland wrote: > > > > For the last 24 hours I have been trying to download a binary update from the > > download page, but the ftp server appears to be down. Anyone else having > > trouble? > > Same problem: ftp.stack.nl refuses my connection attempts. > All the best, This problem should be solved now. Regards, Dimitri |
From: Dimitri v. H. <di...@st...> - 2001-09-03 17:12:47
|
On Mon, Sep 03, 2001 at 09:57:04AM +0200, Dimitri van Heesch wrote: > On Sun, Sep 02, 2001 at 11:41:00PM +0200, Roberto Bagnara wrote: > > Jeff Garland wrote: > > > > > > For the last 24 hours I have been trying to download a binary update from the > > > download page, but the ftp server appears to be down. Anyone else having > > > trouble? > > > > Same problem: ftp.stack.nl refuses my connection attempts. > > All the best, > > This problem should be solved now. For those who still have problems downloading the files, I've now mirrored them at http://doxygen.sourceforge.net/dl/ Regards, Dimitri |
From: Jeff G. <je...@cr...> - 2001-09-03 18:52:52
|
It's working fine for me now. Thanks, Jeff |