Doxygen c++ nested struct error

448 views Asked by At

I'm having a problem with doxygen. I´m documenting a piece of code but the resulting HTML output is strange.

This is the code...

 /*!
     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 */
            }
        }
    }
    }

The expected result was to have all the DR, IDR, CR, INIT on the classes and only see the using ... part when inside the struct, but what i'm getting is that the CR and DR structures are fine, but the IDR and INIT are presented as Public Attributes. This is the resulting XML as you can see the CR is declared as <innerclass> STM32LIB::reg::CRC::CR<\innerclass> but the IDR is declared as <memberdef kind="variable (...) > with <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>

What can i do to resolve this? Why the different behavior?

Thanks!

PS: i'm using the last (1.8.9.1) doxygen binaries.

1

There are 1 answers

0
JoaoC On BEST ANSWER

Solved! It was a bad defined struct