Sign in to follow this  

[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.

If you intended to correct an error in the post then please contact us.

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


Link to 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


Link to 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


Link to 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


Link to post
Share on other sites
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?

Share this post


Link to 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_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.

Share this post


Link to 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!

Share this post


Link to post
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.

If you intended to correct an error in the post then please contact us.

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

Sign in to follow this