C ++ is widely used and plays an important role in many fields. Programmers can use it to greatly improve the efficiency of program development. Here we will first take a look at the application methods of C ++ Doxygen for your convenience.
- Skills related to C ++ identifier naming rules
- Basic concepts of C ++ function templates
- C ++ constant reference correct application method
- Interpretation of c ++ stack template application code
- Common application skills of C ++ clipboard
Use C ++ Doxygen to automatically document code comments, and extract comments from the code to generate help documents.
Install the following software when using Doxygen:
1. Install Doxygen1.4.7. We recommend that you install it in "D: \ Program Files \ doxygen"
2. Install the Graphviz-2.13 for C ++ Doxygen to generate graphics such as class diagrams and relationship diagrams. It is recommended to install it in D: \ Program Files \ ATT.
3. Install HtmlHelp1.3 to generate the CHM help file. skip this step if other versions of HtmlHelp have been installed.
The following are examples of three common forms.
A. file Header comment, \ file, \ brief
B. Define comments for classes/struct, first write the name, and then write the summary description.
C. Define the function. First, write the name, and then the brief description. Then, write the parameter description, return value, precautions, and Reference Links.
In Function Definition, 1) parameter param2) return value return 3) See see4) note
The in/out parameter can be specified, for example, @ param [out] dest, @ param [in, out] buffer
D. Comments of member variables. If the comments are written on the right of the variables, add "<", for example //! <......
For more in-depth marking, see "Documenting the code" in the C ++ Doxygen help. the usage of Doxygen is described later.
- //! \ File Ix_Observer.h A. file Header comment, used to list the file list in the Help file
- //! \ Brief defines the publisher and observer interfaces Ix_Subject, Ix_Observer
- # Pragma once
- Struct Ix_Subject;
- Struct Ix_Observer;
- //! Definition comments of the publisher's interface B. Class/struct
- /*! The publisher is the object to be observed.
- \ Interface Ix_Subject
- */
- Struct Ix_Subject
- {
- //! Add observer C. Function Definition comments
- /*!
- \ Param observer: the observer to be added
- \ See Ix_Observer
- */
- Virtual void Attach (Ix_Observer * observer) = 0;
- //! Remove observer
- /*!
- \ Param observer: the observer to be removed
- \ See Ix_Observer
- */
- Virtual bool Detach (Ix_Observer * observer) = 0;
- //! Notify all observers when changing
- /*!
- \ Param data notification parameter, which can be NULL
- */
- Virtual void Notify (void * data) = 0;
- };
- //! Two-dimensional point structure
- Struct POINT2D
- {
- Double x ;//! <X coordinate component D. Enumeration/struct/class member variable watching
- Double y ;//! <Y coordinate component adds "<" to the right of the definition item, and does not add "<" to the line above it.
- };
- //! Observer Interface
- /*! \ Interface Ix_Observer
- */
- Struct Ix_Observer
- {
- //! Change Notification
- /*!
- \ Param data notification parameters
- \ Param subject: publisher of the publication change notice; others
- Others others
- */
- Virtual void Update (void * data, const Ix_Subject * subject) = 0;
- };
First, we will introduce the operations related to C ++ Doxygen.