3

I need to get a list of all classes (and other elements) at doxygen group page even if they are namespace members. So if I have something like this code example:

/*!
@defgroup test_group Example group
@{*/
    class some_class {};
/// @}

Doxygen will generate group page, containing my "some_class" :

page with class.

But after namespace adding doxygen "hides" all namespace members to new page. Next code:

/*!
@defgroup test_group Example group
@{*/
namespace example_namespace {       
    class some_class {};
}
/// @}

produces a group page, containing link to namespace page.

2 step navigation.

We can't see namespace members on group page.

Next 2 ways gives the same result:

// 1. putting namespace content in brackets @{ @}:
    /// @defgroup test_group Example group        
    namespace example_namespace { 
        /*!
        @ingroup test_group 
        @{ */
        class some_class {};
        /// @}
    }        
// 2. putting namespace itself to group:

    /// @defgroup test_group Example group

    /// @ingroup test_group 
    namespace example_namespace {
        class some_class {};
    }

I want to get a group page, that will contain all classes from namespaces and namespaces themselves. I know that adding "@ingroup" to class description gives me what I want, but in real program there are tens or even hundreds of classes in one namespace. There must be a better way.

1 Answer 1

0

I did some small tests and the following works:

/*!
@defgroup test_group Example group
@{*/
namespace example_namespace {
    /*!
    @defgroup test_group Example group
    @{*/
    /** the class */
    class some_class {
      /*!
      @defgroup test_group Example group
      @{*/
      public:
         /** the fie */
         void fie(void);
      /// @}
    };
    /// @}
};
/// @}

It is a bit overhead, and maybe you also should look at the other group commands like \ingroup, \addtogroup and the paragraph about grouping in the manual.

Sign up to request clarification or add additional context in comments.

2 Comments

So it was the question how to avoid thousands of "copy-paste" in a huge project. :)
OK I see, missed the last paragraph of the question. I think you only have to add the \ingroup once per file where the classes are defined in the namespace and maybe it is sufficient (didn't test it), to create an (extra) .h file with just the namespace and class names and the appropriate groups.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.