2
votes

Using Doxygen 1.7.4

Sometimes I'll have a block of public member functions that belong in a member group and that I feel are self documenting (e.g. getters/setters), so I don't want to write Doxygen syntax for each one. However, I may need to add something like a \note to one or two of them. Also, I do still want the function declarations to show up in the class's member list in the final documentation. Therefore, using \cond, \endcond won't work. I've noticed that if all parent elements are documented and Doxygen encounters an undocumented function in a member group, it will repeat the first documentation it encountered in that group, even if that documentation was for a function of a different name, as such:

/** @name Group1
 *  @{
*/
void setA( int i );
int  getA( void );

/// @note This note unexpectedly repeated for all functions in this group
void setB( int i );

int  getB( void );
void setC( int i );
int  getC( void );
//@}

To anybody reading the code and documentation, it should be obvious that the note should only apply to setB().

This particular problem goes away if I remove the surrounding member group. However, that defeats the documentation purpose that these functions somehow belong together, and Doxygen then complains (warns) that the functions aren't documented. I've tried adding empty special comment blocks and empty \brief and \note commands, all to no avail.

I also encounter this phenomenon when documenting overloaded functions in a member group. If my overloaded function uses a different number of parameters and different parameter names, I'll document that function separately. However, sometimes two functions will only differ by the parameter type. In this case, my workaround has been to use the \overload command. However, I'd prefer to not have to do this, and this workaround does not apply (semantically) for functions of a different name.

So, is there any workaround to this repetition problem?

1

1 Answers

4
votes

Yes. Doxygen provides the DISTRIBUTE_GROUP_DOC option in the Doxyfile. It is set to YES by default, but changing it to NO solves this problem.