Questioneer
Questioneer

Reputation: 793

How should I classify a typedef with Doxygen?

I have typedef structs in my C++ code. As of right now they are listed as \var typedef. Is there a better way to do this? Below is example of what I have:

/*! \var typedef etc
 * \brief A type defined structure for etc 
 *
 * \param x type- Variable declaration for x
 * \param y type- Variable declaration for y
 */

I know I shouldn't even be saying param. What else is there to use?

Upvotes: 12

Views: 28412

Answers (2)

Thomas Matthews
Thomas Matthews

Reputation: 57698

According to the Doxygen documentation there is a \typedef command. The command behaves the same as the \var command.

Upvotes: 15

doxygen
doxygen

Reputation: 14869

If you put the comment block in front of the typedef you don't need to use any special command.

/** This is the documentation for the following typedef */
typedef MyClass MyTypedef;

If you prefer to put it after the typedef use the following:

typedef MyClass MyTypedef;
/**< This is the documentation for the preceding typedef */

Only when the comment block must be at a different location than the actual typedef, you need to use \typedef.

Upvotes: 32

Related Questions