简体   繁体   English

如何记录Doxygen中的重载函数?

[英]How to document overloaded functions in Doxygen?

I am getting a warning message when documenting overloaded functions. 在记录重载函数时,我收到警告消息。

Doxygen version 1.8.7 Doxygen版本1.8.7

I have an implementation class and a header class. 我有一个实现类和标头类。 The header class declares two virtual functions, the second of which overloads the first. 头文件类声明了两个虚函数,其中第二个重载了第一个。

ClassA.h ClassA.h

    virtual void doSomething(int i); 
    virtual void doSomething(int i,int j);`

The implementation class implements each virtual function, as follows 实现类实现每个虚函数,如下所示

ClassA.cpp ClassA.cpp

    void doSomething(int i) { 
    printf ("doSomething: %d", i); 
    }

    void doSomething(int i,int j) { 
    printf ("doSomething: %d", i); 
    printf ("doSomething: %d", j); 
    }

I need to document both doSomething functions in doxygen. 我需要在doxygen中记录两个doSomething函数。 How do I do it? 我该怎么做?

I have tried documenting the .h file as follows: 我已尝试记录.h文件,如下所示:

Attempt 1: 尝试1:

ClassA.h ClassA.h

    /*! 
    * \fn void doSomething(int i) 
    * do something with i 
    */ 
    virtual void doSomething(int i); `

    /*! 
    * \fn void doSomething(int i, int j) 
    * do something with i and j 
    */ 
    virtual void doSomething(int i,int j);

Attempt 2: 尝试2:

    /*! 
    * \fn void doSomething(int i) 
    * do something with i 
    */ 
    virtual void doSomething(int i); 

    /*! 
    * \overload void doSomething(int i, int j) 
    * do something with i and j 
    */ 
    virtual void doSomething(int i,int j);

I have also tried to document the .cpp file in the same way, with and without documenting the .h file. 我也尝试以相同的方式来记录.cpp文件,无论是否记录了.h文件。

However, whichever way I try, I always get the same warning message, which is: 但是,无论尝试哪种方式,我总是会收到相同的警告消息,即:

    ClassA.cpp: warning: no uniquely matching class member found for void doSomething(int i) 
    Possible candidates: 
    virtual void doSomething(int i) at line 123 of file ClassA.h 
    virtual void doSomething(int i, int j) at line 135 of file Class.h

    ClassA.cpp: warning: no uniquely matching class member found for void doSomething(int i,int j) 
    Possible candidates: 
    virtual void doSomething(int i) at line 123 of file ClassA.h 
    virtual void doSomething(int i, int j) at line 135 of file Class.h

Note: Ideally I would prefer to document only the .cpp file and not the .h file in order to resolve this problem. 注意:理想情况下,我希望只记录.cpp文件而不记录.h文件,以解决此问题。

您在Doxygen中有一个\\ overload函数,可以让您

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM