Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doxygen C++ - Not documenting virtual functions in a template class

I have a template class that has a bunch of pure virtual and implemented virtual functions. I then have children inherit from this class. I want to document the functions in the virtual parent class and have children inherit this documentation in Doxygen.

For example (I can't post the real source).

template <typename A>
class Parent {
   /** Documentation
    */
   virtual void pure() = 0;

   /** More Docs
    */
   virtual void notpure() {
      ...
   }
};

In a different file with all proper includes (at least for the compiler)

class Child: public Parent<int> {
   void pure() {
      ...
   }
};

I then want Doxygen to generate documentation for both classes with the same documentation for each function unless I re-document the overridden function.

I run Ubuntu 14.04 and use the repository Doxygen 1.8.6 in case it matters.

Thank you

like image 764
ignorance Avatar asked Nov 05 '14 15:11

ignorance


1 Answers

So, I will answer my own question. Sort of.

If anyone has this same problem, be sure to check for comment bugs. Doxygen handled my templates fine, but I did have a problem because I have the habit of putting /* code /**/ in my programs so I can quickly uncomment large blocks of code quickly while debugging. Doxygen does not like this!.

I had the error message

File ended in the middle of a comment block! Perhaps a missing \endcode?

It took me a while to wade through the warnings generated because I had several undocumented files. This was taken care of by using

EXTRACT_ALL = YES

In my config file. HERE is someone who has a similar problem as I was.

like image 177
ignorance Avatar answered Oct 27 '22 00:10

ignorance