2015-06-12 84 views
0

我遇到了doxygen問題。我正在記錄一段代碼,但生成的HTML輸出很奇怪。Doxygen C++嵌套結構錯誤

這是代碼...

/*! 
    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只看到在結構內使用...部分,但是我得到的是CR和DR結構很好,但是IDR和INIT是作爲公共屬性呈現的。 這是生成的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&lt;rw_t, 0X40023004, 0, 8&gt;</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&lt;rw_t, 0X4002300C, 0, 32&gt;</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二進制文件。

回答

0

解決! 這是一個壞定義結構