2013-05-29 18 views
9

La documentazione Doxygen dice che \ ingroup può essere utilizzato per aggiungere un soggetto a più gruppi:Doxygen: Come includere un elemento in più gruppi

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

Il problema è che ho provato e Doxygen aggiunge l'entitiy solo all'ultimo gruppo nella lista dei gruppi. Qualcosa di simile

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

aggiunge l'elemento al modulo A, ma non a B. Qualcuno sa perché, e come risolverlo?

L'ho provato con le versioni di Doxygen 1.7.6.1 e 1.8.1.2.

Grazie per il vostro aiuto.

EDIT: mi sono reso conto che doxygen emette un avviso che dice:

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

Mi sembra che questo sia in contraddizione con la documentazione.

RISPOSTA: Rispondo a me stesso. Stavo cercando di aggiungere funzioni a più gruppi, ma la documentazione dice "Si noti che le entità composte (come classi, file e spazi dei nomi) possono essere inserite in più gruppi, ma i membri (come variabili, funzioni, typedef ed enumerazioni) possono essere solo membro di un gruppo ".

risposta

7

Di solito (per gli articoli consentiti, diciamo un file) è sufficiente scrivere un gruppo con gruppo di più. Mi permetta di mostrare, per completezza, un modello che uso:

/** 
* \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/>>. 
* 
*/ 

Ora, dal Doxygen Documentation, specialmente la pagina collegata qui, si legge:

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 

La documentazione spiega anche il motivo:

(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). 

Quindi, in breve, purtroppo non è possibile aggiungere una funzione (o tutti i tipi di entità, come non è stato specificato, in questo caso) per moltiplicare i gruppi.

Spero che questo collegamento ti aiuti con più domande che potresti avere.

1

L'utilizzo di

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

aggiungerà la voce a gruppi A e B solo se sono definiti altrove. Se un gruppo non è definito, non verrà definito solo perché è utilizzato in un comando \ingroup.

Dovrebbe essere possibile ottenere gli elementi nel gruppo B utilizzando

/** \defgroup B 
* @{ 
* @} 
*/ 
/** \ingroup A B 
* ... 
*/ 
Problemi correlati