# [Doxygen] Documenting virtual functions?

This topic is 4488 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 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 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 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 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 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 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!

##### Share on other sites

This topic is 4488 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628682
• Total Posts
2984198

• 13
• 12
• 9
• 10
• 10