Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Doxygen have support for branching or for C/C++ preprocessor

Tags:

c++

c

doxygen

This might sound like a sci-fi feature request but I wonder if Doxygen has any of the two following features:

  1. Generating the call/caller graphs after preprocessor ran over the input file. Example:

    #define MULTITHREADING 1
    

    and then blocks of code are enabled or disabled depending on whether MULTITHREADING is enabled.

  2. Describing the certainty of the call with graph arrows... for example a dotted line if the function isn't always called (a.k.a it is in a branch or you have possible return before the function is called.

like image 657
NoSenseEtAl Avatar asked Mar 08 '13 11:03

NoSenseEtAl


People also ask

What is Doxygen configuration file?

A configuration file is a free-form ASCII text file with a structure that is similar to that of a Makefile , with the default name Doxyfile . It is parsed by doxygen . The file may contain tabs and newlines for formatting purposes.

How exclude code from Doxygen?

How can I make doxygen ignore some code fragment? The new and easiest way is to add one comment block with a \cond command at the start and one comment block with a \endcond command at the end of the piece of code that should be ignored. This should be within the same file of course.


2 Answers

  1. Doxygen Preprocessing:

    Source files that are used as input to doxygen can be parsed by doxygen's built-in C-preprocessor.

    By default doxygen does only partial preprocessing. That is, it evaluates conditional compilation statements (like #if) and evaluates macro definitions, but it does not perform macro expansion.

  2. COLLABORATION_GRAPH:

    If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen will generate a graph for each documented class showing the direct and indirect implementation dependencies (inheritance, containment, and class references variables) of the class with other documented classes.

like image 153
masoud Avatar answered Oct 22 '22 20:10

masoud


For the first item, you will want to enable the ENABLE_PREPROCESSING option in your Doxyfile.

For the second, I honestly don't know, but would be very surprised if it did. I think that this would require a full C/C++ compiler to determine these things.

like image 40
Michael Wild Avatar answered Oct 22 '22 20:10

Michael Wild