RE: [Doxygen-users] problem with class hierarchies with templates
Brought to you by:
dimitri
From: Kris T. <kri...@ic...> - 2001-06-18 14:14:57
|
> Another problem is, of course, that class diagrams > (such as popularized > by OMT, Booch, UML, you name it) are inherently unable to > meaningfully deal with > parameterized classes, at least with C++'s implementation of this concept. > > I admit I don't have a clear view on this. However, I sort of think that for leaf-classes, it is perfectly possible to have a clear inheritance diagram (after all, if there isn't a clear inheritance tree, it won't compile...). Indeed, at the end of a hierarchy tree, all 'intermediate' templates have to be resolved (i.e. the only ones left are the template parameters of the class itself). The question really is what to do with 'intermediate' classes. One option would be to do the same as for a 'leaf' class, i.e. you make the inheritance tree only upto the current class, and do not show whatever is below it (so, your intermediate class IS a leaf class). It looks like the dot-generated hierarchies for leaves are already pretty close to this (my previous mail was a counter-example, but I'd hope it's not too difficult to take this into account as well). Another option is to do show whatever comes lower but only heuristically, i.e. without looking at template arguments at all. One could look at doxygen's current attempt in this way. As long as this is stated clearly, I could live with it. I guess the latter approach could be improved upon by some kind of postprocessing of the hierarchies: the hierarchy for any intermediate class could be found by merging the hierarchies of all leaf classes. This doesn't sound easy though. What about the 'class hierarchy' list ? It attempts to start at the 'root' of the hierarchy. This is difficult/impossible for exactly the same reasons as before. Again, I could live with it if the doc states it somewhere explicitly. I could imagine doxygen finding out it has troubles with the templates, so inserting a warning on top of the class hierarchy page. Summary: an inheritance diagram for anything upwards in the tree should be doable. For anything downwards, it's getting muddy. The dot-generated hierarchy seems pretty close, so maybe a few extra fixes make it usable enough. (Still beats me how the 'default',i.e. non-dot class hierarchy diagrams can be different from the other ones. It seems to say that there are 2 pieces of code to do the same thing in doxygen). 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 |