doxygen_manual-1.8.1 (1035109), страница 13
Текст из файла (страница 13)
Thetitle of the group is optional for this command, so you can use/** \addtogroup <label>* @{*/.../** @}*/to add additional members to a group that is defined in more detail elsewhere.Note that compound entities (like classes, files and namespaces) can be put into multiple groups, but members (likevariable, functions, typedefs and enums) can only be a member of one group (this restriction is in place to avoidambiguous linking targets in case a member is not documented in the context of its class, namespace or file, butonly visible as part of a group).Doxygen will put members into the group whose definition has the highest "priority": e.g. An explicit \ingroupoverrides an implicit grouping definition via @{ @}. Conflicting grouping definitions with the same priority trigger awarning, unless one definition was for a member without any explicit documentation.The following example puts VarInA into group A and silently resolves the conflict for IntegerVariable by putting it into44Groupinggroup IntVariables, because the second instance of IntegerVariable is undocumented:/*** \ingroup A*/extern int VarInA;/*** \defgroup IntVariables Global integer variables* @{*//** an integer variable */extern int IntegerVariable;/**@}*/..../*** \defgroup Variables Global variables*//**@{*//** a variable in group A */int VarInA;int IntegerVariable;/**@}*/The \ref command can be used to refer to a group.
The first argument of the \ref command should be group’s label.To use a custom link name, you can put the name of the links in double quotes after the label, as shown by thefollowing exampleThis is the \ref group_label "link" to this group.The priorities of grouping definitions are (from highest to lowest): \ingroup, \defgroup, \addtogroup, \weakgroup.The last command is exactly like \addtogroup with a lower priority. It was added to allow "lazy" grouping definitions:you can use commands with a higher priority in your .h files to define the hierarchy and \weakgroup in .c files withouthaving to duplicate the hierarchy exactly.Example:/** @defgroup group1 The First Group* This is the first group* @{*//** @brief class C1 in group 1 */class C1 {};/** @brief class C2 in group 1 */class C2 {};/** function in group 1 */void func() {}/** @} */ // end of group1/*** @defgroup group2 The Second Group* This is the second group*//** @defgroup group3 The Third Group* This is the third group*//** @defgroup group4 The Fourth GroupGenerated by Doxygen5.2 Member Groups45* @ingroup group3* Group 4 is a subgroup of group 3*//*** @ingroup group2* @brief class C3 in group 2*/class C3 {};/** @ingroup group2* @brief class C4 in group 2*/class C4 {};/** @ingroup group3* @brief class C5 in @link group3 the third group@endlink.*/class C5 {};/** @ingroup group1 group2 group3 group4* namespace N1 is in four groups* @sa @link group1 The first group@endlink, group2, group3, group4** Also see @ref mypage2*/namespace N1 {};/** @file* @ingroup group3* @brief this file in group 3*//** @defgroup group5 The Fifth Group* This is the fifth group* @{*//** @page mypage1 This is a section in group 5* Text of the first section*//** @page mypage2 This is another section in group 5* Text of the second section*//** @} */ // end of group5/** @addtogroup group1** More documentation for the first group.* @{*//** another function in group 1 */void func2() {}/** yet another function in group 1 */void func3() {}/** @} */ // end of group15.2Member GroupsIf a compound (e.g.
a class or file) has many members, it is often desired to group them together. Doxygen alreadyautomatically groups things together on type and protection level, but maybe you feel that this is not enough or thatthat default grouping is wrong. For instance, because you feel that members of different (syntactic) types belong tothe same (semantic) group.Generated by Doxygen46GroupingA member group is defined by a///@{...///@}block or a/**@{*/.../**@}*/block if you prefer C style comments. Note that the members of the group should be physically inside the membergroup’s body.Before the opening marker of a block a separate comment block may be placed. This block should contain the@name (or \name) command and is used to specify the header of the group.
Optionally, the comment block mayalso contain more detailed information about the group.Nesting of member groups is not allowed.If all members of a member group inside a class have the same type and protection level (for instance all are staticpublic members), then the whole member group is displayed as a subgroup of the type/protection level group (thegroup is displayed as a subsection of the "Static Public Members" section for instance). If two or more membershave different types, then the group is put at the same level as the automatically generated groups. If you wantto force all member-groups of a class to be at the top level, you should put a \nosubgrouping command inside thedocumentation of the class.Example:/** A class. Details */class Test{public://@{/** Same documentation for both members.
Details */void func1InGroup1();void func2InGroup1();//@}/** Function without group. Details. */void ungroupedFunction();void func1InGroup2();protected:void func2InGroup2();};void Test::func1InGroup1() {}void Test::func2InGroup1() {}/** @name Group2* Description of group 2.*////@{/** Function 2 in group 2. Details. */void Test::func2InGroup2() {}/** Function 1 in group 2. Details. */void Test::func1InGroup2() {}///@}/*! \file* docs for this file*///!@{//! one description for all members of this group//! (because DISTRIBUTE_GROUP_DOC is YES in the config file)#define A 1#define B 2void glob_func();//!@}Generated by Doxygen5.3 Subpaging47Here Group1 is displayed as a subsection of the "Public Members".
And Group2 is a separate section because itcontains members with different protection levels (i.e. public and protected).5.3SubpagingInformation can be grouped into pages using the \page and \mainpage commands. Normally, this results in a flatlist of pages, where the "main" page is the first in the list.Instead of adding structure using the approach described in section modules it is often more natural and convenientto add additional structure to the pages using the \subpage command.For a page A the \subpage command adds a link to another page B and at the same time makes page B a subpageof A.
This has the effect of making two groups GA and GB, where GB is part of GA, page A is put in group GA, andpage B is put in group GB.Generated by Doxygen48GroupingGenerated by DoxygenChapter 6Including FormulasDoxygen allows you to put LATEX formulas in the output (this works only for the HTML and LATEX output, not for theRTF nor for the man page output).
To be able to include formulas (as images) in the HTML documentation, you willalso need to have the following tools installed• latex: the LATEX compiler, needed to parse the formulas. To test I have used the teTeX 1.0 distribution.• dvips: a tool to convert DVI files to PostScript files I have used version 5.92b from Radical Eye softwarefor testing.• gs: the GhostScript interpreter for converting PostScript files to bitmaps.
I have used Aladdin GhostScript8.0 for testing.For the HTML output there is also an alternative solution using MathJax which does not require the above tools.If you enable USE_MATHJAX in the config then the latex formulas will be copied to the HTML "as is" and a clientside javascript will parse them and turn them into (interactive) images.There are three ways to include formulas in the documentation.1. Using in-text formulas that appear in the running text.
These formulas should be put between a pair of \f$commands, soThe distance between \f$(x_1,y_1)\f$ and \f$(x_2,y_2)\f$ is\f$\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\f$.results in:The distance between (x1 , y1 ) and (x2 , y2 ) isp(x2 − x1 )2 + (y2 − y1 )2 .2. Unnumbered displayed formulas that are centered on a separate line.
These formulas should be put between\f[ and \f] commands. An example:\f[|I_2|=\left| \int_{0}^T \psi(t)\left\{u(a,t)\int_{\gamma(t)}^a\frac{d\theta}{k(\theta,t)}\int_{a}^\theta c(\xi)u_t(\xi,t)\,d\xi\right\} dt\right|\f]results in:Z T Z aZ θdθ|I2 | = ψ(t) u(a,t) −c(ξ )ut (ξ ,t) dξ dt 0γ(t) k(θ ,t) a3. Formulas or other latex elements that are not in a math environment can be specified using \f{environment},where environment is the name of the LATEX environment, the corresponding end command is \f}.
Here isan example for an equation array50Including Formulas\f{eqnarray*}{g &=& \frac{Gm_2}{r^2} \\&=& \frac{(6.673 \times 10^{-11}\,\mbox{m}^3\,\mbox{kg}^{-1}\,\mbox{s}^{-2})(5.9736 \times 10^{24}\,\mbox{kg})}{(6371.01\,\mbox{km})^2} \\&=& 9.82066032\,\mbox{m/s}^2\f}which results in:g==Gm2r2(6.673 × 10−11 m3 kg−1 s−2 )(5.9736 × 1024 kg)(6371.01 km)2= 9.82066032 m/s2For the first two commands one should make sure formulas contain valid commands in LATEX’s math-mode. For thethird command the section should contain valid command for the specific environment.WarningCurrently, doxygen is not very fault tolerant in recovering from typos in formulas. It may be necessary to removethe file formula.repository that is written to the html directory to get rid of an incorrect formula.Generated by DoxygenChapter 7Graphs and diagramsDoxygen has built-in support to generate inheritance diagrams for C++ classes.Doxygen can use the "dot" tool from graphviz to generate more advanced diagrams and graphs.
Graphviz is anopen-source, cross-platform graph drawing toolkit and can be found at http://www.graphviz.org/If you have the "dot" tool in the path, you can set HAVE_DOT to YES in the configuration file to let doxygen use it.Doxygen uses the "dot" tool to generate the following graphs:• A graphical representation of the class hierarchy will be drawn, along with the textual one. Currently thisfeature is supported for HTML only.Warning: When you have a very large class hierarchy where many classes derive from a common baseclass, the resulting image may become too big to handle for some browsers.• An inheritance graph will be generated for each documented class showing the direct and indirect inheritancerelations.