Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > bbf8b69a7c5792df8049c96b78d19811 > files > 773

doxygen-1.7.4-2.fc14.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Doxygen manual: Grouping</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.4 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Doxygen manual</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">Grouping </div>  </div>
</div>
<div class="contents">
<div class="textblock"><p>Doxygen has three mechanisms to group things together. One mechanism works at a global level, creating a new page for each group. These groups are called <a class="el" href="grouping.html#modules">'modules'</a> in the documentation. The second mechanism works within a member list of some compound entity, and is referred to as a <a class="el" href="grouping.html#memgroup">'member groups'</a>. For <a class="el" href="commands.html#cmdpage">pages</a> there is a third grouping mechanism referred to as <a class="el" href="grouping.html#subpaging">subpaging</a>.</p>
<h2><a class="anchor" id="modules"></a>
Modules</h2>
<p>Modules are a way to group things together on a separate page. You can document a group as a whole, as well as all individual members. Members of a group can be files, namespaces, classes, functions, variables, enums, typedefs, and defines, but also other groups.</p>
<p>To define a group, you should put the <a class="el" href="commands.html#cmddefgroup">\defgroup</a> command in a special comment block. The first argument of the command is a label that should uniquely identify the group. The second argument is the name or title of the group as it should appear in the documentation.</p>
<p>You can make an entity a member of a specific group by putting a <a class="el" href="commands.html#cmdingroup">\ingroup</a> command inside its documentation block.</p>
<p>To avoid putting <a class="el" href="commands.html#cmdingroup">\ingroup</a> commands in the documentation for each member you can also group members together by the open marker <code>@{</code> before the group and the closing marker <code>@}</code> after the group. The markers can be put in the documentation of the group definition or in a separate documentation block.</p>
<p>Groups themselves can also be nested using these grouping markers.</p>
<p>You will get an error message when you use the same group label more than once. If you don't want doxygen to enforce unique labels, then you can use <a class="el" href="commands.html#cmdaddtogroup">\addtogroup</a> instead of <a class="el" href="commands.html#cmddefgroup">\defgroup</a>. It can be used exactly like <a class="el" href="commands.html#cmddefgroup">\defgroup</a>, but when the group has been defined already, then it silently merges the existing documentation with the new one. The title of the group is optional for this command, so you can use </p>
<div class="fragment"><pre class="fragment">
/** \addtogroup &lt;label&gt; 
 *  @{
 */
...

/** @}*/
</pre></div><p> to add additional members to a group that is defined in more detail elsewhere.</p>
<p>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).</p>
<p>Doxygen will put members into the group whose definition has the highest "priority": e.g. An explicit <a class="el" href="commands.html#cmdingroup">\ingroup</a> overrides an implicit grouping definition via <code>@{</code> <code>@}</code>. Conflicting grouping definitions with the same priority trigger a warning, unless one definition was for a member without any explicit documentation.</p>
<p>The following example puts VarInA into group A and silently resolves the conflict for IntegerVariable by putting it into group IntVariables, because the second instance of IntegerVariable is undocumented:</p>
<div class="fragment"><pre class="fragment">

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

/**@}*/
</pre></div><p>The <a class="el" href="commands.html#cmdref">\ref</a> 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 the following example </p>
<div class="fragment"><pre class="fragment">
This is the \ref group_label "link" to this group.
</pre></div><p>The priorities of grouping definitions are (from highest to lowest): <a class="el" href="commands.html#cmdingroup">\ingroup</a>, <a class="el" href="commands.html#cmddefgroup">\defgroup</a>, <a class="el" href="commands.html#cmdaddtogroup">\addtogroup</a>, <a class="el" href="commands.html#cmdweakgroup">\weakgroup</a>. The last command is exactly like <a class="el" href="commands.html#cmdaddtogroup">\addtogroup</a> 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 <a class="el" href="commands.html#cmdweakgroup">\weakgroup</a> in .c files without having to duplicate the hierarchy exactly.</p>
<dl class="user"><dt><b>Example:</b></dt><dd><div class="fragment"><pre class="fragment">/** @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 Group
 *  @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 group1

</pre></div></dd></dl>
 
Click <a href="../examples/group/html/modules.html">here</a> 
for the corresponding HTML documentation that is generated by Doxygen.
<h2><a class="anchor" id="memgroup"></a>
Member Groups</h2>
<p>If a compound (e.g. a class or file) has many members, it is often desired to group them together. Doxygen already automatically groups things together on type and protection level, but maybe you feel that this is not enough or that that default grouping is wrong. For instance, because you feel that members of different (syntactic) types belong to the same (semantic) group.</p>
<p>A member group is defined by a </p>
<div class="fragment"><pre class="fragment">
///@{ 
  ...
///@}
</pre></div><p> block or a </p>
<div class="fragment"><pre class="fragment">
/**@{*/ 
  ... 
/**@}*/ 
</pre></div><p> block if you prefer C style comments. Note that the members of the group should be physically inside the member group's body.</p>
<p>Before the opening marker of a block a separate comment block may be placed. This block should contain the <a class="el" href="commands.html#cmdname">@name</a> (or <a class="el" href="commands.html#cmdname">\name</a>) command and is used to specify the header of the group. Optionally, the comment block may also contain more detailed information about the group.</p>
<p>Nesting of member groups is not allowed.</p>
<p>If all members of a member group inside a class have the same type and protection level (for instance all are static public members), then the whole member group is displayed as a subgroup of the type/protection level group (the group is displayed as a subsection of the "Static Public Members" section for instance). If two or more members have different types, then the group is put at the same level as the automatically generated groups. If you want to force all member-groups of a class to be at the top level, you should put a <a class="el" href="commands.html#cmdnosubgrouping">\nosubgrouping</a> command inside the documentation of the class.</p>
<dl class="user"><dt><b>Example:</b></dt><dd><div class="fragment"><pre class="fragment">/** 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 2
void glob_func();
//@}
</pre></div></dd></dl>
 
Click <a href="../examples/memgrp/html/class_test.html">here</a> 
for the corresponding HTML documentation that is generated by Doxygen.
<p>Here Group1 is displayed as a subsection of the "Public Members". And Group2 is a separate section because it contains members with different protection levels (i.e. public and protected).</p>
 
Go to the <a href="formulas.html">next</a> section or return to the
 <a href="index.html">index</a>.
<h2><a class="anchor" id="subpaging"></a>
Subpaging</h2>
<p>Information can be grouped into pages using the <a class="el" href="commands.html#cmdpage">\page</a> and <a class="el" href="commands.html#cmdsubpage">\mainpage</a> commands. Normally, this results in a flat list of pages, where the "main" page is the first in the list.</p>
<p>Instead of adding structure using the approach described in section <a class="el" href="grouping.html#modules">modules</a> it is often more natural and convenient to add additional structure to the pages using the <a class="el" href="commands.html#cmdsubpage">\subpage</a> command.</p>
<p>For a page A the \subpage command adds a link to another page B and at the same time makes page B a subpage of 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, and page B is put in group GB.</p>
 
Go to the <a href="formulas.html">next</a> section or return to the
 <a href="index.html">index</a>.
 </div></div>
<hr class="footer"/><address class="footer"><small>Generated on Mon Jun 27 2011 for Doxygen manual by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>