2013-05-29 30 views
9

doxygen的文檔中說,\內部團體可用於實體添加到多個組:Doxygen的:如何包括一個元素在多個組

\ingroup (<groupname> [<groupname> <groupname>]) 

的問題是,我嘗試過了,Doxygen的添加entitiy到組列表中的最後一個組。類似於

/** \ingroup A B 
* ... 
*/ 

將元素添加到模塊A,但不添加到B.有誰知道爲什麼,以及如何解決它?

我試過用Doxygen 1.7.6.1和1.8.1.2版。

感謝您的幫助。

編輯:我意識到,doxygen的輸出,上面寫着警告:

Member X found in multiple @ingroup groups! The member will be put in group B, and not in group A 

在我看來,這是矛盾與文檔。

答案:我自己回答。我正在嘗試向多個組添加函數,但文檔中提到「注意複合實體(如類,文件和命名空間)可以放入多個組中,但成員(如變量,函數,typedefs和枚舉)只能是一個組的成員「。

回答

7

您通常(對於允許的項目,讓我們說一個文件)只需要編寫一個具有多個組的組。讓我告訴,爲了完整性,模板我用:現在

/** 
* \file 
* \ingroup GrpTest GrpLicense 
* \brief Here your brief explanation 
* \details And you put here a more detailed explanation to the 
* contents of the file. 
* \version 1.0 
* \date 2014-09-27 
* \author Dr Beco 
* \par Webpage 
* <<http://www.program.pg/>> 
* \copyright (c) 2014 GNU GPL v3 
* \note This program is free software: you can redistribute it 
* and/or modify it under the terms of the 
* GNU General Public License as published by 
* the Free Software Foundation version 3 of the License. 
* This program is distributed in the hope that it will be useful, 
* but WITHOUT ANY WARRANTY; without even the implied warranty of 
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
* GNU General Public License for more details. 
* You should have received a copy of the GNU General Public License 
* along with this program. 
* If not, write to the Free Software Foundation, Inc., 
* 59 Temple Place - Suite 330, Boston, MA. 02111-1307, USA. 
* Or read it online at <<http://www.gnu.org/licenses/>>. 
* 
*/ 

,從Doxygen Documentation,特別是這裏的鏈接頁面,你看:

Note that compound entities (like classes, files and namespaces) 
can be put into multiple groups, 
but members (like variable, functions, typedefs and enums) 
can only be a member of one group 

的文件也解釋了原因:

(this restriction is in place to avoid ambiguous linking 
targets in case a member is not documented in the context 
of its class, namespace or file, but only visible as part of a group). 

因此,簡而言之,很遺憾,您不能爲多個組添加一個函數(或所有類型的實體,因爲您沒有指定)。

我希望這個鏈接可以幫助你解決更多的問題。

1

使用

/** \ingroup A B 
* ... 
*/ 

將項目添加到組A且僅當它們被別處定義B。如果一個組沒有定義,它將不會被定義,因爲它在\ingroup命令中使用。

您應該能夠通過使用

/** \defgroup B 
* @{ 
* @} 
*/ 
/** \ingroup A B 
* ... 
*/ 
獲得組 B項目
相關問題