Eric H.
Eric H.

Reputation: 2574

How do I get Doxygen to "link" to enum defintions?

I have the following code:

/// \file Doxygen_tests.h

/**
 *
 * \enum    Tick_Column_Type
 *
 * \brief   Values that represent Tick_Column_Type. 
**/

enum Tick_Column_Type {
    TC_OPEN,         ///< Opening price
    TC_HIGH,         ///< High price

    TC_MAX,          ///< Required as last enum marker.  
};

/**
 *
 * \struct  Tick_Data_Row
 *
 * \brief   Holder for one row or snapshot of tick data.
 *
**/

struct __declspec (dllexport) Tick_Data_Row {
    Tick_Data_Row ();                       ///< Constructor.  Sets all columns to NaN
    void        init ();                    ///< Helper function to reset everything to NaN
    double  m_cols[TC_MAX];                 ///< The data.  Indexed by Tick_Column_Type.
};

Everything seems to work fine (the enum ends up at file scope, but I have a \file, so it appears, along with the descriptions, correctly formatted.

What I want (and is not happening) is that I'd like the reference to Tick_Column_Type in the documentation for Tick_Data_Row::m_cols to link back to that document page. Doxygen usually seems to be quite smart at figuring out "aha, that's a name I know, I'll hot-link it", but it fails to do so in this case.

It does not matter if I move the enum inside the struct.

Any clues?

Upvotes: 10

Views: 20417

Answers (2)

eeerahul
eeerahul

Reputation: 1627

The following worked for me. Here is how I defined the enum -

/** @brief An enumeration
 *  The return values of all the exported functions of GameEngine.dll
 */
enum GE_RETURN_CODES
{
    GE_FUNCTION_WORKED_PROPERLY = 0,    /*!<        0   the function worked properly    */
    GE_ERROR                            /*!<        Other Error - These errors are displayed by the Helper DLL  */
};

And here is how I referred to it -

*   \return returns an #GE_RETURN_CODES value enum 

Upvotes: 1

Eric H.
Eric H.

Reputation: 2574

From the docs (Automatic Link Generation): One needs to change from

///< The data.  Indexed by Tick_Column_Type.

to

///< The data.  Indexed by ::Tick_Column_Type.

Upvotes: 13

Related Questions