如何让 Doxygen “链接”枚举定义?

发布于 2024-08-22 12:40:39 字数 1001 浏览 5 评论 0原文

我有以下代码:

/// \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.
};

一切似乎都工作正常(枚举最终在文件范围内,但我有一个 \file,所以它与描述一起出现,格式正确。

我想要的(并且没有发生)是我希望 Tick_Data_Row::m_cols 文档中对 Tick_Column_Type 的引用链接回该文档页面,Doxygen 通常似乎非常聪明地找出“啊哈,这是我知道的名称,我将热链接它”。 “,但在这种情况下它失败了。

如果我将枚举移到结构内部也没关系。

有任何线索吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

巡山小妖精 2024-08-29 12:40:39

来自文档(自动链接生成):需要从 更改

///< The data.  Indexed by Tick_Column_Type.

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

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.
清晨说晚安 2024-08-29 12:40:39

以下内容对我有用。这是我定义枚举的方式 -

/** @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  */
};

这是我引用它的方式 -

*   \return returns an #GE_RETURN_CODES value enum 

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 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文