tags:

views:

22

answers:

2

I have quite a large switch statement (or equally a large if statement) that I would like to document some how in Doxygen, perhaps in it's Caller Graph, or maybe in a some Flow Chart format.

How can I achieve this ? Thanks !

A: 

Maybe this will help link

bua
bua, how would I go about using the \if to accomplish that ? I tried it and nothing shows up in the eventual output.Just to be clear. I have a switch (enum){ case 1:// some codebreak;case many:// some codebreak;}and I want to document that showing the code flow for each case ...
Oliver
A: 

Usually doxygen is only used to document overall functions. However, I tried something like this.

/// Foo Function
void Foo(void)
{
   /// if switch \a condition equals
   switch (condition)
   {
      case VALUE_1:
      {
         /// - Path 1 \n
         /// Detailed explanation of path A.
         Foo1();
         break;
      }
      case VALUE_2:
      {
         /// - Path 2 \n
         /// Detailed explanation of path B.
         Foo2();
         break;
      }
      case VALUE_3:
      {
         /// - Path3 \n
         /// Detailed explanation of path C.
         Foo3();
         break;
      }
      case default:
      {
         /// - Default Case
         ///Something went wrong
      }
   }//end switch
}

This put a detailed description under the function Foo, and create a bulleted list of each of the cases. Remember to put the "-" to create a bulletd list. As far as generating call graphs, you could try using the \dot keyword. However, I never used it, and think it's to much work to create a truly useful diagram that explains the path.

Dennis Miller
`\if` creates conditional documentation, not documentation of a conditional.
Ben Voigt