print default value list in trace source list doxygen output.
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Thu, 15 Nov 2007 10:24:51 +0100
changeset 1853 e2d7985a5938
parent 1852 8fba656f0da6
child 1854 8a3deb9c57dc
print default value list in trace source list doxygen output.
utils/print-trace-sources.cc
--- a/utils/print-trace-sources.cc	Thu Nov 15 10:23:54 2007 +0100
+++ b/utils/print-trace-sources.cc	Thu Nov 15 10:24:51 2007 +0100
@@ -6,6 +6,7 @@
 #include "ns3/csma-net-device.h"
 #include "ns3/queue.h"
 #include "ns3/mobility-model-notifier.h"
+#include "ns3/default-value.h"
 
 using namespace ns3;
 
@@ -35,7 +36,7 @@
       os << std::endl;
     }
 }
-void
+static void
 PrintDoxygenText (const TraceResolver::SourceCollection *sources, std::ostream &os)
 {
   uint32_t z = 0;
@@ -81,6 +82,37 @@
     }
 }
 
+static void
+PrintOneDefaultValue (DefaultValueBase *value, std::ostream &os)
+{
+  os << "///  <li> \\anchor DefaultValue" << value->GetName ()
+     << " " << value->GetName () << std::endl;
+  os << "///    <ul>" << std::endl;
+  os << "///         <li>Type: " << value->GetType () << "</td></tr>" << std::endl;
+  os << "///         <li>Default value: " << value->GetDefaultValue () << "</td></tr>" << std::endl;
+  os << "///         <li>Description: " << value->GetHelp () << "</td></tr>" << std::endl;
+  os << "///    </ul>" << std::endl;
+  os << "///  </li>" << std::endl;
+}
+
+static void
+PrintDefaultValuesDoxygen (std::ostream &os)
+{
+  os << "/// \\page ListOfDefaultValues The list of default values" << std::endl;
+  os << "/// \\defgroup ListOfDefaultValuesGroup The list of default values" << std::endl;
+  os << "/// <ul>" << std::endl;
+  for (DefaultValueList::Iterator i = DefaultValueList::Begin ();
+       i != DefaultValueList::End (); i++)
+    {
+      if ((*i)->GetName () == "help")
+	{
+	  continue;
+	}
+      PrintOneDefaultValue (*i, os);
+    }
+  os << "/// </ul>" << std::endl;
+}
+
 
 int main (int argc, char *argv[])
 {
@@ -96,5 +128,8 @@
   NodeList::GetTraceResolver ()->CollectSources ("", TraceContext (), &collection);
   PrintDoxygenText (&collection, std::cout);
 
+
+  PrintDefaultValuesDoxygen (std::cout);
+
   return 0;
 }