Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

doxygen comment multiple variables at once

If I have the following:

/**
 * @brief (x,y,z) points for block
 */
int x, y, z;

It will only generate that documentation for x, is it possible in doxygen to get it to comment all x, y and z with one comment?

EDIT Following the suggestions of envu I now have the following (based off http://www.doxygen.nl/manual/grouping.html#memgroup)

//@{
/** some documentation here */
int x, y, z;
//@}

or

//@{
/**
 * @brief some documentation here
 */
int x, y, z;
//@}

However both of these still only document x. Trying it with different forms I have yet to get the same documentation string to span multiple variables

like image 829
cjh Avatar asked Apr 25 '11 11:04

cjh


3 Answers

Been banging my head on this one for a while. Turns out you have to set DISTRIBUTE_GROUP_DOC = YES in the configuration.

like image 155
Hari Honor Avatar answered Oct 11 '22 13:10

Hari Honor


I would use member groups http://www.doxygen.nl/manual/grouping.html#memgroup for this. The syntax and output is a little bit different to what you want to achieve, but I think that shouldn't hurt.

like image 30
evnu Avatar answered Oct 11 '22 13:10

evnu


I realize this is an old question, but I've been having a similar problem and found a workaround that doesn't exactly solve the problem but might be an acceptable substitute in certain cases.

By putting a comment above the member group block and prefixing it with the \name decorator, you get a description that shows up above all of the variables in the member group in the attributes list of the Doxygen page. I believe this is intended to be a short description, but you can put arbitrarily long descriptions here if you wish.

This doesn't have the effect of putting the same comments in the detail field for each of the variables in the member group (the detail fields will be empty, or if you put a comment inside the member group block it will still only apply to the first variable), but it does have the effect of documenting a related group of variables together, which seems like what the original intent of the question was.

Example:

/*! \name This will be the description for the following group of variables
          It can be arbitrarily long, but the first line will show up in bold,
          and any subsequent lines will show up like a description under it
*/
//@{
int relatedVariable1;
int relatedVariable2;
char* relatedVariable3;
//@}
like image 42
tehbam Avatar answered Oct 11 '22 14:10

tehbam