doxygen c ++虚拟函数和实现

时间:2018-08-03 07:47:20

标签: c++ documentation virtual doxygen

您如何评论doxygen c ++虚拟函数及其实现

是否存在从实现到“接口”的简单链接,还是建议您再次注释虚拟函数的每个实现中的每个参数?

   class a
{
 public:

  /**
   * Cyclic read of data from Stack to host
   * @param address pointer to address object
   * @param data data to be transmitted
   * @param size size of data in bytes
   * @return transmitted number of bytes
   */
  virtual UINT32 DoSomething(ADDRESS *address, UINT_8 *data,
                                UINT32 size) = 0;
}

class b : public class a
{
  /**
   * Implementation of interface a - how to document? write everything again, or link somehow?
   * @param address pointer to address object
   * @param data data to be transmitted
   * @param size size of data in bytes
   * @return transmitted number of bytes
   */
  virtual UINT32 DoSomething(ADDRESS *address, UINT_8 *data,
                                UINT32 size) = 0;
}

1 个答案:

答案 0 :(得分:0)

如我的评论所述

class b : public class a
{
 public:

  /**
   * Implementation of interface a - how to document? write everything again, or link somehow?
   *
   * \copydoc a::DoSomething
   */
  virtual UINT32 DoSomething(ADDRESS *address, UINT_8 *data,
                                UINT32 size) = 0;
};

或使用\snippetdoc

class a
{
 public:

  /*
   [snip_a]
   Cyclic read of data from Stack to host
   @param address pointer to address object
   @param data data to be transmitted
   @param size size of data in bytes
   @return transmitted number of bytes
   [snip_a]
   */
  /**
   * \snippetdoc this snip_a
   */
  virtual UINT32 DoSomething(ADDRESS *address, UINT_8 *data,
                                UINT32 size) = 0;
};

class b : public class a
{
 public:

  /**
   * Implementation of interface a - how to document? write everything again, or link somehow?
   *
   * \snippetdoc this snip_a
   */
  virtual UINT32 DoSomething(ADDRESS *address, UINT_8 *data,
                                UINT32 size) = 0;
};

注意:[snip_a]在常规注释栏中的位置!和缺少的星号(*