开发者

Doxygen ignoring inherited functions, when class inherits privately but the functions declared public again

Sorry for long winded title, this makes a lot more sense with an example.

Suppose we have a class A:

class A {
    public:
        void someFunction();
        void someOtherFunction();
};

And another class that privately inherits from A. However, we re-declare o开发者_如何学Gone of the inherited functions as public:

class B : private A {
    public:
        A::someFunction;
}

When this code is processed by Doxygen, it does not recognise the public declaration of someFunction in class B. Instead, it shows someFunction as a privately inherited function. This is incorrect.

Is anybody aware of how to fix this? Cheers


I can't comment so I'll post this as an answer.

When you do private inheritance in C++, it's a variant of composition or agregation. It's like a "Car - has an - Engine" relationship, so maybe Doxygen has a problem with this syntactic way of doing things. You could probably turn this around a bit to get a good public inheritance or a real composition.

If you want to know more about private and protected inheritance : http://www.parashift.com/c++-faq-lite/private-inheritance.html

Hope it helps !

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜