[Doxygen] Documenting virtual functions?

Started by
5 comments, last by fyhuang 18 years, 7 months ago
Hello, I've been wondering about how to do this with Doxygen: let's say I have two classes as such:
class A
{
    /** Documentation for vFunction... */
    virtual void vFunction();
};

class B : public A
{
    void vFunction();
};
I know that in class A's documentation, vFunction() will be documented, but I don't think that class B's documentation will include documentation for vFunction without me manually copying the documentation block from class A. So my question is, is there a way to force Doxygen to document overloaded functions with, say the documentation of its 'parent' function. Thanks and cheers!
- fyhuang [ site ]
Advertisement
Hi, I also think that Doxygen won't do it for you automatically. I did a quick search through Doxygen pdf manual, and found nothing about such functionality.

In fact, it's kinda logical - virtual functions are meant to be overloaded, vFunction in B probably will do sth completely different (in implementation) than in A. And though it makes some sense in that interface documentation should be automatically added to overloaded virtual functions, I'm afraid that in current Doxygen version this can't be done. Maybe try sending feature request to author?

Btw, may I suggest to use Natural Docs - IMHO it's much better than Doxygen (which I was using for some time).
From the doxygen docs:

INHERIT_DOCS
If the INHERIT_DOCS tag is set to YES (the default) then an undocumented member inherits the documentation from any documented member that it re-implements.

I usually turn it off so I don't know if it does what you need.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
JohnBolton is right. I have INHERIT_DOCS on and it works nicely, unlike all the other stuff that keeps breaking with each doxygen update. Seriously, there is always some new behaviour, or changes in old behaviour that breaks my documentation. *grrrr* I wish NaturalDocs had full C++ support, I'd switch right away.

Actually a friend of mine recommended Synopsis a while ago and it looks pretty good. I should probably try it out properly. Anyone tried it?

[Edited by - rollo on August 30, 2005 2:00:48 PM]
Quote:Original post by Koshmaar
Hi, I also think that Doxygen won't do it for you automatically. I did a quick search through Doxygen pdf manual, and found nothing about such functionality.

In fact, it's kinda logical - virtual functions are meant to be overloaded, vFunction in B probably will do sth completely different (in implementation) than in A. And though it makes some sense in that interface documentation should be automatically added to overloaded virtual functions, I'm afraid that in current Doxygen version this can't be done. Maybe try sending feature request to author?

Btw, may I suggest to use Natural Docs - IMHO it's much better than Doxygen (which I was using for some time).


wow, that natural docs thing looks pretty damn awesome. I wonder how many other people use it?
Anything posted is personal opinion which does not in anyway reflect or represent my employer. Any code and opinion is expressed “as is” and used at your own risk – it does not constitute a legal relationship of any kind.
Quote:Original post by paulecoyote:

wow, that natural docs thing looks pretty damn awesome. I wonder how many other people use it?

At least me and those from here :-) And if you want more detailed statistics... there are some quite big numbers there :-)


Quote:Original post by JohnBolton:
NHERIT_DOCS
If the INHERIT_DOCS tag is set to YES (the default) then an undocumented member inherits the documentation from any documented member that it re-implements


Yup, you're right. For my exculpation, I have to say that I was searching in Doxygen pdf manual for word "virtual", and if such was found, looked at its immediate surroundings.
Hello,

Yes, I think INHERIT_DOCS solves my problem. Thanks to all!

BTW, I will check out Natural Docs and whatever else you care to throw at me :).

Cheers!
- fyhuang [ site ]

This topic is closed to new replies.

Advertisement