Doxygen C++ 嵌套结构错误
Doxygen c++ nested struct error
我在使用 doxygen 时遇到问题。我记录了一段代码,但结果 HTML 输出很奇怪。
这是代码...
/*!
namespace for the LIB
*/
namespace STM32LIB{
/*!
namespace for storing the register declaration
*/
namespace reg{
/*!
\brief cyclic redundancy check calculation unit
*/
struct CRC{
/*!
\brief Data register
*/
struct DR{
using DR = reg_t<rw_t, 0X40023000, 0, 32>; /*!< Data register bits */
}
/*!
\brief Independent data register
*/
struct IDR{
using IDR = reg_t<rw_t, 0X40023004, 0, 8>; /*!< General-purpose 8-bit data register bits */
}
/*!
\brief Control register
*/
struct CR{
using RESET = reg_t<rw_t, 0X40023008, 0, 1>; /*!< reset bit */
using REV_IN = reg_t<rw_t, 0X40023008, 5, 2>; /*!< Reverse input data */
using REV_OUT = reg_t<rw_t, 0X40023008, 7, 1>; /*!< Reverse output data */
}
/*!
\brief Initial CRC value
*/
struct INIT{
using INIT = reg_t<rw_t, 0X4002300C, 0, 32>; /*!< Programmable initial CRC value */
}
}
}
}
预期的结果是在 类 上拥有所有 DR、IDR、CR、INIT,并且在结构内部时只看到 using ... 部分,但我得到的是CR 和 DR 结构很好,但是 IDR 和 INIT 显示为 Public 属性。
这是结果 XML,您可以看到 CR 声明为 <innerclass> STM32LIB::reg::CRC::CR<\innerclass>
,但 IDR 声明为 <memberdef kind="variable (...) >
和 <definition>struct STM32LIB::reg::CRC::DR STM32LIB::reg::CRC::IDR</definition>
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.9.1">
<compounddef id="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c" kind="struct" language="C++" prot="public">
<compoundname>STM32LIB::reg::CRC</compoundname>
<includes refid="_s_t_m32_f030_8hpp" local="no">STM32F030.hpp</includes>
<innerclass refid="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c_1_1_c_r" prot="public">STM32LIB::reg::CRC::CR</innerclass>
<innerclass refid="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c_1_1_d_r" prot="public">STM32LIB::reg::CRC::DR</innerclass>
<sectiondef kind="public-attrib">
<memberdef kind="variable" id="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c_1a9965690d4bc1b3e96d71eb3595afdc4b" prot="public" static="no" mutable="no">
<type>struct <ref refid="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c_1_1_d_r" kindref="compound">STM32LIB::reg::CRC::DR</ref></type>
<definition>struct STM32LIB::reg::CRC::DR STM32LIB::reg::CRC::IDR</definition>
<argsstring></argsstring>
<name>IDR</name>
<initializer>= reg_t<rw_t, 0X40023004, 0, 8></initializer>
<briefdescription>
<para>Independent data register. </para> </briefdescription>
<detaileddescription>
<para>General-purpose 8-bit data register bits </para> </detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="C:/Users/Joao/Desktop/teste/STM32F030.hpp" line="37" column="1"/>
</memberdef>
<memberdef kind="variable" id="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c_1aa470437e4897d93e41ef7053258cbf34" prot="public" static="no" mutable="no">
<type>struct <ref refid="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c_1_1_c_r" kindref="compound">STM32LIB::reg::CRC::CR</ref></type>
<definition>struct STM32LIB::reg::CRC::CR STM32LIB::reg::CRC::INIT</definition>
<argsstring></argsstring>
<name>INIT</name>
<initializer>= reg_t<rw_t, 0X4002300C, 0, 32></initializer>
<briefdescription>
<para>Initial <ref refid="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c" kindref="compound">CRC</ref> value. </para> </briefdescription>
<detaileddescription>
<para>Programmable initial <ref refid="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c" kindref="compound">CRC</ref> value </para> </detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="C:/Users/Joao/Desktop/teste/STM32F030.hpp" line="53" column="1"/>
</memberdef>
</sectiondef>
<briefdescription>
<para>cyclic redundancy check calculation unit </para> </briefdescription>
<detaileddescription>
</detaileddescription>
<collaborationgraph>
<node id="5">
<label>STM32LIB::reg::CRC::CR</label>
<link refid="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c_1_1_c_r"/>
</node>
<node id="3">
<label>STM32LIB::reg::CRC</label>
<link refid="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c"/>
<childnode refid="4" relation="usage">
<edgelabel>IDR</edgelabel>
</childnode>
<childnode refid="5" relation="usage">
<edgelabel>INIT</edgelabel>
</childnode>
</node>
<node id="4">
<label>STM32LIB::reg::CRC::DR</label>
<link refid="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c_1_1_d_r"/>
</node>
</collaborationgraph>
<location file="C:/Users/Joao/Desktop/teste/STM32F030.hpp" line="24" column="1" bodyfile="C:/Users/Joao/Desktop/teste/STM32F030.hpp" bodystart="24" bodyend="55"/>
<listofallmembers>
<member refid="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c_1a9965690d4bc1b3e96d71eb3595afdc4b" prot="public" virt="non-virtual"><scope>STM32LIB::reg::CRC</scope><name>IDR</name></member>
<member refid="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c_1aa470437e4897d93e41ef7053258cbf34" prot="public" virt="non-virtual"><scope>STM32LIB::reg::CRC</scope><name>INIT</name></member>
</listofallmembers>
</compounddef>
</doxygen>
我该怎么做才能解决这个问题?为什么会有不同的行为?
谢谢!
PS:我正在使用最后一个 (1.8.9.1) doxygen 二进制文件。
已解决!
这是一个错误定义的结构
我在使用 doxygen 时遇到问题。我记录了一段代码,但结果 HTML 输出很奇怪。
这是代码...
/*!
namespace for the LIB
*/
namespace STM32LIB{
/*!
namespace for storing the register declaration
*/
namespace reg{
/*!
\brief cyclic redundancy check calculation unit
*/
struct CRC{
/*!
\brief Data register
*/
struct DR{
using DR = reg_t<rw_t, 0X40023000, 0, 32>; /*!< Data register bits */
}
/*!
\brief Independent data register
*/
struct IDR{
using IDR = reg_t<rw_t, 0X40023004, 0, 8>; /*!< General-purpose 8-bit data register bits */
}
/*!
\brief Control register
*/
struct CR{
using RESET = reg_t<rw_t, 0X40023008, 0, 1>; /*!< reset bit */
using REV_IN = reg_t<rw_t, 0X40023008, 5, 2>; /*!< Reverse input data */
using REV_OUT = reg_t<rw_t, 0X40023008, 7, 1>; /*!< Reverse output data */
}
/*!
\brief Initial CRC value
*/
struct INIT{
using INIT = reg_t<rw_t, 0X4002300C, 0, 32>; /*!< Programmable initial CRC value */
}
}
}
}
预期的结果是在 类 上拥有所有 DR、IDR、CR、INIT,并且在结构内部时只看到 using ... 部分,但我得到的是CR 和 DR 结构很好,但是 IDR 和 INIT 显示为 Public 属性。
这是结果 XML,您可以看到 CR 声明为 <innerclass> STM32LIB::reg::CRC::CR<\innerclass>
,但 IDR 声明为 <memberdef kind="variable (...) >
和 <definition>struct STM32LIB::reg::CRC::DR STM32LIB::reg::CRC::IDR</definition>
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.9.1">
<compounddef id="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c" kind="struct" language="C++" prot="public">
<compoundname>STM32LIB::reg::CRC</compoundname>
<includes refid="_s_t_m32_f030_8hpp" local="no">STM32F030.hpp</includes>
<innerclass refid="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c_1_1_c_r" prot="public">STM32LIB::reg::CRC::CR</innerclass>
<innerclass refid="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c_1_1_d_r" prot="public">STM32LIB::reg::CRC::DR</innerclass>
<sectiondef kind="public-attrib">
<memberdef kind="variable" id="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c_1a9965690d4bc1b3e96d71eb3595afdc4b" prot="public" static="no" mutable="no">
<type>struct <ref refid="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c_1_1_d_r" kindref="compound">STM32LIB::reg::CRC::DR</ref></type>
<definition>struct STM32LIB::reg::CRC::DR STM32LIB::reg::CRC::IDR</definition>
<argsstring></argsstring>
<name>IDR</name>
<initializer>= reg_t<rw_t, 0X40023004, 0, 8></initializer>
<briefdescription>
<para>Independent data register. </para> </briefdescription>
<detaileddescription>
<para>General-purpose 8-bit data register bits </para> </detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="C:/Users/Joao/Desktop/teste/STM32F030.hpp" line="37" column="1"/>
</memberdef>
<memberdef kind="variable" id="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c_1aa470437e4897d93e41ef7053258cbf34" prot="public" static="no" mutable="no">
<type>struct <ref refid="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c_1_1_c_r" kindref="compound">STM32LIB::reg::CRC::CR</ref></type>
<definition>struct STM32LIB::reg::CRC::CR STM32LIB::reg::CRC::INIT</definition>
<argsstring></argsstring>
<name>INIT</name>
<initializer>= reg_t<rw_t, 0X4002300C, 0, 32></initializer>
<briefdescription>
<para>Initial <ref refid="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c" kindref="compound">CRC</ref> value. </para> </briefdescription>
<detaileddescription>
<para>Programmable initial <ref refid="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c" kindref="compound">CRC</ref> value </para> </detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="C:/Users/Joao/Desktop/teste/STM32F030.hpp" line="53" column="1"/>
</memberdef>
</sectiondef>
<briefdescription>
<para>cyclic redundancy check calculation unit </para> </briefdescription>
<detaileddescription>
</detaileddescription>
<collaborationgraph>
<node id="5">
<label>STM32LIB::reg::CRC::CR</label>
<link refid="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c_1_1_c_r"/>
</node>
<node id="3">
<label>STM32LIB::reg::CRC</label>
<link refid="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c"/>
<childnode refid="4" relation="usage">
<edgelabel>IDR</edgelabel>
</childnode>
<childnode refid="5" relation="usage">
<edgelabel>INIT</edgelabel>
</childnode>
</node>
<node id="4">
<label>STM32LIB::reg::CRC::DR</label>
<link refid="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c_1_1_d_r"/>
</node>
</collaborationgraph>
<location file="C:/Users/Joao/Desktop/teste/STM32F030.hpp" line="24" column="1" bodyfile="C:/Users/Joao/Desktop/teste/STM32F030.hpp" bodystart="24" bodyend="55"/>
<listofallmembers>
<member refid="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c_1a9965690d4bc1b3e96d71eb3595afdc4b" prot="public" virt="non-virtual"><scope>STM32LIB::reg::CRC</scope><name>IDR</name></member>
<member refid="struct_s_t_m32_l_i_b_1_1reg_1_1_c_r_c_1aa470437e4897d93e41ef7053258cbf34" prot="public" virt="non-virtual"><scope>STM32LIB::reg::CRC</scope><name>INIT</name></member>
</listofallmembers>
</compounddef>
</doxygen>
我该怎么做才能解决这个问题?为什么会有不同的行为?
谢谢!
PS:我正在使用最后一个 (1.8.9.1) doxygen 二进制文件。
已解决! 这是一个错误定义的结构