如何在struct之外记录struct数据成员

时间:2016-04-09 14:11:16

标签: c documentation doxygen documentation-generation

当我用Doxygen记录函数时,我可以这样做:

class MyObject: public mainObject
{
}

MyObject* instance = new MyObject[nb_of_instances_in_array];

但是我有办法以这种方式记录结构成员:

/*!
 * @brief does something
 * @param a first parameter
 *
 * Longer description
 */
void foo(int a) { /* */ }

原因是,如果可能的话,我希望避免使用内联注释来记录我的struct成员。

1 个答案:

答案 0 :(得分:1)

/*!
 * @struct str_a
 * @brief my a struct
 * @details Longer description
 *
 * @var str_a::a
 *   @brief first struct member
 *   @details detailed first struct member
 * @var str_a::b
 *   @brief brf second struct member
 *   @details detailed second struct member
 *
 */
struct str_a
{
    int a;
    int b;
};