请考虑以下示例。
/// \addtogroup api Foo Group
/// @{
/**
* This class is well-documented.
*/
struct ThreadContext {
/// Storage for the ThreadInvocation object that contains the function and
/// arguments for a new thread.
struct alignas(CACHE_LINE_SIZE) {
/// This data is glorious.
char data[CACHE_LINE_SIZE];
} threadInvocation;
};
/// @}
当我对此运行doxygen
时,我收到以下警告。
Doxygen/Main.h:13: warning: Member threadInvocation (variable) of class ThreadContext is not documented.
以Storage for the ...
开头的评论应该引用threadInvocation
对象,但是doxygen认为它引用的是匿名struct
。
如何告诉doxygen我希望文档引用threadInvocation
成员?
答案 0 :(得分:3)
在深入了解doxygen documentation之后,我发现doxygen实际上几乎可以在任何地方记录大多数代码。为了记录threadInvocation
并避免不记录匿名struct
的警告,我必须编写这样的代码。
/// \addtogroup api Foo Group
/// @{
/**
* This class is well-documented.
*/
struct ThreadContext {
/// \var threadInvocation
/// Storage for the ThreadInvocation object that contains the function and
/// arguments for a new thread.
/// \cond SuppressDoxygen
struct alignas(CACHE_LINE_SIZE) {
/// This data is glorious.
char data[CACHE_LINE_SIZE];
}
/// \endcond
threadInvocation;
};
/// @}