user2295749
user2295749

Reputation: 21

Doxygen grouping variables from inside the function

I've been reading very careful about grouing and ingroup command. It states that "Members of a group can be files, namespaces, classes, functions, variables, enums, typedefs, and defines, but also other groups."

As such, I've been trying to group few variables from inside the function. The documentation does not seem to state any specifications or limitation as to what kind of variable it is.

Here is simple example:

/// \file hyperLinks.h
class hyperLinks
{
    public:

        void getEnvVars();

        // WORKS!
        /**
         *  @ingroup group2
         */
        int public_var;

    protected:
        // WORKS!
        /**
         *  @ingroup group2
         */
        int protected_var;

    private:
        int private_var;
};

// WORKS!
/**
 *  @ingroup group2
 */
int globalVarH;

And the corresponding cpp file:

/// \file hyperLinks.cpp
#include "hyperLinks.h"

/**
*  @defgroup group2 The Second Group
*  This is the second group
*/


hyperLinks::getEnvVars()
{
    // do something here

    // put this into a group2
    // ---DOES NOT WORK---
    /**
    *  @ingroup group2
    *  @brief variable inside getEnvVars()
    */
    int inFunctionVariable;

}

// works!
/**
 *  @ingroup group2
 *  @brief OUTSIDE globalVar from .cpp file in group 2
 *  @brief outside class defenition
 */
int globalVarCPP;

From the code above the following DO get placed in Module->The Second Group:

-public_var

-protected_var

-globalVarH

-globalVarCPP

Yet, the variable from inside the function DOES NOT appear in the group:

-inFunctionVariable

The 5th variable is no showing up.

Any ideas why this is not working? How to fix it or a work-around?

Also, I've read thru all the message/warning generated during the run of doxygen documentation. There are errors or warning with regards to this file.

Any help will be greatly appreciated.

Thank you!

ps. Doxygen version 1.8.3.1

Upvotes: 2

Views: 1232

Answers (1)

DRH
DRH

Reputation: 8366

Doxygen doesn't support commenting elements within the body of a function. From Documenting the code in the doxygen Manual:

For each entity in the code there are two (or in some cases three) types of descriptions, which together form the documentation for that entity; a brief description and detailed description, both are optional. For methods and functions there is also a third type of description, the so called in body description, which consists of the concatenation of all comment blocks found within the body of the method or function.

In your code example, the documentation on inFunctionVariable is in-body documentation for the hyperLinks::getEnvVars() function, and appears as a part of the documentation for that item.

Upvotes: 1

Related Questions