1. Home
  2. Tutorials
  3. C/C++
  4. C++ Coding Style
Yolinux.com Tutorial

C++ Coding Practices, Style, Standards and document generation (dOxygen)

C++ Coding Standards and Practices:

Coding practices should be in place to maintain a consistancy among software projects to enforce a disciplines which improves the quality of software, improves reuseability due to more generic interfaces and good documentation, results in software with fewer bugs which is easier to use and maintain.

  • File Names:
    • There should be one include file for each source code file. Each include file should describe a single class or tightly integrated set of classes. The general guideline is for include (.h and .hpp) files to contain definitions and NOT instantiations. Thus the include file can be used in multiple files. The source file (.C or .cpp) defines code which when compiled gets loaded into memory. It instantiates definitions defined in the include file. For example, a class definition would be contained in the ".hpp" include file. A global variable would be instantiated in the ".cpp" file and NOT the ".hpp" file. This is because the global variable would be defined more than once if the include file was used more than once. An "extern" statement is appropriate for an include file as it does not declare memory for the variable but just recognises its existance.
    • File name should reflect the class name. While the class name typically starts with a capital letter, the include file and source files typically begin with lower case letters. i.e. file classBase.hpp will contain the definition of ClassBase{} and classBase.cpp will contain the source code to it's functions.
    • Class names should follow the following format: CXxClassID where "Xx" refers to the component. (i.e. Mn main, Fm File manager, Cp command processor) The first character of each word shall be capitalized. Leave off the "C" prefix when naming the file.
    • When referring to an include file within either another include file or source file, do NOT include the full path. This avoids portability problems created by operating system dependent methods of referencing directory paths. Use compiler command line flags to include the path. (i.e. -I/path-name)
    • Use double quotes ("") for all project include files and angle chevrons (<>) for include files provided by the operating system or compiler.
    • If burning ISO CD's, remember it is limited to file names of up to 30 characters.
    • To ease use with scripts and make files, file names (and directory paths) should not contain blanks, parentheses "(", or crazy characters not supported by a majority of operating systems.

  • File formats:
    • Line termination: For cross platform development, keep the "^M" line terminator out of files. They can be removed by the following:
      • Command: dos2unix filename.cpp
      • In vim: :1,$ s/{ctrl-V}{ctrl-M}//
      The "^M" can be kept out of the file using CM file property directives: svn propset svn:eol-style LF filename
      For more see the YoLinux.com Subversion tutorial.
    • If using MS/Visual studio, add a blank line at the end of the file with at least one blank space as this IDE may remove the perceived Unix "end-of-file" marker (ctrl-D). For more see the YoLinux.com MS/Visual C++ best practices guide.

  • File headers:
    • File headers should include copyright statements, distribution licensing references and reflect corporate practices. For example, if source code is released under the GNU license it should be stated as such. If the file contains corporate proprietary material, it should be stated as such. The segragation of such code into separate files is very important if the licensing, release practices for the file or copyrights are different.
    • Comments shall be placed at the top of each file stating the name of the file and comments on the file contents. Comments should be directed towards the users of the class contained in the file.
      See below: File Header Comments

  • Header files:
    • C++ header files often use the suffix ".hpp" while "C" header files use ".h" suffix.
    • Use the preprocessor to check for multiple inclusions.
      1#ifndef CLASS_NAME_H
      2#define CLASS_NAME_H
      3...
      4..
      5#endif
    • Reduce the number of #include files in header files. It will reduce build times. Instead, put include files in source code files and use forward declarations in header files. If a class in a header file does not need to know the size of a data member class or does not need to use the class's members then forward declare the class instead of including the file with #include. To avoid the need of a full class declaration, use references (or pointers) and forward declare the class.

      Example of forward declaration:

      1class ClassName;
      [Potential Pitfall]: STL collections (like std::list and std::vector) and typedefs can not use forward declarations and thus #include must be used.
    • If C functions will be called from C++, then C include files will use the following declaration:
      01#ifdef __cplusplus
      02extern "C" {
      03#endif
      04...
      05..
      06C function declarations
      07..
      08...
      09#ifdef __cplusplus
      10}
      11#endif
    • Avoid the use of "namespace" in the ".hpp" include file. If the file is included in source code the programmer may no longer use variables defined in the namespace and may experience variable name clash.

  • Classes and Structs:
    • Standard practice is for class and struct definitions to begin with a capital letter. Base classes will often have the suffix "Base" appended to the class name. Be sure to add virtual (not pure virtual thus not "=0") to the base class destructors so both destructors are called.
    • Example Class contents:
      01class ClassName
      02{
      03  public:
      04     // Constructors:
      05     // Destructor:
      06     // Functions: modifiers (set), selectors (get)
      07     // itterators:
      08     // Attributes visible by scope of instantiation and use
      09  protected:
      10     // Attributes visible to descendents
      11  private:
      12     // Local attributes
      13};

  • Machine dependent code shall, if possible, be placed in a separate file so that it may ease porting tasks.

  • Functions/subroutines:
    • Length: It makes no sense to set a rule or hard limit on the length of a function. A human should be able to fully understand the complexity of a single function. If one can't, then it needs to be broken down into a smaller understandable size. It makes no sense to break a 3000 line function into smaller components if all it consists of is a massive case/switch statement which can be grasped upon first viewing. Complex algorithms should be broken up into understandable units and may be too long at 50 lines of code. Thus the length of a function requires common sense more than a rule which sets a hard limit.
    • List functions in ".cpp" file in the same order in which they are declared in the ".hpp" class declaration.
    • Names: Use complement names for complement functions: get/set, add/remove, create/destroy, start/stop, insert/delete, increment/decrement, begin/end, first/last, up/down, min/max, next/previous, open/close, show/hide, suspend/resume, etc.
    • Use keyword "const" to indicate that a variable or function parameter does not change.

  • Use of case:
    • Use capital leters with an underscore used to separate words for macro constants and enumerations.
    • Use a single capital letter to denote the start of a new word in the variable, class or function name.
      Example: thisIsAnExample
    • Function names should begin with a lower case letter.
    • Class definitions begin with a capital letter. The "C" prefix is "Hungarian" notation as noted below. The instantiation should begin with a lower case letter.
      Example: CAbcXyz abcXyz

  • Don't use equality (==) comparisons between floating point numbers and 0.0.

  • Enumerations: Assign enumerations using the scope from which they are declared:
    1class ClassName
    2{
    3   enum Month { January, February };
    4}
    5 
    6Month tmpMonth = ClassName::January;
    Do not use: Month tmpMonth = ClassName::Month::January;

  • Formatting of C++ sytax: Various existing syntax styles have been defined for corporate and open source projects including the Linux kernel ("C") itself. Some corporate styles such as Ellemtel and others have been incorporated into the Emacs editor as an option. See the YoLinux.com Emacs tutorial and the "beautify" feature. Here are some of my favorites:
    • Operators should have a space on wither side of them: +, -, <. >, =, ==, ...
    • Use spaces for indentation. Don't use tabs as different IDEs and editors may treat them differently. Also see the YoLinux.com MS/Visual C++ best practices tutorial to avoid cross platform pitfalls.
    • Break up long Boolean expressions and parameter lists onto separate lines with appropriate indentation for alignment.
      1if( longVariableNameAbc < longVariableNameDef &&
      2    longVariableNameIjk < longVariableNameXyz)
      3{
      4}
    • Braces: The above example also shows the use of "unsnuggled braces" which I preffer (but some others do not). Pick one style and stick with it for your project.

Camel-case:

Camel-case is the practice of changing the letter to upper case to denote the start of a new word. This allows the name to be shorter because no separator character (i.e. "_" used between words.) The Camel-case practice uses a "_" separator between upper case constants used in words.

Examples:

  • VariableForTheBlueTeam
  • variableForTheBlueTeamInstantiation
  • SPAM_Eliminator

C++ variable naming convention and style:

"Hungarian" prefixes: Some of these are discussed in the book "Code Complete" and others I have seen in corporate coding standards. While these are prefixes (beginning of name) I have also seen some used as suffixes (end of name).

PrefixDescription
m_
my_
Variable is a member of class. Some use the prefix "my" for class member variables and "our" for class member static variables. (Also "m" and "ms" for member and member-static) I have also seen the use of "_" as both a prefix and as a suffix to denote a class member variable. If using mixed languages remember that many FORTRAN compilers use a "_" suffix. Due to C++ name mangling there will probably be no conflict when using this notation. It is a common practice but theoretically could pose a problem with mixed languages. See Mixing FORTRAN and C YoLinux tutorial.
_
(underscore)
  • Variable not intended to be exposed externally to the user. Internal workings only. Most often used by compiler and library authors.
  • Sometimes used (not preferred) as a suffix to repressent a class member variable.
  • Sometimes used as variable prefix for function arguments. When used with function arguments, it can represent in/out/inout:
    • _variable: Function input variable. More explicit: _inVariable
    • variable_: Function output variable. More explicit: outVariable_
    • _variable_: Input/output by function. More explicit: _inoutVariable_

Note: Dangerous when mixing C with FORTRAN as FUNCTION subroutines as suffixed with "_" in the object code. See nm to view object symbols. See the g77/f77 compiler flag "-fno-underscore".

__ Marks an use as extension to ANSI C++. Often not compiler independant. Usually reserved for use by compiler writers so it is best to avoid the double underscore.

Note: Be careful when mixing with FORTRAN as "__" is often generated in FORTRAN object symbol names. See the f77 compiler flag "-fno-second-underscore". Also used in Microsoft "Managed C++" directives.

a array
c
n
count / number of
cb count bytes / number of bytes
d Data type double
dw Data type double word
e an enumeration or element of an array
b
f
is
has
should
boolean
(flag)
Example: isFound
Note: accessor functions can also use these same prefixes: bool isBoolean{ return mBoolean; }
g_

g gbl
Gbl
global variable. Also used is the "::" operator. i.e. ::variable
s
s_
Static variable
h handle
i index to an array or STL iterator
l long data type. i.e. "long int"
p
ptr
pointer. Sometimes "Ptr" used as suffix.
lp pointer to long data type
ch C character
sz Zero terminated string. char[]
str C++ GNU template data type "string"
u unsigned
ev event
min Lowest value
first First element
lim array limit
cmd Command
cmp Compare
init Initialize
intr Interrupt
msg Message
rx Recieve
tx Transmit
C Prefix for a Class name. Notation used by Microsoft MFC.
Example: CAbcXyz abcXyz
Note: The instatiation begins with a lower case letter while the class definition begins with a capital letter.
_t
_Type
Type definition (typedef - suffix). Prefix with capital letter.
_Enum Enumeration type definition suffix.
_ds Data structure suffix.

Hungarian Examples:

  • ppachVarName: pointer to a pointer of an array of characters.
  • m_ppachVarName: class member variable which is a pointer to a pointer of an array of characters.
The use of "Hungarian" should make the code more readable and NOT more complicated so use it wisely and consistently. Many corporate standards will choose a subset of the above. eg. m, _, g, s, e, b, i, n.

Introductory File Header Comments:

This is usually set as a project or corporate standard and include copyrights, statements of ownership, trade secret statements, author's name,....
For example:

01// ----------------------------------------------------------------------------
02/**
03   File: ProjectXXX.suffix
04   
05   System:         Super Product X
06   Component Name: Project X, Module B
07   Status:         Version 1.0 Release 1 
08   [Note: depricated practice. CM systems like Subversion will maintain file history.]
09   Language: C++
10   
11   License: GNU Public License
12    or other... i.e.
13   Licensed Material - Property of Mega Corp
14   
15   (c) Copyright Mega Corp 2008
16   
17   Address:
18      Mega Corp, Super Product X Division
19      134950 Sepulveda Blvd.
20      Los Angeles CA 90211
21   
22   Author: John Doe
23   E-Mail: John.Doe@MegaCorp.com
24   [Note: Not required if using CM systems like Subversion which maintain author info and file history.]
25   
26   Description: Header file for Project X
27                This file contains the defined types for Project X
28                This is sometimes called the "Abstract" and may be
29                followed by a section called "Notes".
30 
31   Limitations: bla bla bla
32   
33   Function: 1) bla bla bla
34             2) bla bla bla
35             3) bla bla bla
36   
37   Database tables used:
38   
39   Thread Safe: No
40   
41   Extendable: No
42   
43   Platform Dependencies: None      (i.e.: Linux/Intel, IRIX/Mips, Solaris/SPARC)
44 
45   Compiler Options: -lm
46   
47   Change History:                  (Sometimes called "Revisions")
48   [Note: this is no longer necesary if using a CM system like Subversion.
49          Subversion will hold check-in comments and note the author of the change.]
50   Date         Author       Description
51*/ 
52// ----------------------------------------------------------------------------
53...
54..
55.
56..
57...
58// ----------------------------------------------------------------------------
59/**
60   Routine: NameOfRoutine()
61   Inputs:
62      Arguments:
63      Externals:
64      Others:
65   
66   Outputs:
67      Arguments:
68      Externals:
69      Returns:
70      Errors:
71   
72   Routines Called:
73*/  
74// ----------------------------------------------------------------------------
Note:
  • Comments should NOT contain code as it may get out of sync with the code itself.
  • CM systems handle author (with email address), change history and date. No need to duplicate this information if CM is handling this for you.
  • Version numbers can be embedded into checked out code by the CM system. No need for this to be performed manually if managed by CM.
  • See dOxygen (below) for coding style used to comment function in/out parameters.

C++ Automated Documentation Generation:

  • ScanDoc: Perl script which scans C++ source code for specially-formatted comments and produces organized, indexed documentation.
    scandoc home page
  • HeaderBrowser: Create documents from file headers
    HeaderBrowser home page

dOxygen and C++ Automated Documentation Generation:

dOxygen: cross-platform, JavaDoc-like documentation system for C++, Java, C, and IDL. DOxygen is included with the base release of most Linux distributions including Red Hat and SuSE. DOxygen tags support two basic format styles, \tagname or @tagname. The later is the Javadoc style which is shown in this tutorial.

Doxygen home page - doxygen freshmeat page

Example:

01// $Id$
02/**
03 * @file sourceFile.cpp
04 * Write description of source file here for dOxygen.
05 *
06 * @brief Can use "brief" tag to explicitly generate comments for file documentation.
07 *
08 * @author Me
09   [Note: depricated practice as CM systems like Subversion will maintain author info and blame logs.]
10 * @version 1.69
11   [Note: depricated practice as CM systems like Subversion will maintain file history and revision numbers.]
12 */
13// $Log$
14  
15///  Single line comment for dOxygen.
16  
17/**
18   Write description of function here.
19   The function should follow these comments.
20   Use of "brief" tag is optional. (no point to it)
21   
22   The function arguments listed with "param" will be compared
23   to the declaration and verified.
24 
25   @param[in]     _inArg1 Description of first function argument.
26   @param[out]    _outArg2 Description of second function argument.
27   @param[in,out] _inoutArg3 Description of third function argument.
28   @return Description of returned value.
29 */
30  
31int
32class::function(int _inArg1, int& _outArg2, int& _inoutArg3)
33{
34  
35    /// Single line comment for dOxygen.
36}
Note the tags "$Id$" and "$Log$" are used by RCS.

Headings generated from tags:

dOxygen tag Rendering
@file file-name Prints file-name as header of page.
@brief Brief description goes here. Description appears in HTML document generated.
@details Brief description goes here. Description of function which appears in HTML document generated.
@author name1
@author name2
Author:
name1
name2
@version Version number Version:
Version number()
@depricated explanation Depricated:
explanation
@class CAaaBbb  
@see FunctionA() See also:
FunctionA()
@param[in] variableA DescriptionA
@param[out] variableB DescriptionB
@param[in,out] variableC DescriptionC
Note: in and out are dOxygen specific and not used in Javadoc.
Parameters:
variableA DescriptionA
variableB DescriptionB
variableC DescriptionC
@return variableA Returns:
variableA
@bug Description of bug goes here Bug:
Description of bug goes here
@warning Warning message goes here Warning:
Warning message goes here

Full list of dOxygen Tags: http://www.stack.nl/~dimitri/doxygen/commands.html
Javadoc tags: http://java.sun.com/j2se/javadoc/writingdoccomments/
Note the difference between the dOxygen @throw and the Javadoc @throws tag.

dOxygen tags for @brief are not necessary if using JAVADOC_AUTOBRIEF (yes) mode. this will print the first line in a "/**" comment block as the brief description.

The tagged dOxygen comments are placed ahead of the C++ function, class or variable. Comments placed after a C++ entity can be tagged with "/**< ... */".

01/** Comments on C++ function
02 ...
03 ...
04 */
05 
06void classA::function_1( int   variable1, /**< Comment on variable goes here. */
07                         float variable2, /**< Comment on variable goes here. */
08                         ...                   ,
09                         ... )
10{
11   ...
Note: It is only usefull to apply this to an include file (.h, .hpp) or functions in a ".cpp" or ".C" file, but not both. If attributed in both, then the "Attributes" section and comments will appear in the documentation twice.

Create a list:

1/**  List heading:
2     - Stuff on line 1
3     - Stuff on line 2
4     - Stuff on line 3
5       - Stuff on sub-line 1
6       - Stuff on sub-line 2
7     - Stuff on line 4
8 */
This creates a bulletized list in HTML. To generate a numbered list use "-#". One may also use HTML directly in the comment block. See http://www.stack.nl/~dimitri/doxygen/htmlcmds.html

Pages of documentation are defined by a group. You can specify the group directly using the tags:

  • @defgroup
  • @ingroup

The group is delimited by:

1//@{
2...
3...
4//@}

Documentation Main Page:

This is the home page or first page of the documentation which is defined by the "@mainpage" tag:
01/** @mainpage ProjectX: bla, bla, bla
02*   @par Description:
03*   - Point 1 bla, bla, bla
04*   - Point 2 bla, bla, bla
05*   - Point 3 bla, bla, bla
06*
07*   @par Next paragraph - more information:
08*    bla, bla, bla
09*    bla, bla, bla
10*/

Display on main home page of documentation:

ProjectX: bla, bla, bla

Description:
  • Point 1 bla, bla, bla
  • Point 2 bla, bla, bla
  • Point 3 bla, bla, bla

Next paragraph - more information:
bla, bla, bla
bla, bla, bla

Configuration file: project-name.cfg
Create template configuration file and tag descriptions with the command: doxygen -g project-name.cfg

001# Doxyfile 1.4.4
002 
003# This file describes the settings to be used by the documentation system
004# doxygen (www.doxygen.org) for a project
005#
006# All text after a hash (#) is considered a comment and will be ignored
007# The format is:
008#       TAG = value [value, ...]
009# For lists items can also be appended using:
010#       TAG += value [value, ...]
011# Values that contain spaces should be placed between quotes (" ")
012 
013#---------------------------------------------------------------------------
014# Project related configuration options
015#---------------------------------------------------------------------------
016 
017PROJECT_NAME      = "Project XXX"
018PROJECT_NUMBER         =
019OUTPUT_DIRECTORY  = project
020CREATE_SUBDIRS         = NO
021OUTPUT_LANGUAGE        = English
022USE_WINDOWS_ENCODING   = NO
023 
024# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
025# include brief member descriptions after the members that are listed in
026# the file and class documentation (similar to JavaDoc).
027# Set to NO to disable this.
028BRIEF_MEMBER_DESC      = YES
029 
030# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
031# the brief description of a member or function before the detailed description.
032# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
033# brief descriptions will be completely suppressed.
034REPEAT_BRIEF           = YES
035 
036# This tag implements a quasi-intelligent brief description abbreviator
037# that is used to form the text in various listings. Each string
038# in this list, if found as the leading text of the brief description, will be
039# stripped from the text and the result after processing the whole list, is
040# used as the annotated text. Otherwise, the brief description is used as-is.
041# If left blank, the following values are used ("$name" is automatically
042# replaced with the name of the entity): "The $name class" "The $name widget"
043# "The $name file" "is" "provides" "specifies" "contains"
044# "represents" "a" "an" "the"
045ABBREVIATE_BRIEF       =
046 
047# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
048# Doxygen will generate a detailed section even if there is only a brief
049# description.
050ALWAYS_DETAILED_SEC    = NO
051 
052# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
053# inherited members of a class in the documentation of that class as if those
054# members were ordinary class members. Constructors, destructors and assignment
055# operators of the base classes will not be shown.
056INLINE_INHERITED_MEMB  = NO
057 
058# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
059# path before files name in the file list and in the header files. If set
060# to NO the shortest path that makes the file name unique will be used.
061FULL_PATH_NAMES        = NO
062 
063# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
064# can be used to strip a user-defined part of the path. Stripping is
065# only done if one of the specified strings matches the left-hand part of
066# the path. The tag can be used to show relative paths in the file list.
067# If left blank the directory from which doxygen is run is used as the
068# path to strip.
069STRIP_FROM_PATH        =
070 
071# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
072# the path mentioned in the documentation of a class, which tells
073# the reader which header file to include in order to use a class.
074# If left blank only the name of the header file containing the class
075# definition is used. Otherwise one should specify the include paths that
076# are normally passed to the compiler using the -I flag.
077STRIP_FROM_INC_PATH    =
078 
079# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
080# (but less readable) file names. This can be useful is your file systems
081# doesn't support long names like on DOS, Mac, or CD-ROM.
082SHORT_NAMES            = NO
083 
084# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
085# will interpret the first line (until the first dot) of a JavaDoc-style
086# comment as the brief description. If set to NO, the JavaDoc
087# comments will behave just like the Qt-style comments (thus requiring an
088# explicit @brief command for a brief description.
089JAVADOC_AUTOBRIEF      = YES
090 
091# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
092# treat a multi-line C++ special comment block (i.e. a block of //! or ///
093# comments) as a brief description. This used to be the default behaviour.
094# The new default is to treat a multi-line C++ comment block as a detailed
095# description. Set this tag to YES if you prefer the old behaviour instead.
096MULTILINE_CPP_IS_BRIEF = NO
097 
098# If the DETAILS_AT_TOP tag is set to YES then Doxygen
099# will output the detailed description near the top, like JavaDoc.
100# If set to NO, the detailed description appears after the member
101# documentation.
102DETAILS_AT_TOP         = NO
103 
104# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
105# member inherits the documentation from any documented member that it
106# re-implements.
107INHERIT_DOCS           = YES
108 
109# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
110# tag is set to YES, then doxygen will reuse the documentation of the first
111# member in the group (if any) for the other members of the group. By default
112# all members of a group must be documented explicitly.
113DISTRIBUTE_GROUP_DOC   = NO
114 
115# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
116# a new page for each member. If set to NO, the documentation of a member will
117# be part of the file/class/namespace that contains it.
118SEPARATE_MEMBER_PAGES  = NO
119 
120# The TAB_SIZE tag can be used to set the number of spaces in a tab.
121# Doxygen uses this value to replace tabs by spaces in code fragments.
122TAB_SIZE               = 4
123 
124# This tag can be used to specify a number of aliases that acts
125# as commands in the documentation. An alias has the form "name=value".
126# For example adding "sideeffect=\par Side Effects:\n" will allow you to
127# put the command \sideeffect (or @sideeffect) in the documentation, which
128# will result in a user-defined paragraph with heading "Side Effects:".
129# You can put \n's in the value part of an alias to insert newlines.
130ALIASES                =
131 
132# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
133# sources only. Doxygen will then generate output that is more tailored for C.
134# For instance, some of the names that are used will be different. The list
135# of all members will be omitted, etc.
136OPTIMIZE_OUTPUT_FOR_C  = YES
137 
138# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources
139# only. Doxygen will then generate output that is more tailored for Java.
140# For instance, namespaces will be presented as packages, qualified scopes
141# will look different, etc.
142OPTIMIZE_OUTPUT_JAVA   = NO
143 
144# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
145# the same type (for instance a group of public functions) to be put as a
146# subgroup of that type (e.g. under the Public Functions section). Set it to
147# NO to prevent subgrouping. Alternatively, this can be done per class using
148# the \nosubgrouping command.
149SUBGROUPING            = YES
150 
151#---------------------------------------------------------------------------
152# Build related configuration options
153#---------------------------------------------------------------------------
154 
155# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
156# documentation are documented, even if no documentation was available.
157# Private class members and static file members will be hidden unless
158# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
159EXTRACT_ALL            = YES
160 
161# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
162# will be included in the documentation.
163EXTRACT_PRIVATE        = NO
164 
165# If the EXTRACT_STATIC tag is set to YES all static members of a file
166# will be included in the documentation.
167EXTRACT_STATIC         = NO
168 
169# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
170# defined locally in source files will be included in the documentation.
171# If set to NO only classes defined in header files are included.
172EXTRACT_LOCAL_CLASSES  = YES
173 
174# This flag is only useful for Objective-C code. When set to YES local
175# methods, which are defined in the implementation section but not in
176# the interface are included in the documentation.
177# If set to NO (the default) only methods in the interface are included.
178EXTRACT_LOCAL_METHODS  = NO
179 
180# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
181# undocumented members of documented classes, files or namespaces.
182# If set to NO (the default) these members will be included in the
183# various overviews, but no documentation section is generated.
184# This option has no effect if EXTRACT_ALL is enabled.
185HIDE_UNDOC_MEMBERS     = NO
186 
187# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
188# undocumented classes that are normally visible in the class hierarchy.
189# If set to NO (the default) these classes will be included in the various
190# overviews. This option has no effect if EXTRACT_ALL is enabled.
191HIDE_UNDOC_CLASSES     = NO
192 
193# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
194# friend (class|struct|union) declarations.
195# If set to NO (the default) these declarations will be included in the
196# documentation.
197HIDE_FRIEND_COMPOUNDS  = NO
198 
199# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
200# documentation blocks found inside the body of a function.
201# If set to NO (the default) these blocks will be appended to the
202# function's detailed documentation block.
203HIDE_IN_BODY_DOCS      = NO
204 
205# The INTERNAL_DOCS tag determines if documentation
206# that is typed after a \internal command is included. If the tag is set
207# to NO (the default) then the documentation will be excluded.
208# Set it to YES to include the internal documentation.
209INTERNAL_DOCS          = NO
210 
211# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
212# file names in lower-case letters. If set to YES upper-case letters are also
213# allowed. This is useful if you have classes or files whose names only differ
214# in case and if your file system supports case sensitive file names. Windows
215# and Mac users are advised to set this option to NO.
216CASE_SENSE_NAMES       = YES
217 
218# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
219# will show members with their full class and namespace scopes in the
220# documentation. If set to YES the scope will be hidden.
221HIDE_SCOPE_NAMES       = NO
222 
223# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
224# will put a list of the files that are included by a file in the documentation
225# of that file.
226SHOW_INCLUDE_FILES     = YES
227 
228# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
229# is inserted in the documentation for inline members.
230INLINE_INFO            = YES
231 
232# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
233# will sort the (detailed) documentation of file and class members
234# alphabetically by member name. If set to NO the members will appear in
235# declaration order.
236SORT_MEMBER_DOCS       = YES
237 
238# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
239# brief documentation of file, namespace and class members alphabetically
240# by member name. If set to NO (the default) the members will appear in
241# declaration order.
242SORT_BRIEF_DOCS        = NO
243 
244# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
245# sorted by fully-qualified names, including namespaces. If set to
246# NO (the default), the class list will be sorted only by class name,
247# not including the namespace part.
248# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
249# Note: This option applies only to the class list, not to the
250# alphabetical list.
251SORT_BY_SCOPE_NAME     = NO
252 
253# The GENERATE_TODOLIST tag can be used to enable (YES) or
254# disable (NO) the todo list. This list is created by putting \todo
255# commands in the documentation.
256GENERATE_TODOLIST      = YES
257 
258# The GENERATE_TESTLIST tag can be used to enable (YES) or
259# disable (NO) the test list. This list is created by putting \test
260# commands in the documentation.
261GENERATE_TESTLIST      = YES
262 
263# The GENERATE_BUGLIST tag can be used to enable (YES) or
264# disable (NO) the bug list. This list is created by putting \bug
265# commands in the documentation.
266GENERATE_BUGLIST       = YES
267 
268# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
269# disable (NO) the deprecated list. This list is created by putting
270# \deprecated commands in the documentation.
271GENERATE_DEPRECATEDLIST= YES
272 
273# The ENABLED_SECTIONS tag can be used to enable conditional
274# documentation sections, marked by \if sectionname ... \endif.
275ENABLED_SECTIONS       =
276 
277# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
278# the initial value of a variable or define consists of for it to appear in
279# the documentation. If the initializer consists of more lines than specified
280# here it will be hidden. Use a value of 0 to hide initializers completely.
281# The appearance of the initializer of individual variables and defines in the
282# documentation can be controlled using \showinitializer or \hideinitializer
283# command in the documentation regardless of this setting.
284MAX_INITIALIZER_LINES  = 30
285 
286# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
287# at the bottom of the documentation of classes and structs. If set to YES the
288# list will mention the files that were used to generate the documentation.
289SHOW_USED_FILES        = YES
290 
291# If the sources in your project are distributed over multiple directories
292# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
293# in the documentation. The default is YES.
294SHOW_DIRECTORIES       = YES
295 
296# The FILE_VERSION_FILTER tag can be used to specify a program or script that
297# doxygen should invoke to get the current version for each file (typically from the
298# version control system). Doxygen will invoke the program by executing (via
299# popen()) the command  , where  is the value of
300# the FILE_VERSION_FILTER tag, and  is the name of an input file
301# provided by doxygen. Whatever the progam writes to standard output
302# is used as the file version. See the manual for examples.
303FILE_VERSION_FILTER    =
304 
305#---------------------------------------------------------------------------
306# configuration options related to warning and progress messages
307#---------------------------------------------------------------------------
308 
309# The QUIET tag can be used to turn on/off the messages that are generated
310# by doxygen. Possible values are YES and NO. If left blank NO is used.
311QUIET                  = NO
312WARNINGS               = YES
313WARN_IF_UNDOCUMENTED   = YES
314WARN_IF_DOC_ERROR      = YES
315WARN_NO_PARAMDOC       = NO
316WARN_FORMAT            = "$file:$line: $text"
317WARN_LOGFILE           =
318 
319#---------------------------------------------------------------------------
320# configuration options related to the input files
321#---------------------------------------------------------------------------
322 
323# The INPUT tag can be used to specify the files and/or directories that contain
324# documented source files. You may enter file names like "myfile.cpp" or
325# directories like "/usr/src/myproject". Separate the files or directories
326# with spaces.
327INPUT                  =
328 
329# If the value of the INPUT tag contains directories, you can use the
330# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
331# and *.h) to filter out the source-files in the directories. If left
332# blank the following patterns are tested:
333# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
334# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm
335FILE_PATTERNS          =
336 
337# The RECURSIVE tag can be used to turn specify whether or not subdirectories
338# should be searched for input files as well. Possible values are YES and NO.
339# If left blank NO is used.
340RECURSIVE              = NO
341 
342# The EXCLUDE tag can be used to specify files and/or directories that should
343# excluded from the INPUT source files. This way you can easily exclude a
344# subdirectory from a directory tree whose root is specified with the INPUT tag.
345EXCLUDE                =
346 
347# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
348# directories that are symbolic links (a Unix filesystem feature) are excluded
349# from the input.
350EXCLUDE_SYMLINKS       = NO
351 
352# If the value of the INPUT tag contains directories, you can use the
353# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
354# certain files from those directories. Note that the wildcards are matched
355# against the file with absolute path, so to exclude all test directories
356# for example use the pattern */test/*
357EXCLUDE_PATTERNS       =
358 
359# The EXAMPLE_PATH tag can be used to specify one or more files or
360# directories that contain example code fragments that are included (see
361# the \include command).
362EXAMPLE_PATH           =
363 
364# If the value of the EXAMPLE_PATH tag contains directories, you can use the
365# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
366# and *.h) to filter out the source-files in the directories. If left
367# blank all files are included.
368EXAMPLE_PATTERNS       =
369 
370# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
371# searched for input files to be used with the \include or \dontinclude
372# commands irrespective of the value of the RECURSIVE tag.
373# Possible values are YES and NO. If left blank NO is used.
374EXAMPLE_RECURSIVE      = NO
375 
376# The IMAGE_PATH tag can be used to specify one or more files or
377# directories that contain image that are included in the documentation (see
378# the \image command).
379IMAGE_PATH             =
380 
381# The INPUT_FILTER tag can be used to specify a program that doxygen should
382# invoke to filter for each input file. Doxygen will invoke the filter program
383# by executing (via popen()) the command  , where 
384# is the value of the INPUT_FILTER tag, and  is the name of an
385# input file. Doxygen will then use the output that the filter program writes
386# to standard output.  If FILTER_PATTERNS is specified, this tag will be
387# ignored.
388INPUT_FILTER           =
389 
390# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
391# basis.  Doxygen will compare the file name with each pattern and apply the
392# filter if there is a match.  The filters are a list of the form:
393# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
394# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
395# is applied to all files.
396FILTER_PATTERNS        =
397 
398# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
399# INPUT_FILTER) will be used to filter the input files when producing source
400# files to browse (i.e. when SOURCE_BROWSER is set to YES).
401FILTER_SOURCE_FILES    = NO
402 
403#---------------------------------------------------------------------------
404# configuration options related to source browsing
405#---------------------------------------------------------------------------
406 
407# If the SOURCE_BROWSER tag is set to YES then a list of source files will
408# be generated. Documented entities will be cross-referenced with these sources.
409# Note: To get rid of all source code in the generated output, make sure also
410# VERBATIM_HEADERS is set to NO.
411SOURCE_BROWSER         = YES
412 
413# Setting the INLINE_SOURCES tag to YES will include the body
414# of functions and classes directly in the documentation.
415INLINE_SOURCES         = NO
416 
417# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
418# doxygen to hide any special comment blocks from generated source code
419# fragments. Normal C and C++ comments will always remain visible.
420STRIP_CODE_COMMENTS    = YES
421 
422# If the REFERENCED_BY_RELATION tag is set to YES (the default)
423# then for each documented function all documented
424# functions referencing it will be listed.
425REFERENCED_BY_RELATION = YES
426 
427# If the REFERENCES_RELATION tag is set to YES (the default)
428# then for each documented function all documented entities
429# called/used by that function will be listed.
430REFERENCES_RELATION    = YES
431 
432# If the USE_HTAGS tag is set to YES then the references to source code
433# will point to the HTML generated by the htags(1) tool instead of doxygen
434# built-in source browser. The htags tool is part of GNU's global source
435# tagging system (see http://www.gnu.org/software/global/global.html). You
436# will need version 4.8.6 or higher.
437USE_HTAGS              = NO
438 
439# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
440# will generate a verbatim copy of the header file for each class for
441# which an include is specified. Set to NO to disable this.
442VERBATIM_HEADERS       = YES
443 
444#---------------------------------------------------------------------------
445# configuration options related to the alphabetical class index
446#---------------------------------------------------------------------------
447 
448# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
449# of all compounds will be generated. Enable this if the project
450# contains a lot of classes, structs, unions or interfaces.
451ALPHABETICAL_INDEX     = YES
452 
453# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
454# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
455# in which this list will be split (can be a number in the range [1..20])
456COLS_IN_ALPHA_INDEX    = 5
457 
458# In case all classes in a project start with a common prefix, all
459# classes will be put under the same header in the alphabetical index.
460# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
461# should be ignored while generating the index headers.
462IGNORE_PREFIX          =
463 
464#---------------------------------------------------------------------------
465# configuration options related to the HTML output
466#---------------------------------------------------------------------------
467 
468# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
469# generate HTML output.
470GENERATE_HTML          = YES
471 
472# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
473# If a relative path is entered the value of OUTPUT_DIRECTORY will be
474# put in front of it. If left blank `html' will be used as the default path.
475HTML_OUTPUT            = html
476 
477# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
478# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
479# doxygen will generate files with .html extension.
480HTML_FILE_EXTENSION    = .html
481 
482# The HTML_HEADER tag can be used to specify a personal HTML header for
483# each generated HTML page. If it is left blank doxygen will generate a
484# standard header.
485HTML_HEADER            =
486 
487# The HTML_FOOTER tag can be used to specify a personal HTML footer for
488# each generated HTML page. If it is left blank doxygen will generate a
489# standard footer.
490HTML_FOOTER            =
491 
492# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
493# style sheet that is used by each HTML page. It can be used to
494# fine-tune the look of the HTML output. If the tag is left blank doxygen
495# will generate a default style sheet. Note that doxygen will try to copy
496# the style sheet file to the HTML output directory, so don't put your own
497# stylesheet in the HTML output directory as well, or it will be erased!
498HTML_STYLESHEET        =
499 
500# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
501# files or namespaces will be aligned in HTML using tables. If set to
502# NO a bullet list will be used.
503HTML_ALIGN_MEMBERS     = YES
504 
505# If the GENERATE_HTMLHELP tag is set to YES, additional index files
506# will be generated that can be used as input for tools like the
507# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
508# of the generated HTML documentation.
509GENERATE_HTMLHELP      = NO
510 
511# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
512# be used to specify the file name of the resulting .chm file. You
513# can add a path in front of the file if the result should not be
514# written to the html output directory.
515CHM_FILE               =
516 
517# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
518# be used to specify the location (absolute path including file name) of
519# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
520# the HTML help compiler on the generated index.hhp.
521HHC_LOCATION           =
522 
523# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
524# controls if a separate .chi index file is generated (YES) or that
525# it should be included in the master .chm file (NO).
526GENERATE_CHI           = NO
527 
528# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
529# controls whether a binary table of contents is generated (YES) or a
530# normal table of contents (NO) in the .chm file.
531BINARY_TOC             = NO
532 
533# The TOC_EXPAND flag can be set to YES to add extra items for group members
534# to the contents of the HTML help documentation and to the tree view.
535TOC_EXPAND             = NO
536 
537# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
538# top of each HTML page. The value NO (the default) enables the index and
539# the value YES disables it.
540DISABLE_INDEX          = NO
541 
542# This tag can be used to set the number of enum values (range [1..20])
543# that doxygen will group on one line in the generated HTML documentation.
544ENUM_VALUES_PER_LINE   = 4
545 
546# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
547# generated containing a tree-like index structure (just like the one that
548# is generated for HTML Help). For this to work a browser that supports
549# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
550# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
551# probably better off using the HTML help feature.
552GENERATE_TREEVIEW      = YES
553 
554# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
555# used to set the initial width (in pixels) of the frame in which the tree
556# is shown.
557TREEVIEW_WIDTH         = 250
558 
559#---------------------------------------------------------------------------
560# configuration options related to the LaTeX output
561#---------------------------------------------------------------------------
562 
563GENERATE_LATEX         = NO
564LATEX_OUTPUT           = latex
565LATEX_CMD_NAME         = latex
566MAKEINDEX_CMD_NAME     = makeindex
567COMPACT_LATEX          = NO
568 
569# The PAPER_TYPE tag can be used to set the paper type that is used
570# by the printer. Possible values are: a4, a4wide, letter, legal and
571# executive. If left blank a4wide will be used.
572PAPER_TYPE             = a4wide
573 
574# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
575# packages that should be included in the LaTeX output.
576EXTRA_PACKAGES         =
577 
578# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
579# the generated latex document. The header should contain everything until
580# the first chapter. If it is left blank doxygen will generate a
581# standard header. Notice: only use this tag if you know what you are doing!
582LATEX_HEADER           =
583 
584# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
585# is prepared for conversion to pdf (using ps2pdf). The pdf file will
586# contain links (just like the HTML output) instead of page references
587# This makes the output suitable for online browsing using a pdf viewer.
588PDF_HYPERLINKS         = NO
589 
590# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
591# plain latex in the generated Makefile. Set this option to YES to get a
592# higher quality PDF documentation.
593USE_PDFLATEX           = NO
594 
595# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
596# command to the generated LaTeX files. This will instruct LaTeX to keep
597# running if errors occur, instead of asking the user for help.
598# This option is also used when generating formulas in HTML.
599LATEX_BATCHMODE        = NO
600 
601# If LATEX_HIDE_INDICES is set to YES then doxygen will not
602# include the index chapters (such as File Index, Compound Index, etc.)
603# in the output.
604LATEX_HIDE_INDICES     = NO
605 
606#---------------------------------------------------------------------------
607# configuration options related to the RTF output
608#---------------------------------------------------------------------------
609 
610GENERATE_RTF           = NO
611RTF_OUTPUT             = rtf
612COMPACT_RTF            = NO
613RTF_HYPERLINKS         = NO
614RTF_STYLESHEET_FILE    =
615RTF_EXTENSIONS_FILE    =
616 
617#---------------------------------------------------------------------------
618# configuration options related to the man page output
619#---------------------------------------------------------------------------
620 
621# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
622# generate man pages
623GENERATE_MAN           = NO
624 
625# The MAN_OUTPUT tag is used to specify where the man pages will be put.
626# If a relative path is entered the value of OUTPUT_DIRECTORY will be
627# put in front of it. If left blank `man' will be used as the default path.
628MAN_OUTPUT             = man
629 
630# The MAN_EXTENSION tag determines the extension that is added to
631# the generated man pages (default is the subroutine's section .3)
632MAN_EXTENSION          = .3
633 
634# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
635# then it will generate one additional man file for each entity
636# documented in the real man page(s). These additional files
637# only source the real man page, but without them the man command
638# would be unable to find the correct page. The default is NO.
639MAN_LINKS              = NO
640 
641#---------------------------------------------------------------------------
642# configuration options related to the XML output
643#---------------------------------------------------------------------------
644 
645GENERATE_XML           = NO
646XML_OUTPUT             = xml
647XML_SCHEMA             =
648XML_DTD                =
649XML_PROGRAMLISTING     = YES
650 
651#---------------------------------------------------------------------------
652# configuration options for the AutoGen Definitions output
653#---------------------------------------------------------------------------
654 
655# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
656# generate an AutoGen Definitions (see autogen.sf.net) file
657# that captures the structure of the code including all
658# documentation. Note that this feature is still experimental
659# and incomplete at the moment.
660GENERATE_AUTOGEN_DEF   = NO
661 
662#---------------------------------------------------------------------------
663# configuration options related to the Perl module output
664#---------------------------------------------------------------------------
665 
666# If the GENERATE_PERLMOD tag is set to YES Doxygen will
667# generate a Perl module file that captures the structure of
668# the code including all documentation. Note that this
669# feature is still experimental and incomplete at the
670# moment.
671GENERATE_PERLMOD       = NO
672 
673# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
674# the necessary Makefile rules, Perl scripts and LaTeX code to be able
675# to generate PDF and DVI output from the Perl module output.
676PERLMOD_LATEX          = NO
677 
678# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
679# nicely formatted so it can be parsed by a human reader.  This is useful
680# if you want to understand what is going on.  On the other hand, if this
681# tag is set to NO the size of the Perl module output will be much smaller
682# and Perl will parse it just the same.
683PERLMOD_PRETTY         = YES
684 
685# The names of the make variables in the generated doxyrules.make file
686# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
687# This is useful so different doxyrules.make files included by the same
688# Makefile don't overwrite each other's variables.
689PERLMOD_MAKEVAR_PREFIX =
690 
691#---------------------------------------------------------------------------
692# Configuration options related to the preprocessor  
693#---------------------------------------------------------------------------
694 
695# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
696# evaluate all C-preprocessor directives found in the sources and include
697# files.
698ENABLE_PREPROCESSING   = YES
699 
700# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
701# names in the source code. If set to NO (the default) only conditional
702# compilation will be performed. Macro expansion can be done in a controlled
703# way by setting EXPAND_ONLY_PREDEF to YES.
704MACRO_EXPANSION        = NO
705 
706# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
707# then the macro expansion is limited to the macros specified with the
708# PREDEFINED and EXPAND_AS_PREDEFINED tags.
709EXPAND_ONLY_PREDEF     = NO
710 
711# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
712# in the INCLUDE_PATH (see below) will be search if a #include is found.
713SEARCH_INCLUDES        = YES
714 
715# The INCLUDE_PATH tag can be used to specify one or more directories that
716# contain include files that are not input files but should be processed by
717# the preprocessor.
718INCLUDE_PATH           =
719 
720# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
721# patterns (like *.h and *.hpp) to filter out the header-files in the
722# directories. If left blank, the patterns specified with FILE_PATTERNS will
723# be used.
724INCLUDE_FILE_PATTERNS  =
725 
726# The PREDEFINED tag can be used to specify one or more macro names that
727# are defined before the preprocessor is started (similar to the -D option of
728# gcc). The argument of the tag is a list of macros of the form: name
729# or name=definition (no spaces). If the definition and the = are
730# omitted =1 is assumed. To prevent a macro definition from being
731# undefined via #undef or recursively expanded use the := operator
732# instead of the = operator.
733PREDEFINED             =
734 
735# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
736# this tag can be used to specify a list of macro names that should be expanded.
737# The macro definition that is found in the sources will be used.
738# Use the PREDEFINED tag if you want to use a different macro definition.
739EXPAND_AS_DEFINED      =
740 
741# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
742# doxygen's preprocessor will remove all function-like macros that are alone
743# on a line, have an all uppercase name, and do not end with a semicolon. Such
744# function macros are typically used for boiler-plate code, and will confuse
745# the parser if not removed.
746SKIP_FUNCTION_MACROS   = YES
747 
748#---------------------------------------------------------------------------
749# Configuration::additions related to external references  
750#---------------------------------------------------------------------------
751 
752# The TAGFILES option can be used to specify one or more tagfiles.
753# Optionally an initial location of the external documentation
754# can be added for each tagfile. The format of a tag file without
755# this location is as follows:
756#   TAGFILES = file1 file2 ...
757# Adding location for the tag files is done as follows:
758#   TAGFILES = file1=loc1 "file2 = loc2" ...
759# where "loc1" and "loc2" can be relative or absolute paths or
760# URLs. If a location is present for each tag, the installdox tool
761# does not have to be run to correct the links.
762# Note that each tag file must have a unique name
763# (where the name does NOT include the path)
764# If a tag file is not located in the directory in which doxygen
765# is run, you must also specify the path to the tagfile here.
766TAGFILES               =
767 
768# When a file name is specified after GENERATE_TAGFILE, doxygen will create
769# a tag file that is based on the input files it reads.
770GENERATE_TAGFILE       =
771 
772# If the ALLEXTERNALS tag is set to YES all external classes will be listed
773# in the class index. If set to NO only the inherited external classes
774# will be listed.
775ALLEXTERNALS           = NO
776 
777# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
778# in the modules index. If set to NO, only the current project's groups will
779# be listed.
780EXTERNAL_GROUPS        = YES
781 
782# The PERL_PATH should be the absolute path and name of the perl script
783# interpreter (i.e. the result of `which perl').
784PERL_PATH              = /usr/bin/perl
785 
786#---------------------------------------------------------------------------
787# Configuration options related to the dot tool  
788#---------------------------------------------------------------------------
789 
790# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
791# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
792# or super classes. Setting the tag to NO turns the diagrams off. Note that
793# this option is superseded by the HAVE_DOT option below. This is only a
794# fallback. It is recommended to install and use dot, since it yields more
795# powerful graphs.
796CLASS_DIAGRAMS         = YES
797 
798# If set to YES, the inheritance and collaboration graphs will hide
799# inheritance and usage relations if the target is undocumented
800# or is not a class.
801HIDE_UNDOC_RELATIONS   = YES
802 
803# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
804# available from the path. This tool is part of Graphviz, a graph visualization
805# toolkit from AT&T and Lucent Bell Labs. The other options in this section
806# have no effect if this option is set to NO (the default)
807HAVE_DOT               = YES
808 
809# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
810# will generate a graph for each documented class showing the direct and
811# indirect inheritance relations. Setting this tag to YES will force the
812# the CLASS_DIAGRAMS tag to NO.
813CLASS_GRAPH            = YES
814 
815# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
816# will generate a graph for each documented class showing the direct and
817# indirect implementation dependencies (inheritance, containment, and
818# class references variables) of the class with other documented classes.
819COLLABORATION_GRAPH    = YES
820 
821# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
822# will generate a graph for groups, showing the direct groups dependencies
823GROUP_GRAPHS           = YES
824 
825# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
826# collaboration diagrams in a style similar to the OMG's Unified Modeling
827# Language.
828UML_LOOK               = NO
829 
830# If set to YES, the inheritance and collaboration graphs will show the
831# relations between templates and their instances.
832TEMPLATE_RELATIONS     = YES
833 
834# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
835# tags are set to YES then doxygen will generate a graph for each documented
836# file showing the direct and indirect include dependencies of the file with
837# other documented files.
838INCLUDE_GRAPH          = YES
839 
840# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
841# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
842# documented header file showing the documented files that directly or
843# indirectly include this file.
844INCLUDED_BY_GRAPH      = YES
845 
846# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will
847# generate a call dependency graph for every global function or class method.
848# Note that enabling this option will significantly increase the time of a run.
849# So in most cases it will be better to enable call graphs for selected
850# functions only using the \callgraph command.
851CALL_GRAPH             = NO
852 
853# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
854# will graphical hierarchy of all classes instead of a textual one.
855GRAPHICAL_HIERARCHY    = YES
856 
857# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
858# then doxygen will show the dependencies a directory has on other directories
859# in a graphical way. The dependency relations are determined by the #include
860# relations between the files in the directories.
861DIRECTORY_GRAPH        = YES
862 
863# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
864# generated by dot. Possible values are png, jpg, or gif
865# If left blank png will be used.
866DOT_IMAGE_FORMAT       = png
867 
868# The tag DOT_PATH can be used to specify the path where the dot tool can be
869# found. If left blank, it is assumed the dot tool can be found in the path.
870DOT_PATH               =
871 
872# The DOTFILE_DIRS tag can be used to specify one or more directories that
873# contain dot files that are included in the documentation (see the
874# \dotfile command).
875DOTFILE_DIRS           =
876 
877# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
878# (in pixels) of the graphs generated by dot. If a graph becomes larger than
879# this value, doxygen will try to truncate the graph, so that it fits within
880# the specified constraint. Beware that most browsers cannot cope with very
881# large images.
882MAX_DOT_GRAPH_WIDTH    = 1024
883 
884# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
885# (in pixels) of the graphs generated by dot. If a graph becomes larger than
886# this value, doxygen will try to truncate the graph, so that it fits within
887# the specified constraint. Beware that most browsers cannot cope with very
888# large images.
889MAX_DOT_GRAPH_HEIGHT   = 1024
890 
891# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
892# graphs generated by dot. A depth value of 3 means that only nodes reachable
893# from the root by following a path via at most 3 edges will be shown. Nodes
894# that lay further from the root node will be omitted. Note that setting this
895# option to 1 or 2 may greatly reduce the computation time needed for large
896# code bases. Also note that a graph may be further truncated if the graph's
897# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH
898# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default),
899# the graph is not depth-constrained.
900MAX_DOT_GRAPH_DEPTH    = 0
901 
902# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
903# background. This is disabled by default, which results in a white background.
904# Warning: Depending on the platform used, enabling this option may lead to
905# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
906# read).
907DOT_TRANSPARENT        = NO
908 
909# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
910# files in one run (i.e. multiple -o and -T options on the command line). This
911# makes dot run faster, but since only newer versions of dot (>1.8.10)
912# support this, this feature is disabled by default.
913DOT_MULTI_TARGETS      = NO
914 
915# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
916# generate a legend page explaining the meaning of the various boxes and
917# arrows in the dot generated graphs.
918GENERATE_LEGEND        = YES
919 
920# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
921# remove the intermediate dot files that are used to generate
922# the various graphs.
923DOT_CLEANUP            = YES
924 
925#---------------------------------------------------------------------------
926# Configuration::additions related to the search engine  
927#---------------------------------------------------------------------------
928 
929# The SEARCHENGINE tag specifies whether or not a search engine should be
930# used. If set to NO the values of all tags below this one will be ignored.
931SEARCHENGINE           = YES

Changed from default: (new values shown below and bold in above listing)

  • PROJECT_NAME = "Project XXX" - Specify a project name.
  • OUTPUT_DIRECTORY = documents - Specify a documentation directory for the processed results.
  • FULL_PATH_NAMES = NO - Looks cleaner this way. Set to YES for code which has a sensible path hierarchy.
  • JAVADOC_AUTOBRIEF = YES - Don't need explicit "brief" tag
  • HIDE_UNDOC_CLASSES = NO - I let doxygen document everything
  • GENERATE_LATEX = NO - I use HTML docs and have no need for Latex
  • TAB_SIZE = 4 - Default is 8
  • OPTIMIZE_OUTPUT_FOR_C = YES - For C and C++ source code
  • BUILTIN_STL_SUPPORT = YES - Only available in newer versions of dOxygen
  • EXTRACT_ALL = YES
  • EXTRACT_LOCAL_CLASSES = YES
  • RECURSIVE = YES - Search subdirectories
  • SOURCE_BROWSER = YES - List source files
  • ALPHABETICAL_INDEX = YES - Generate alphabetic index of classes, structs, unions
  • GENERATE_TREEVIEW = YES - Generate side panel nav tree (html frame)
  • TEMPLATE_RELATIONS = YES - Show inheritance relationship for templates
  • SEARCHENGINE = YES - Creates local search facility.
  • FILE_PATTERNS = *.cc *.h *.cpp *.hpp - specify file suffixes to document. I leave it blank to take the default.
  • REFERENCED_BY_RELATION = YES - document all entities associated with functions documented

If generating an HTML file, add:

1GENERATE_HTML          = YES
2HTML_OUTPUT            = html
3HTML_FILE_EXTENSION    = .html
4HTML_HEADER            =
5HTML_FOOTER            =
6HTML_STYLESHEET        =
7HTML_ALIGN_MEMBERS     = YES
8DISABLE_INDEX          = NO

If generating an RTF file, add:

1GENERATE_RTF           = YES
2RTF_OUTPUT             = rtf
3COMPACT_RTF            = NO
4RTF_HYPERLINKS         = NO
5RTF_STYLESHEET_FILE    =
6RTF_EXTENSIONS_FILE    =

Generate UML class diagrams: (Uses Graphviz)

01CLASS_DIAGRAMS         = YES
02HAVE_DOT               = YES
03CLASS_GRAPH            = YES
04COLLABORATION_GRAPH    = YES
05GROUP_GRAPHS           = YES
06UML_LOOK               = NO
07TEMPLATE_RELATIONS     = YES
08INCLUDE_GRAPH          = YES
09INCLUDED_BY_GRAPH      = YES
10CALL_GRAPH             = YES
11CALLER_GRAPH           = YES
12GRAPHICAL_HIERARCHY    = YES
13DIRECTORY_GRAPH        = YES
14DOT_MULTI_TARGETS      = YES

If you are running dOxygen against a large software project with large complex classes, one may want to turn off the "COLLABORATION_GRAPH" as it may include an overwhelming number of references.

Note: Graphviz RPMs are available from http://pkgs.repoforge.org/graphviz/

[Potential Pitfall]: If you get the following Graphviz error from running dOxygen:

Error: Layout was not done.  Missing layout plugins?
Fix: After installation you may have to generate the appropriate plugins configuration by issuing the command (as root) "dot -c"


DOxygen GUI wizard configuration tool: doxywizard

Panel created by selecting "Wizard ...":

This GUI tools allows one to set preferences with a point and click interface. I find that editing the default file generated by dOxygen is actually more user friendly as it has informative comments explaining each directive.

The "doxywizard" GUI tool is included in the Red Hat/Fedora RPM package "doxygen-doxywizard".

Run DOxygen: doxygen project-name.cfg

This will generate the sub-directory html/ which will contain the documentation generated. Load the file html/index.html in your web browser to view software documentation generated.

Man pages:

Notes: Latex math formulas can also be embebded to generate output for the HTML page. DOxygen also has an interface to Graphviz to generate a C++ inheritance diagram by generating a Graphviz "dot file".

dOxygen is very configurable and allows one to choose tag styles (Qt,Javadoc,dOxygen legacy. These examples show Javadoc style tags), C macro substitution and link to external documentation. dOxygen can generate man pages, HTML documents, XML files and RTF files


dOxygen and C++ STL:

When used in conjunction with Graphviz, dOxygen will generate small UML class diagrams embeded within the documentation. There are two methods to support inclusion of C++ STL:
  • Include a STL definitions file so dOxygen can display inheritance diagrams which include STL. Place the file dummySTL.H [cached] in the directory with your source code before running dOxygen. No references are required within your code. DOxygen will read the file and use its definitions to display a more complete class diagram.

  • Turn on the built-in support for C++ STL:
    1# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to
    2# include (a tag file for) the STL sources as input, then you should
    3# set this tag to YES in order to let doxygen match functions declarations and
    4# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
    5# func(std::string) {}). This also make the inheritance and collaboration
    6# diagrams that involve STL classes more complete and accurate.
    7 
    8BUILTIN_STL_SUPPORT    = YES
    Default is "NO".


dOxygen and the vim editor:

Vim can perform sytax highlighting (and thus syntax checking). Turn this feature on by making the following entry in the file $HOME/.vimrc :
syntax on
let g:load_doxygen_syntax=1

Software for C++ practices and style enforcement:

  • Parasoft Code Wizard: Coding standards enforcement.
    Parasoft.com: CodeWizard home page

  • Checkstyle: Java code style checker
    CheckStyle home page

  • GNU C++ compiler: g++
    Use the command line option -Weffc++ to warn of style violations not in accordance with the following Meyers "Effective C++" coding practices as outlined in the book of the same name:
    • Item 11: Define a copy constructor and an assignment operator for classes with dynamically allocated memory.
    • Item 12: Prefer initialization to assignment in constructors.
    • Item 14: Make destructors virtual in base classes.
    • Item 15: Have "operator=" return a reference to *this.
    • Item 23: Don’t try to return a reference when you must return an object.
    Also from the book "More effective C++":
    • Item 6: Distinguish between prefix and postfix forms of increment and decrement operators.
    • Item 7: Never overload "&&", "││", or ",".

C++ Code Review Checklist:

Peer review of code during the developemnt process is a healthy step for the empowerment of communication within the software team and is a step to promote software source code quality. Peer reviews should look for:

  • Header: license and/or copyright information.
  • Comments: adequate explanation, units of measurement. Use of dOxygen tags: comments for each function, function arguments (in/out), ...
  • Adherance to coding standards: variable naming, indentation, bracket style, ...
  • Use of standard APIs: Don't reinvent and add code maintenance.
  • Use of standards: file format standards (i.e. log file formats), ISO or ANSI standards.
  • Error checking and handling. Data integrity checks: range checks.
  • Resource leaks: memory, database connections, files, sockets, ... freed for each logic path including error handling.
    (See the YoLinux.com memory corruption and memory leaks tutorial)
  • Security: buffer exploits, clear text network communications, ....
  • Thread safe: global variables.
  • Logic and control structures: infinite loop conditions, correct loop counters, variables initialized before being used, math/algorithms, ...
  • Performance: memory, wasted operations, synchronous calls....
  • Regression tests including bad data and errors.

Links:

Books:

Code Complete: A Practical Handbook of Software Construction
by Steve C. McConnell
ISBN #0735619670, Microsoft Press 2nd edition (June 2004)

Amazon.com
Exceptional C++: 47 Engineering Puzzles, Programming Problems and Solutions
by Herb Sutter
ISBN #0201615622, Addison-Wesley Professional

Advanced C++ features and STL.

Amazon.com
More Exceptional C++
by Herb Sutter
ISBN #020170434X, Addison-Wesley Professional

Amazon.com
Exceptional C++ Style
by Herb Sutter
ISBN #0201760428, Addison-Wesley Professional

Amazon.com
C++ Coding StandardsL 101 Rules, Guidelines and Best Practices
by Herb Sutter and Andrei Alexandrescu
ISBN #0321113586, Addison-Wesley Professional

Amazon.com
Effective C++: 50 Specific Ways to Improve Your Programs and Design (2nd Edition)
by Scott Meyers
ISBN #0201924889, Addison-Wesley Professional

Amazon.com
More Effective C++: 35 New Ways to improve your Programs and Designs
by Scott Meyers
ISBN #020163371X, Addison-Wesley Professional

Amazon.com
C++ How to Program
by Harvey M. Deitel, Paul J. Deitel
ISBN #0131857576, Prentice Hall

Fifth edition. The first edition of this book (and Professor Sheely at UTA) taught me to program C++. It is complete and covers all the nuances of the C++ language. It also has good code examples. Good for both learning and reference.

Amazon.com
"Embedded C Coding Standard"
by Michael Barr
October 2008
ISBN #1442164824, Netrino Institute; 1st edition

C coding standard to minimize bugs, improve maintainability and portability.

Amazon.com
"CERT C Secure Coding Standard"
by Robert C. Seacord
October 2008
ISBN #0321563212, Addison-Wesley Professional; 1 edition

Work and reference material created by staff at the Sofware Engineering Institute of Carnegie Mellon. Covers root causes of software vulnerabilities in C and prioritizes them by severity, likelihood of exploitation, and remediation costs. Coding examples.

Amazon.com