RE: [Doxygen-users] problem with class hierarchies with templates
Brought to you by:
dimitri
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 > > |