Blame doc/docblocks.doc

Packit Service 50c9f2
/******************************************************************************
Packit Service 50c9f2
 *
Packit Service 50c9f2
 * 
Packit Service 50c9f2
 *
Packit Service 50c9f2
 * Copyright (C) 1997-2015 by Dimitri van Heesch.
Packit Service 50c9f2
 *
Packit Service 50c9f2
 * Permission to use, copy, modify, and distribute this software and its
Packit Service 50c9f2
 * documentation under the terms of the GNU General Public License is hereby 
Packit Service 50c9f2
 * granted. No representations are made about the suitability of this software 
Packit Service 50c9f2
 * for any purpose. It is provided "as is" without express or implied warranty.
Packit Service 50c9f2
 * See the GNU General Public License for more details.
Packit Service 50c9f2
 *
Packit Service 50c9f2
 * Documents produced by Doxygen are derivative works derived from the
Packit Service 50c9f2
 * input used in their production; they are not affected by this license.
Packit Service 50c9f2
 *
Packit Service 50c9f2
 */
Packit Service 50c9f2
/*! \page docblocks Documenting the code
Packit Service 50c9f2
\tableofcontents
Packit Service 50c9f2
Packit Service 50c9f2
This chapter covers two topics:
Packit Service 50c9f2
1. How to put comments in your code such that doxygen incorporates them in
Packit Service 50c9f2
   the documentation it generates. 
Packit Service 50c9f2
   This is further detailed in the \ref specialblock "next section".
Packit Service 50c9f2
2. Ways to structure the contents of a comment block such that the output
Packit Service 50c9f2
   looks good, as explained in section \ref docstructure.
Packit Service 50c9f2
Packit Service 50c9f2
\section specialblock Special comment blocks 
Packit Service 50c9f2
Packit Service 50c9f2
A special comment block is a C or C++ style comment block with some 
Packit Service 50c9f2
additional markings, so doxygen knows it is a piece of structured text that
Packit Service 50c9f2
needs to end up in the generated documentation. The \ref cppblock "next" section
Packit Service 50c9f2
presents the various styles supported by doxygen.
Packit Service 50c9f2
Packit Service 50c9f2
For Python, VHDL, Fortran, and Tcl code there are different commenting 
Packit Service 50c9f2
conventions, which can be found in sections \ref pythonblocks, \ref vhdlblocks, 
Packit Service 50c9f2
\ref fortranblocks, and \ref tclblocks respectively.
Packit Service 50c9f2
Packit Service 50c9f2
\subsection cppblock Comment blocks for C-like languages (C/C++/C#/Objective-C/PHP/Java)
Packit Service 50c9f2
Packit Service 50c9f2
For each entity in the code there are two (or in some cases three) types of descriptions, 
Packit Service 50c9f2
which together form the documentation for that entity; a *brief* description and *detailed*
Packit Service 50c9f2
description, both are optional. For methods and functions there is also a third
Packit Service 50c9f2
type of description, the so called *in body* description, which consists of 
Packit Service 50c9f2
the concatenation of all comment blocks found within the body of the method or function.
Packit Service 50c9f2
Packit Service 50c9f2
Having more than one brief or detailed description is allowed (but not recommended,
Packit Service 50c9f2
as the order in which the descriptions will appear is not specified).
Packit Service 50c9f2
Packit Service 50c9f2
As the name suggest, a brief description is
Packit Service 50c9f2
a short one-liner, whereas the detailed description provides longer, 
Packit Service 50c9f2
more detailed documentation. An "in body" description can also act as a detailed
Packit Service 50c9f2
description or can describe a collection of implementation details.
Packit Service 50c9f2
For the HTML output brief descriptions are also
Packit Service 50c9f2
used to provide tooltips at places where an item is referenced.
Packit Service 50c9f2
Packit Service 50c9f2
There are several ways to mark a comment block as a detailed description:
Packit Service 50c9f2
    Packit Service 50c9f2
  1. You can use the JavaDoc style, which consist of a C-style comment
  2. Packit Service 50c9f2
    block starting with two *'s, like this:
    Packit Service 50c9f2
    Packit Service 50c9f2
    \verbatim
    Packit Service 50c9f2
    /**
    Packit Service 50c9f2
     * ... text ...
    Packit Service 50c9f2
     */
    Packit Service 50c9f2
    \endverbatim
    Packit Service 50c9f2
    Packit Service 50c9f2
  3. or you can use the Qt style and add an exclamation mark (!)
  4. Packit Service 50c9f2
    after the opening of a C-style comment block, as shown in this example:
    Packit Service 50c9f2
    Packit Service 50c9f2
    \verbatim
    Packit Service 50c9f2
    /*!
    Packit Service 50c9f2
     * ... text ...
    Packit Service 50c9f2
     */
    Packit Service 50c9f2
    \endverbatim
    Packit Service 50c9f2
    Packit Service 50c9f2
    In both cases the intermediate *'s are optional, so
    Packit Service 50c9f2
    Packit Service 50c9f2
    \verbatim
    Packit Service 50c9f2
    /*!
    Packit Service 50c9f2
     ... text ...
    Packit Service 50c9f2
    */
    Packit Service 50c9f2
    \endverbatim
    Packit Service 50c9f2
    Packit Service 50c9f2
    is also valid.
    Packit Service 50c9f2
    Packit Service 50c9f2
  5. A third alternative is to use a block of at least two C++ comment
  6. Packit Service 50c9f2
    lines, where each line starts with an additional slash or an 
    Packit Service 50c9f2
    exclamation mark. Here are examples of the two cases:
    Packit Service 50c9f2
    Packit Service 50c9f2
    \verbatim
    Packit Service 50c9f2
    ///
    Packit Service 50c9f2
    /// ... text ...
    Packit Service 50c9f2
    ///
    Packit Service 50c9f2
    \endverbatim
    Packit Service 50c9f2
    Packit Service 50c9f2
    or
    Packit Service 50c9f2
    Packit Service 50c9f2
    \verbatim
    Packit Service 50c9f2
    //!
    Packit Service 50c9f2
    //!... text ...
    Packit Service 50c9f2
    //!
    Packit Service 50c9f2
    \endverbatim
    Packit Service 50c9f2
    Packit Service 50c9f2
    Note that a blank line ends a documentation block in this case.
    Packit Service 50c9f2
    Packit Service 50c9f2
  7. Packit Service 50c9f2
    Packit Service 50c9f2
    Some people like to make their comment blocks more visible in the
    Packit Service 50c9f2
    documentation. For this purpose you can use the following:
    Packit Service 50c9f2
    Packit Service 50c9f2
    \verbatim
    Packit Service 50c9f2
    /********************************************//**
    Packit Service 50c9f2
     *  ... text
    Packit Service 50c9f2
     ***********************************************/
    Packit Service 50c9f2
    \endverbatim
    Packit Service 50c9f2
    (note the 2 slashes to end the normal comment block and start a special comment block).
    Packit Service 50c9f2
    Packit Service 50c9f2
    or
    Packit Service 50c9f2
    Packit Service 50c9f2
    \verbatim
    Packit Service 50c9f2
    /////////////////////////////////////////////////
    Packit Service 50c9f2
    /// ... text ...
    Packit Service 50c9f2
    /////////////////////////////////////////////////
    Packit Service 50c9f2
    \endverbatim
    Packit Service 50c9f2
    Packit Service 50c9f2
    Packit Service 50c9f2
    Packit Service 50c9f2
    For the brief description there are also several possibilities:
    Packit Service 50c9f2
      Packit Service 50c9f2
    1. One could use the \ref cmdbrief "\\brief" command with one of the
    2. Packit Service 50c9f2
      above comment blocks. This command ends at the end of a paragraph, 
      Packit Service 50c9f2
      so the detailed description follows after an empty line.
      Packit Service 50c9f2
      Packit Service 50c9f2
      Here is an example:
      Packit Service 50c9f2
      Packit Service 50c9f2
      \verbatim
      Packit Service 50c9f2
      /*! \brief Brief description.
      Packit Service 50c9f2
       *         Brief description continued.
      Packit Service 50c9f2
       *
      Packit Service 50c9f2
       *  Detailed description starts here.
      Packit Service 50c9f2
       */
      Packit Service 50c9f2
      \endverbatim
      Packit Service 50c9f2
      Packit Service 50c9f2
    3. If \ref cfg_javadoc_autobrief "JAVADOC_AUTOBRIEF" is set to \c YES
    4. Packit Service 50c9f2
          in the configuration file, 
      Packit Service 50c9f2
          then using JavaDoc style comment
      Packit Service 50c9f2
          blocks will automatically start a brief description which ends at the
      Packit Service 50c9f2
          first dot followed by a space or new line. Here is an example:
      Packit Service 50c9f2
      Packit Service 50c9f2
      \verbatim
      Packit Service 50c9f2
      /** Brief description which ends at this dot. Details follow
      Packit Service 50c9f2
       *  here.
      Packit Service 50c9f2
       */
      Packit Service 50c9f2
      \endverbatim
      Packit Service 50c9f2
      The option has the same effect for multi-line special C++ comments:
      Packit Service 50c9f2
      \verbatim
      Packit Service 50c9f2
      /// Brief description which ends at this dot. Details follow
      Packit Service 50c9f2
      /// here.
      Packit Service 50c9f2
      \endverbatim
      Packit Service 50c9f2
      Packit Service 50c9f2
    5. A third option is to use a special C++ style comment which does not
    6. Packit Service 50c9f2
          span more than one line. Here are two examples:
      Packit Service 50c9f2
      \verbatim
      Packit Service 50c9f2
      /// Brief description.
      Packit Service 50c9f2
      /** Detailed description. */
      Packit Service 50c9f2
      \endverbatim
      Packit Service 50c9f2
      Packit Service 50c9f2
      or
      Packit Service 50c9f2
      Packit Service 50c9f2
      \verbatim
      Packit Service 50c9f2
      //! Brief description.
      Packit Service 50c9f2
      Packit Service 50c9f2
      //! Detailed description 
      Packit Service 50c9f2
      //! starts here.
      Packit Service 50c9f2
      \endverbatim
      Packit Service 50c9f2
      Packit Service 50c9f2
      Note the blank line in the last example, which is required to separate the 
      Packit Service 50c9f2
      brief description from the block containing the detailed description. The
      Packit Service 50c9f2
      \ref cfg_javadoc_autobrief "JAVADOC_AUTOBRIEF" should also be set to \c NO
      Packit Service 50c9f2
      for this case.
      Packit Service 50c9f2
      Packit Service 50c9f2
      Packit Service 50c9f2
      Packit Service 50c9f2
      As you can see doxygen is quite flexible. If you have multiple
      Packit Service 50c9f2
      detailed descriptions, like in the following example:
      Packit Service 50c9f2
      Packit Service 50c9f2
      \verbatim
      Packit Service 50c9f2
      //! Brief description, which is
      Packit Service 50c9f2
      //! really a detailed description since it spans multiple lines.
      Packit Service 50c9f2
      /*! Another detailed description!
      Packit Service 50c9f2
       */
      Packit Service 50c9f2
      \endverbatim
      Packit Service 50c9f2
      Packit Service 50c9f2
      They will be joined. Note that this is also the case if the descriptions
      Packit Service 50c9f2
      are at different places in the code! In this case the order will depend
      Packit Service 50c9f2
      on the order in which doxygen parses the code.
      Packit Service 50c9f2
      Packit Service 50c9f2
      Packit Service 50c9f2
      Unlike most other documentation systems, doxygen also allows you to put
      Packit Service 50c9f2
      the documentation of members (including global functions) in front of 
      Packit Service 50c9f2
      the \e definition. This way the documentation can be placed in the source 
      Packit Service 50c9f2
      file instead of the header file. This keeps the header file compact, and allows the 
      Packit Service 50c9f2
      implementer of the members more direct access to the documentation.
      Packit Service 50c9f2
      As a compromise the brief description could be placed before the
      Packit Service 50c9f2
      declaration and the detailed description before the member definition.
      Packit Service 50c9f2
      Packit Service 50c9f2
      \subsubsection memberdoc Putting documentation after members 
      Packit Service 50c9f2
      Packit Service 50c9f2
      If you want to document the members of a file, struct, union, class, or enum,
      Packit Service 50c9f2
      it is sometimes desired to place the documentation block after the member 
      Packit Service 50c9f2
      instead of before. For this purpose you have to put an additional \< marker
      Packit Service 50c9f2
      in the comment block. Note that this also works for the parameters 
      Packit Service 50c9f2
      of a function.
      Packit Service 50c9f2
      Packit Service 50c9f2
      Here are some examples:
      Packit Service 50c9f2
      \verbatim
      Packit Service 50c9f2
      int var; /*!< Detailed description after the member */
      Packit Service 50c9f2
      \endverbatim
      Packit Service 50c9f2
      This block can be used to put a Qt style detailed 
      Packit Service 50c9f2
      documentation block \e after a member. Other ways to do the
      Packit Service 50c9f2
      same are:
      Packit Service 50c9f2
      \verbatim
      Packit Service 50c9f2
      int var; /**< Detailed description after the member */
      Packit Service 50c9f2
      \endverbatim
      Packit Service 50c9f2
      or 
      Packit Service 50c9f2
      \verbatim
      Packit Service 50c9f2
      int var; //!< Detailed description after the member
      Packit Service 50c9f2
               //!< 
      Packit Service 50c9f2
      \endverbatim
      Packit Service 50c9f2
      or 
      Packit Service 50c9f2
      \verbatim
      Packit Service 50c9f2
      int var; ///< Detailed description after the member
      Packit Service 50c9f2
               ///< 
      Packit Service 50c9f2
      \endverbatim
      Packit Service 50c9f2
      Packit Service 50c9f2
      Most often one only wants to put a brief description after a member.
      Packit Service 50c9f2
      This is done as follows:
      Packit Service 50c9f2
      \verbatim
      Packit Service 50c9f2
      int var; //!< Brief description after the member
      Packit Service 50c9f2
      \endverbatim
      Packit Service 50c9f2
      or
      Packit Service 50c9f2
      \verbatim
      Packit Service 50c9f2
      int var; ///< Brief description after the member
      Packit Service 50c9f2
      \endverbatim
      Packit Service 50c9f2
      Packit Service 50c9f2
      For functions one can use the \ref cmdparam "\@param" command to document the parameters
      Packit Service 50c9f2
      and then use [in], [out], [in,out] 
      Packit Service 50c9f2
      to document the direction. For inline documentation this is also possible 
      Packit Service 50c9f2
      by starting with the direction attribute, e.g.
      Packit Service 50c9f2
      \verbatim
      Packit Service 50c9f2
      void foo(int v /**< [in] docs for input parameter v. */);
      Packit Service 50c9f2
      \endverbatim
      Packit Service 50c9f2
      Packit Service 50c9f2
      Note that these blocks have the same structure and meaning as the 
      Packit Service 50c9f2
      special comment blocks in the previous section 
      Packit Service 50c9f2
      only the \< indicates that the member is 
      Packit Service 50c9f2
      located in front of the block instead of after the block.
      Packit Service 50c9f2
      Packit Service 50c9f2
      Here is an example of the use of these comment blocks:
      Packit Service 50c9f2
      \include afterdoc.h
      Packit Service 50c9f2
       \htmlonly
      Packit Service 50c9f2
       

      Packit Service 50c9f2
       Click here
      Packit Service 50c9f2
       for the corresponding HTML documentation that is generated by doxygen.
      Packit Service 50c9f2
       \endhtmlonly
      Packit Service 50c9f2
       \latexonly
      Packit Service 50c9f2
       See \hyperlink{afterdoc_example}{After Block example}
      Packit Service 50c9f2
       for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
      Packit Service 50c9f2
       \endlatexonly
      Packit Service 50c9f2
      Packit Service 50c9f2
      \warning These blocks can only be used to document \e members and \e parameters.
      Packit Service 50c9f2
               They cannot be used to document files, classes, unions, structs,
      Packit Service 50c9f2
               groups, namespaces and enums themselves. Furthermore, the structural 
      Packit Service 50c9f2
               commands mentioned in the next section 
      Packit Service 50c9f2
               (like \\class) are not allowed 
      Packit Service 50c9f2
               inside these comment blocks.
      Packit Service 50c9f2
      Packit Service 50c9f2
      \subsubsection docexamples Examples
      Packit Service 50c9f2
      Packit Service 50c9f2
      Here is an example of a documented piece of C++ code using the Qt style:
      Packit Service 50c9f2
      \include qtstyle.cpp
      Packit Service 50c9f2
       \htmlonly
      Packit Service 50c9f2
       

      Packit Service 50c9f2
       Click here
      Packit Service 50c9f2
       for the corresponding HTML documentation that is generated by doxygen.
      Packit Service 50c9f2
       \endhtmlonly
      Packit Service 50c9f2
       \latexonly
      Packit Service 50c9f2
       See \hyperlink{qtstyle_example}{QT Style example}
      Packit Service 50c9f2
       for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
      Packit Service 50c9f2
       \endlatexonly
      Packit Service 50c9f2
      Packit Service 50c9f2
      The brief descriptions are included in the member overview of a 
      Packit Service 50c9f2
      class, namespace or file and are printed using a small italic font 
      Packit Service 50c9f2
      (this description can be hidden by setting 
      Packit Service 50c9f2
      \ref cfg_brief_member_desc "BRIEF_MEMBER_DESC" to \c NO in 
      Packit Service 50c9f2
      the config file). By default the brief descriptions become the first 
      Packit Service 50c9f2
      sentence of the detailed descriptions 
      Packit Service 50c9f2
      (but this can be changed by setting the \ref cfg_repeat_brief "REPEAT_BRIEF" 
      Packit Service 50c9f2
      tag to \c NO). Both the brief and the detailed descriptions are optional 
      Packit Service 50c9f2
      for the Qt style. 
      Packit Service 50c9f2
      Packit Service 50c9f2
      By default a JavaDoc style documentation block behaves the same way as a
      Packit Service 50c9f2
      Qt style documentation block. This is not according the JavaDoc specification
      Packit Service 50c9f2
      however, where the first sentence of the documentation block is automatically
      Packit Service 50c9f2
      treated as a brief description. To enable this behavior you should set
      Packit Service 50c9f2
      \ref cfg_javadoc_autobrief "JAVADOC_AUTOBRIEF" to YES in the configuration
      Packit Service 50c9f2
      file. If you enable this option and want to put a dot in the middle of a
      Packit Service 50c9f2
      sentence without ending it, you should put a backslash and a space after it.
      Packit Service 50c9f2
      Here is an example:
      Packit Service 50c9f2
      \verbatim
      Packit Service 50c9f2
        /** Brief description (e.g.\ using only a few words). Details follow. */
      Packit Service 50c9f2
      \endverbatim
      Packit Service 50c9f2
      Packit Service 50c9f2
      Here is the same piece of code as shown above, this time documented using the 
      Packit Service 50c9f2
      JavaDoc style and \ref cfg_javadoc_autobrief "JAVADOC_AUTOBRIEF" set to YES:
      Packit Service 50c9f2
      \include jdstyle.cpp
      Packit Service 50c9f2
       \htmlonly
      Packit Service 50c9f2
       

      Packit Service 50c9f2
       Click here
      Packit Service 50c9f2
       for the corresponding HTML documentation that is generated by doxygen.
      Packit Service 50c9f2
       \endhtmlonly
      Packit Service 50c9f2
       \latexonly
      Packit Service 50c9f2
       See \hyperlink{jdstyle_example}{Javadoc Style example}
      Packit Service 50c9f2
       for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
      Packit Service 50c9f2
       \endlatexonly
      Packit Service 50c9f2
      Packit Service 50c9f2
      Similarly, if one wishes the first sentence of a Qt style documentation
      Packit Service 50c9f2
      block to automatically be treated as a brief description, one may set
      Packit Service 50c9f2
      \ref cfg_qt_autobrief "QT_AUTOBRIEF" to YES in the configuration file.
      Packit Service 50c9f2
      Packit Service 50c9f2
      \subsubsection structuralcommands Documentation at other places
      Packit Service 50c9f2
      Packit Service 50c9f2
      In the examples in the previous section the comment blocks were always located *in 
      Packit Service 50c9f2
      front* of the declaration or definition of a file, class or namespace or *in
      Packit Service 50c9f2
      front* or *after* one of its members. 
      Packit Service 50c9f2
      Although this is often comfortable, there may sometimes be reasons to put the 
      Packit Service 50c9f2
      documentation somewhere else. For documenting a file this is even 
      Packit Service 50c9f2
      required since there is no such thing as "in front of a file". 
      Packit Service 50c9f2
      Packit Service 50c9f2
      Doxygen allows you to put your documentation blocks practically 
      Packit Service 50c9f2
      anywhere (the exception is inside the body of a function or inside a 
      Packit Service 50c9f2
      normal C style comment block). 
      Packit Service 50c9f2
      Packit Service 50c9f2
      The price you pay for not putting the
      Packit Service 50c9f2
      documentation block directly before (or after) an item is the need to put a  
      Packit Service 50c9f2
      structural command inside the documentation block, which leads to some
      Packit Service 50c9f2
      duplication of information. So in practice you should \e avoid the use of
      Packit Service 50c9f2
      structural commands \e unless other requirements force you to do so.
      Packit Service 50c9f2
      Packit Service 50c9f2
      Structural commands (like \ref cmd_intro "all other commands") start with a backslash 
      Packit Service 50c9f2
      (<tt>\\</tt>), or an at-sign (<tt>\@</tt>) if you prefer JavaDoc style, 
      Packit Service 50c9f2
      followed by a command name and one or more parameters.
      Packit Service 50c9f2
      For instance, if you want to document the class \c Test in the example
      Packit Service 50c9f2
      above, you could have also put the following documentation block somewhere
      Packit Service 50c9f2
      in the input that is read by doxygen:
      Packit Service 50c9f2
      \verbatim
      Packit Service 50c9f2
      /*! \class Test
      Packit Service 50c9f2
          \brief A test class.
      Packit Service 50c9f2
      Packit Service 50c9f2
          A more detailed class description.
      Packit Service 50c9f2
      */
      Packit Service 50c9f2
      \endverbatim
      Packit Service 50c9f2
      Packit Service 50c9f2
      Here the special command \c \\class is used to indicate that the
      Packit Service 50c9f2
      comment block contains documentation for the class \c Test.
      Packit Service 50c9f2
      Other structural commands are:
      Packit Service 50c9f2
        Packit Service 50c9f2
      • \c \\struct to document a C-struct.
      • Packit Service 50c9f2
      • \c \\union to document a union.
      • Packit Service 50c9f2
      • \c \\enum to document an enumeration type.
      • Packit Service 50c9f2
      • \c \\fn to document a function.
      • Packit Service 50c9f2
      • \c \\var to document a variable or typedef or enum value.
      • Packit Service 50c9f2
      • \c \\def to document a \#define.
      • Packit Service 50c9f2
      • \c \\typedef to document a type definition.
      • Packit Service 50c9f2
      • \c \\file to document a file.
      • Packit Service 50c9f2
      • \c \\namespace to document a namespace.
      • Packit Service 50c9f2
      • \c \\package to document a Java package.
      • Packit Service 50c9f2
      • \c \\interface to document an IDL interface.
      • Packit Service 50c9f2
        Packit Service 50c9f2
        See section \ref commands for detailed information about these and many other 
        Packit Service 50c9f2
        commands. 
        Packit Service 50c9f2
        Packit Service 50c9f2
        To document a member of a C++ class, you must also document the class 
        Packit Service 50c9f2
        itself. The same holds for namespaces. To document a global C function, 
        Packit Service 50c9f2
        typedef, enum or preprocessor definition you must first document the file 
        Packit Service 50c9f2
        that contains it (usually this will be a header file, because that file 
        Packit Service 50c9f2
        contains the information that is exported to other source files).
        Packit Service 50c9f2
        Packit Service 50c9f2
        @attention Let's repeat that, because it is often overlooked:
        Packit Service 50c9f2
        to document global objects (functions, typedefs, enum, macros, etc), you
        Packit Service 50c9f2
        must document the file in which they are defined. In other words, 
        Packit Service 50c9f2
        there must at least be a \verbatim /*! \file */ \endverbatim
        Packit Service 50c9f2
        or a \verbatim /** @file */ \endverbatim line in this file.
        Packit Service 50c9f2
        Packit Service 50c9f2
        Here is an example of a C header named \c structcmd.h that is documented 
        Packit Service 50c9f2
        using structural commands:
        Packit Service 50c9f2
        \include structcmd.h
        Packit Service 50c9f2
         \htmlonly
        Packit Service 50c9f2
         

        Packit Service 50c9f2
         Click here
        Packit Service 50c9f2
         for the corresponding HTML documentation that is generated by doxygen.
        Packit Service 50c9f2
         \endhtmlonly
        Packit Service 50c9f2
         \latexonly
        Packit Service 50c9f2
         See \hyperlink{structcmd_example}{Structural Commands example}
        Packit Service 50c9f2
         for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
        Packit Service 50c9f2
         \endlatexonly
        Packit Service 50c9f2
        Packit Service 50c9f2
         Because each comment block in the example above contains a structural command, all
        Packit Service 50c9f2
         the comment blocks could be moved to another location or input file 
        Packit Service 50c9f2
         (the source file for instance), without affecting the generated 
        Packit Service 50c9f2
         documentation. The disadvantage of this approach is that prototypes are
        Packit Service 50c9f2
         duplicated, so all changes have to be made twice! Because of this you
        Packit Service 50c9f2
         should first consider if this is really needed, and avoid structural
        Packit Service 50c9f2
         commands if possible. I often receive examples that contain \\fn command
        Packit Service 50c9f2
         in comment blocks which are place in front of a function. This is clearly
        Packit Service 50c9f2
         a case where the \\fn command is redundant and will only lead to problems.
        Packit Service 50c9f2
        Packit Service 50c9f2
         When you place a comment block in a file with one of the following extensions
        Packit Service 50c9f2
         `.dox`, `.txt`, or `.doc` then doxygen will hide this file from the file list.
        Packit Service 50c9f2
        Packit Service 50c9f2
         If you have a file that doxygen cannot parse but still would like to document it,
        Packit Service 50c9f2
         you can show it as-is using \ref cmdverbinclude "\\verbinclude", e.g.
        Packit Service 50c9f2
        Packit Service 50c9f2
        \verbatim
        Packit Service 50c9f2
        /*! \file myscript.sh
        Packit Service 50c9f2
         *  Look at this nice script:
        Packit Service 50c9f2
         *  \verbinclude myscript.sh
        Packit Service 50c9f2
         */
        Packit Service 50c9f2
        \endverbatim
        Packit Service 50c9f2
        Packit Service 50c9f2
        Make sure that the script is explicitly listed in the \ref cfg_input "INPUT" or
        Packit Service 50c9f2
        that \ref cfg_file_patterns "FILE_PATTERNS" includes the `.sh` extension and the
        Packit Service 50c9f2
        the script can be found in the path set via \ref cfg_example_path "EXAMPLE_PATH".
        Packit Service 50c9f2
        Packit Service 50c9f2
        \subsection pythonblocks Comment blocks in Python
        Packit Service 50c9f2
        Packit Service 50c9f2
        For Python there is a standard way of documenting the code using 
        Packit Service 50c9f2
        so called documentation strings. Such strings are stored in \c __doc__
        Packit Service 50c9f2
        and can be retrieved at runtime. Doxygen will extract such comments
        Packit Service 50c9f2
        and assume they have to be represented in a preformatted way.
        Packit Service 50c9f2
        Packit Service 50c9f2
        \include docstring.py
        Packit Service 50c9f2
         \htmlonly
        Packit Service 50c9f2
         

        Packit Service 50c9f2
         Click here
        Packit Service 50c9f2
         for the corresponding HTML documentation that is generated by doxygen.
        Packit Service 50c9f2
         \endhtmlonly
        Packit Service 50c9f2
         \latexonly
        Packit Service 50c9f2
         See \hyperlink{python_example}{Python Docstring example}
        Packit Service 50c9f2
         for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
        Packit Service 50c9f2
         \endlatexonly
        Packit Service 50c9f2
        Packit Service 50c9f2
        Note that in this case none of doxygen's \ref cmd_intro "special commands" 
        Packit Service 50c9f2
        are supported.
        Packit Service 50c9f2
        Packit Service 50c9f2
        There is also another way to document Python code using comments that 
        Packit Service 50c9f2
        start with "##". These type of comment blocks are more in line with the 
        Packit Service 50c9f2
        way documentation blocks work for the other languages supported by doxygen 
        Packit Service 50c9f2
        and this also allows the use of special commands. 
        Packit Service 50c9f2
        Packit Service 50c9f2
        Here is the same example again but now using doxygen style comments:
        Packit Service 50c9f2
        Packit Service 50c9f2
        \include pyexample.py
        Packit Service 50c9f2
         \htmlonly
        Packit Service 50c9f2
         

        Packit Service 50c9f2
         Click here
        Packit Service 50c9f2
         for the corresponding HTML documentation that is generated by doxygen.
        Packit Service 50c9f2
         \endhtmlonly
        Packit Service 50c9f2
         \latexonly
        Packit Service 50c9f2
         See \hyperlink{py_example}{Python example}
        Packit Service 50c9f2
         for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
        Packit Service 50c9f2
         \endlatexonly
        Packit Service 50c9f2
        Packit Service 50c9f2
        Since python looks more like Java than like C or C++, you should set 
        Packit Service 50c9f2
        \ref cfg_optimize_output_java "OPTIMIZE_OUTPUT_JAVA" to \c YES in the
        Packit Service 50c9f2
        config file. 
        Packit Service 50c9f2
        Packit Service 50c9f2
        Packit Service 50c9f2
        \subsection vhdlblocks Comment blocks in VHDL
        Packit Service 50c9f2
        Packit Service 50c9f2
        For VHDL a comment normally start with "--". Doxygen will extract comments
        Packit Service 50c9f2
        starting with "--!". There are only two types of comment blocks in VHDL;
        Packit Service 50c9f2
        a one line "--!" comment representing a brief description, and a multi-line
        Packit Service 50c9f2
        "--!" comment (where the "--!" prefix is repeated for each line) representing
        Packit Service 50c9f2
        a detailed description.
        Packit Service 50c9f2
        Packit Service 50c9f2
        Comments are always located in front of the item that is being documented
        Packit Service 50c9f2
        with one exception: for ports the comment can also be after the item
        Packit Service 50c9f2
        and is then treated as a brief description for the port.
        Packit Service 50c9f2
        Packit Service 50c9f2
        Here is an example VHDL file with doxygen comments:
        Packit Service 50c9f2
        Packit Service 50c9f2
        \include  mux.vhdl
        Packit Service 50c9f2
         \htmlonly
        Packit Service 50c9f2
         

        Packit Service 50c9f2
         Click here
        Packit Service 50c9f2
         for the corresponding HTML documentation that is generated by doxygen.
        Packit Service 50c9f2
         \endhtmlonly
        Packit Service 50c9f2
         \latexonly
        Packit Service 50c9f2
         See \hyperlink{vhdl_example}{VHDL example}
        Packit Service 50c9f2
         for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
        Packit Service 50c9f2
         \endlatexonly
        Packit Service 50c9f2
        Packit Service 50c9f2
        To get proper looking output you need to set
        Packit Service 50c9f2
        \ref cfg_optimize_output_vhdl "OPTIMIZE_OUTPUT_VHDL" to \c YES in the
        Packit Service 50c9f2
        config file. This will also affect a number of other settings. When they
        Packit Service 50c9f2
        were not already set correctly doxygen will produce a warning telling which
        Packit Service 50c9f2
        settings where overruled.
        Packit Service 50c9f2
        Packit Service 50c9f2
        \subsection fortranblocks Comment blocks in Fortran
        Packit Service 50c9f2
        Packit Service 50c9f2
        When using doxygen for Fortran code you should
        Packit Service 50c9f2
        set \ref cfg_optimize_for_fortran "OPTIMIZE_FOR_FORTRAN" to \c YES.
        Packit Service 50c9f2
        Packit Service 50c9f2
        The parser tries to guess if the source code is fixed format Fortran or
        Packit Service 50c9f2
        free format Fortran code. This may not always be correct. If not
        Packit Service 50c9f2
        one should use \ref cfg_extension_mapping "EXTENSION_MAPPING" to correct this.
        Packit Service 50c9f2
        By setting `EXTENSION_MAPPING =  f=FortranFixed f90=FortranFree` files with
        Packit Service 50c9f2
        extension \c f are interpreted as fixed format Fortran code and files with
        Packit Service 50c9f2
        extension \c f90 are interpreted as free format Fortran code.
        Packit Service 50c9f2
        Packit Service 50c9f2
        For Fortran "!>" or "!<" starts a comment and "!!" or "!>" can be used to 
        Packit Service 50c9f2
        continue an one line comment into a multi-line comment.
        Packit Service 50c9f2
        Packit Service 50c9f2
        Here is an example of a documented Fortran subroutine:
        Packit Service 50c9f2
        \code{.f}
        Packit Service 50c9f2
          !> Build the restriction matrix for the aggregation 
        Packit Service 50c9f2
          !! method.
        Packit Service 50c9f2
          !! @param aggr information about the aggregates
        Packit Service 50c9f2
          !! @todo Handle special case
        Packit Service 50c9f2
          subroutine IntRestBuild(A,aggr,Restrict,A_ghost)
        Packit Service 50c9f2
            implicit none
        Packit Service 50c9f2
            Type(SpMtx), intent(in) :: A !< our fine level matrix
        Packit Service 50c9f2
            Type(Aggrs), intent(in) :: aggr
        Packit Service 50c9f2
            Type(SpMtx), intent(out) :: Restrict !< Our restriction matrix
        Packit Service 50c9f2
            !...
        Packit Service 50c9f2
          end subroutine
        Packit Service 50c9f2
        \endcode
        Packit Service 50c9f2
        Packit Service 50c9f2
        As an alternative you can also use comments in fixed format code:
        Packit Service 50c9f2
        Packit Service 50c9f2
        \code{.f}
        Packit Service 50c9f2
        C> Function comment
        Packit Service 50c9f2
        C> another line of comment
        Packit Service 50c9f2
              function A(i)
        Packit Service 50c9f2
        C> input parameter
        Packit Service 50c9f2
                integer i
        Packit Service 50c9f2
              end function A
        Packit Service 50c9f2
        \endcode
        Packit Service 50c9f2
        Packit Service 50c9f2
        \subsection tclblocks Comment blocks in Tcl
        Packit Service 50c9f2
        Packit Service 50c9f2
        Doxygen documentation can be included in normal Tcl comments.
        Packit Service 50c9f2
        Packit Service 50c9f2
        To start a new documentation block start a line with \c ## (two hashes).
        Packit Service 50c9f2
        All following comment lines and continuation lines will be added to this
        Packit Service 50c9f2
        block. The block ends with a line not starting with a \c # (hash sign).
        Packit Service 50c9f2
        Packit Service 50c9f2
        A brief documentation can be added with \c ;#< (semicolon, hash and
        Packit Service 50c9f2
        lower then sign). The brief documentation also ends at a line not starting
        Packit Service 50c9f2
        with a \c # (hash sign).
        Packit Service 50c9f2
        Packit Service 50c9f2
        Inside doxygen comment blocks all normal doxygen markings are supported.
        Packit Service 50c9f2
        The only exceptions are described in the following two paragraphs.
        Packit Service 50c9f2
        Packit Service 50c9f2
        If a doxygen comment block ends with a line containing only
        Packit Service 50c9f2
        \c #\\code or \c #\@code all code until a line only containing \c #\\endcode
        Packit Service 50c9f2
        or \c #\@endcode is added to the generated documentation as code block.
        Packit Service 50c9f2
        Packit Service 50c9f2
        If a doxygen comment block ends with a line containing only
        Packit Service 50c9f2
        \c #\\verbatim or \c #\@verbatim all code until a line only containing
        Packit Service 50c9f2
        \c #\\endverbatim or \c #\@endverbatim is added verbatim to the generated
        Packit Service 50c9f2
        documentation.
        Packit Service 50c9f2
        Packit Service 50c9f2
        To detect namespaces, classes, functions and variables the following
        Packit Service 50c9f2
        Tcl commands are recognized. Documentation blocks can be put on the lines
        Packit Service 50c9f2
        before the command.
        Packit Service 50c9f2
        Packit Service 50c9f2
          Packit Service 50c9f2
        • <tt>namespace eval ..</tt> Namespace
        • Packit Service 50c9f2
        • <tt>proc ..</tt> Function
        • Packit Service 50c9f2
        • <tt>variable ..</tt> Variable
        • Packit Service 50c9f2
        • <tt>common ..</tt> Common variable
        • Packit Service 50c9f2
        • <tt>itcl::class ..</tt> Class
        • Packit Service 50c9f2
        • <tt>itcl::body ..</tt> Class method body definition
        • Packit Service 50c9f2
        • <tt>oo::class create ..</tt> Class
        • Packit Service 50c9f2
        • <tt>oo::define ..</tt> OO Class definition
        • Packit Service 50c9f2
        • <tt>method ..</tt> Class method definitions
        • Packit Service 50c9f2
        • <tt>constructor ..</tt> Class constructor
        • Packit Service 50c9f2
        • <tt>destructor ..</tt> Class destructor
        • Packit Service 50c9f2
        • <tt>public ..</tt> Set protection level
        • Packit Service 50c9f2
        • <tt>protected ..</tt> Set protection level
        • Packit Service 50c9f2
        • <tt>private ..</tt> Set protection level
        • Packit Service 50c9f2
          Packit Service 50c9f2
          Packit Service 50c9f2
          Packit Service 50c9f2
          To use your own keywords you an map these keyword to the recognized commands
          Packit Service 50c9f2
          using the \ref cfg_tcl_subs "TCL_SUBST" entry in the config file.
          Packit Service 50c9f2
          The entry contain a list of word-keyword mappings. To use the itcl::*
          Packit Service 50c9f2
          commands without the leading namespace use p.e.:
          Packit Service 50c9f2
          Packit Service 50c9f2
          \verbatim TCL_SUBST = class itcl:class body itcl:body \endverbatim
          Packit Service 50c9f2
          -->
          Packit Service 50c9f2
          Packit Service 50c9f2
          Following is an example using doxygen style comments:
          Packit Service 50c9f2
          Packit Service 50c9f2
          \include tclexample.tcl
          Packit Service 50c9f2
           \htmlonly
          Packit Service 50c9f2
           

          Packit Service 50c9f2
           Click here
          Packit Service 50c9f2
           for the corresponding HTML documentation that is generated by doxygen.
          Packit Service 50c9f2
           \endhtmlonly
          Packit Service 50c9f2
           \latexonly
          Packit Service 50c9f2
           See \hyperlink{tcl_example}{TCL example}
          Packit Service 50c9f2
           for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
          Packit Service 50c9f2
           \endlatexonly
          Packit Service 50c9f2
          Packit Service 50c9f2
          Packit Service 50c9f2
          \section docstructure Anatomy of a comment block
          Packit Service 50c9f2
          Packit Service 50c9f2
          The previous section focused on how to make the comments in your code known
          Packit Service 50c9f2
          to doxygen, it explained the difference between a brief and a detailed description, and
          Packit Service 50c9f2
          the use of structural commands.
          Packit Service 50c9f2
          Packit Service 50c9f2
          In this section we look at the contents of the comment block itself.
          Packit Service 50c9f2
          Packit Service 50c9f2
          Doxygen supports various styles of formatting your comments.
          Packit Service 50c9f2
          Packit Service 50c9f2
          The simplest form is to use plain text. This will appear as-is in the output 
          Packit Service 50c9f2
          and is ideal for a short description.
          Packit Service 50c9f2
          Packit Service 50c9f2
          For longer descriptions you often will find the 
          Packit Service 50c9f2
          need for some more structure, like a block of verbatim text, a list, or a 
          Packit Service 50c9f2
          simple table. For this doxygen supports the 
          Packit Service 50c9f2
          Markdown 
          Packit Service 50c9f2
          syntax, including parts of the
          Packit Service 50c9f2
          Markdown Extra
          Packit Service 50c9f2
          extension. 
          Packit Service 50c9f2
          Packit Service 50c9f2
          Markdown is designed to be very easy to read and write. 
          Packit Service 50c9f2
          It's formatting is inspired by plain text mail.
          Packit Service 50c9f2
          Markdown works great for simple, generic formatting, like an introduction
          Packit Service 50c9f2
          page for your project. Doxygen also supports reading of markdown files 
          Packit Service 50c9f2
          directly. For more details see chapter \ref markdown.
          Packit Service 50c9f2
          Packit Service 50c9f2
          For programming language specific formatting doxygen has two
          Packit Service 50c9f2
          forms of additional markup on top of Markdown formatting.
          Packit Service 50c9f2
          Packit Service 50c9f2
          1. Javadoc like markup.
          Packit Service 50c9f2
             See \ref commands for a complete overview of all commands supported by doxygen.
          Packit Service 50c9f2
          2. XML markup
          Packit Service 50c9f2
             as specified in the C# standard. See \ref xmlcmds for the XML commands supported by doxygen.
          Packit Service 50c9f2
          Packit Service 50c9f2
          If this is still not enough doxygen also supports a \ref htmlcmds "subset" of 
          Packit Service 50c9f2
          the HTML markup language.
          Packit Service 50c9f2
          Packit Service 50c9f2
          \htmlonly
          Packit Service 50c9f2
          Go to the next section or return to the
          Packit Service 50c9f2
           index.
          Packit Service 50c9f2
          \endhtmlonly
          Packit Service 50c9f2
          Packit Service 50c9f2
          */