[Doxygen] Documenting virtual functions?

Recommended Posts

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!

Share this post

Share on other sites
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).

Share this post

Share on other sites
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.

Share this post

Share on other sites
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]

Share this post

Share on other sites
Quote:
 Original post by KoshmaarHi, 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?

Share this post

Share on other sites
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_DOCSIf 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.

Share this post

Share on other sites
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!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

• Partner Spotlight

• Forum Statistics

• Total Topics
627652
• Total Posts
2978424

• 10
• 12
• 22
• 13
• 33