rename print-trace-sources to print-introspected-doxygen
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Mon, 29 Oct 2007 15:01:36 +0100
changeset 2048 c62b4aae737d
parent 2047 895b54d0ad73
child 2049 11bfdd9d1487
rename print-trace-sources to print-introspected-doxygen
.hgignore
doc/doxygen.conf
utils/print-introspected-doxygen.cc
utils/print-trace-sources.cc
utils/wscript
wscript
--- a/.hgignore	Mon Oct 29 15:01:14 2007 +0100
+++ b/.hgignore	Mon Oct 29 15:01:36 2007 +0100
@@ -8,4 +8,4 @@
 ^doc/latex
 ^\.lock-wscript
 ^\.waf
-^doc/trace-source-list\.h$
+^doc/introspected-doxygen\.h$
--- a/doc/doxygen.conf	Mon Oct 29 15:01:14 2007 +0100
+++ b/doc/doxygen.conf	Mon Oct 29 15:01:36 2007 +0100
@@ -495,7 +495,7 @@
 
 INPUT                  = src \
                          doc/main.txt \
-                         doc/trace-source-list.h \
+                         doc/introspected-doxygen.h \
                          doc/tracing.h \
 
 # This tag can be used to specify the character encoding of the source files that 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/utils/print-introspected-doxygen.cc	Mon Oct 29 15:01:36 2007 +0100
@@ -0,0 +1,135 @@
+#include "ns3/internet-node.h"
+#include "ns3/ptr.h"
+#include "ns3/trace-resolver.h"
+#include "ns3/node-list.h"
+#include "ns3/point-to-point-net-device.h"
+#include "ns3/csma-net-device.h"
+#include "ns3/queue.h"
+#include "ns3/mobility-model-notifier.h"
+#include "ns3/default-value.h"
+
+using namespace ns3;
+
+void
+PrintSimpleText (const TraceResolver::SourceCollection *sources, std::ostream &os)
+{
+  for (TraceResolver::SourceCollection::Iterator i = sources->Begin (); i != sources->End (); i++)
+    {
+      os << "source=" << i->path << std::endl;
+      os << "TraceContext=[";
+      i->context.PrintAvailable (os, ",");
+      os << "]" << std::endl;
+      os << "help=\"" << i->doc.GetHelp () << "\"" << std::endl;
+      os << "void TraceSinkCallback (const TraceContext &";
+      for (TraceDoc::Iterator k = i->doc.ArgsBegin (); k != i->doc.ArgsEnd (); k++)
+        {
+          os << ", " << k->first;
+        }
+      os << ")" << std::endl;
+      os << "argument 1  --  the trace context associated to the connected trace source." << std::endl;
+      uint32_t k = 2;
+      for (TraceDoc::Iterator j = i->doc.ArgsBegin (); j != i->doc.ArgsEnd (); j++)
+        {
+          os << "argument " << k << "  --  " << j->second << "." << std::endl;
+          k++;
+        }
+      os << std::endl;
+    }
+}
+static void
+PrintDoxygenText (const TraceResolver::SourceCollection *sources, std::ostream &os)
+{
+  uint32_t z = 0;
+  for (TraceResolver::SourceCollection::Iterator i = sources->Begin (); i != sources->End (); i++)
+    {
+      os << "///" << std::endl;
+      os << "/// \\ingroup TraceSourceList" << std::endl; 
+      os << "/// \\brief " << i->doc.GetHelp () << std::endl;
+      os << "/// \\param arg1 the trace context associated to the connected trace source." << std::endl;
+      uint32_t j = 2;
+      for (TraceDoc::Iterator l = i->doc.ArgsBegin (); l != i->doc.ArgsEnd (); l++)
+        {
+          os << "/// \\param arg" << j << " " << l->second << "." << std::endl;
+          j++;
+        }
+      os << "///" << std::endl;
+      os << "///" << std::endl;
+      os << "/// The path to this trace source is: <b><tt>\"" << i->path << "\"</tt></b>." << std::endl;
+      os << "///" << std::endl;
+      if (i->context.Begin ().IsLast ())
+        {
+          os << "/// No data can be extracted from \\p arg1 with ns3::TraceContext::GetElement." << std::endl;
+        }
+      else
+        {
+          os << "/// The following classes can be extracted from \\p arg1 with " << std::endl;
+          os << "/// ns3::TraceContext::GetElement:" << std::endl;
+          for (TraceContext::Iterator m = i->context.Begin (); !m.IsLast (); m.Next ())
+            {
+              os << "///  - " << m.Get () << std::endl;
+            }
+        }
+      os << "void TraceSinkCallback" << z << " (const TraceContext & arg1" ;
+      j = 2;
+      for (TraceDoc::Iterator k = i->doc.ArgsBegin (); k != i->doc.ArgsEnd (); k++)
+        {
+          os << ", " << k->first << " arg" << j;
+          j++;
+        }
+      os << ");" << std::endl;
+      os << std::endl;
+      z++;
+    }
+}
+
+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[])
+{
+  Ptr<Node> node = Create<InternetNode> ();
+  node->AddInterface (Create<MobilityModelNotifier> ());
+
+  Ptr<PointToPointNetDevice> p2p = Create<PointToPointNetDevice> (node);
+  p2p->AddQueue (Queue::CreateDefault ());
+  Ptr<CsmaNetDevice> csma = Create<CsmaNetDevice> (node);
+  csma->AddQueue (Queue::CreateDefault ());
+
+  TraceResolver::SourceCollection collection;
+  NodeList::GetTraceResolver ()->CollectSources ("", TraceContext (), &collection);
+  PrintDoxygenText (&collection, std::cout);
+
+
+  PrintDefaultValuesDoxygen (std::cout);
+
+  return 0;
+}
--- a/utils/print-trace-sources.cc	Mon Oct 29 15:01:14 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +0,0 @@
-#include "ns3/internet-node.h"
-#include "ns3/ptr.h"
-#include "ns3/trace-resolver.h"
-#include "ns3/node-list.h"
-#include "ns3/point-to-point-net-device.h"
-#include "ns3/csma-net-device.h"
-#include "ns3/queue.h"
-#include "ns3/mobility-model-notifier.h"
-#include "ns3/default-value.h"
-
-using namespace ns3;
-
-void
-PrintSimpleText (const TraceResolver::SourceCollection *sources, std::ostream &os)
-{
-  for (TraceResolver::SourceCollection::Iterator i = sources->Begin (); i != sources->End (); i++)
-    {
-      os << "source=" << i->path << std::endl;
-      os << "TraceContext=[";
-      i->context.PrintAvailable (os, ",");
-      os << "]" << std::endl;
-      os << "help=\"" << i->doc.GetHelp () << "\"" << std::endl;
-      os << "void TraceSinkCallback (const TraceContext &";
-      for (TraceDoc::Iterator k = i->doc.ArgsBegin (); k != i->doc.ArgsEnd (); k++)
-        {
-          os << ", " << k->first;
-        }
-      os << ")" << std::endl;
-      os << "argument 1  --  the trace context associated to the connected trace source." << std::endl;
-      uint32_t k = 2;
-      for (TraceDoc::Iterator j = i->doc.ArgsBegin (); j != i->doc.ArgsEnd (); j++)
-        {
-          os << "argument " << k << "  --  " << j->second << "." << std::endl;
-          k++;
-        }
-      os << std::endl;
-    }
-}
-static void
-PrintDoxygenText (const TraceResolver::SourceCollection *sources, std::ostream &os)
-{
-  uint32_t z = 0;
-  for (TraceResolver::SourceCollection::Iterator i = sources->Begin (); i != sources->End (); i++)
-    {
-      os << "///" << std::endl;
-      os << "/// \\ingroup TraceSourceList" << std::endl; 
-      os << "/// \\brief " << i->doc.GetHelp () << std::endl;
-      os << "/// \\param arg1 the trace context associated to the connected trace source." << std::endl;
-      uint32_t j = 2;
-      for (TraceDoc::Iterator l = i->doc.ArgsBegin (); l != i->doc.ArgsEnd (); l++)
-        {
-          os << "/// \\param arg" << j << " " << l->second << "." << std::endl;
-          j++;
-        }
-      os << "///" << std::endl;
-      os << "///" << std::endl;
-      os << "/// The path to this trace source is: <b><tt>\"" << i->path << "\"</tt></b>." << std::endl;
-      os << "///" << std::endl;
-      if (i->context.Begin ().IsLast ())
-        {
-          os << "/// No data can be extracted from \\p arg1 with ns3::TraceContext::GetElement." << std::endl;
-        }
-      else
-        {
-          os << "/// The following classes can be extracted from \\p arg1 with " << std::endl;
-          os << "/// ns3::TraceContext::GetElement:" << std::endl;
-          for (TraceContext::Iterator m = i->context.Begin (); !m.IsLast (); m.Next ())
-            {
-              os << "///  - " << m.Get () << std::endl;
-            }
-        }
-      os << "void TraceSinkCallback" << z << " (const TraceContext & arg1" ;
-      j = 2;
-      for (TraceDoc::Iterator k = i->doc.ArgsBegin (); k != i->doc.ArgsEnd (); k++)
-        {
-          os << ", " << k->first << " arg" << j;
-          j++;
-        }
-      os << ");" << std::endl;
-      os << std::endl;
-      z++;
-    }
-}
-
-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[])
-{
-  Ptr<Node> node = Create<InternetNode> ();
-  node->AddInterface (Create<MobilityModelNotifier> ());
-
-  Ptr<PointToPointNetDevice> p2p = Create<PointToPointNetDevice> (node);
-  p2p->AddQueue (Queue::CreateDefault ());
-  Ptr<CsmaNetDevice> csma = Create<CsmaNetDevice> (node);
-  csma->AddQueue (Queue::CreateDefault ());
-
-  TraceResolver::SourceCollection collection;
-  NodeList::GetTraceResolver ()->CollectSources ("", TraceContext (), &collection);
-  PrintDoxygenText (&collection, std::cout);
-
-
-  PrintDefaultValuesDoxygen (std::cout);
-
-  return 0;
-}
--- a/utils/wscript	Mon Oct 29 15:01:14 2007 +0100
+++ b/utils/wscript	Mon Oct 29 15:01:36 2007 +0100
@@ -28,9 +28,9 @@
     obj = bld.create_ns3_program('replay-simulation', ['simulator'])
     obj.source = 'replay-simulation.cc'
 
-    obj = bld.create_ns3_program('print-trace-sources',
+    obj = bld.create_ns3_program('print-introspected-doxygen',
                                  ['internet-node', 'csma-cd', 'point-to-point'])
-    obj.source = 'print-trace-sources.cc'
+    obj.source = 'print-introspected-doxygen.cc'
 
     if env['ENABLE_MOBILITY_VISUALIZER']:
         obj = bld.create_ns3_program('mobility-visualizer',
--- a/wscript	Mon Oct 29 15:01:14 2007 +0100
+++ b/wscript	Mon Oct 29 15:01:36 2007 +0100
@@ -215,8 +215,8 @@
     ## generate the trace sources list docs
     env = Params.g_build.env_of_name('default')
     proc_env = _get_proc_env()
-    prog = _find_program('print-trace-sources', env).m_linktask.m_outputs[0].abspath(env)
-    out = open('doc/trace-source-list.h', 'w')
+    prog = _find_program('print-introspected-doxygen', env).m_linktask.m_outputs[0].abspath(env)
+    out = open('doc/introspected-doxygen.h', 'w')
     if subprocess.Popen([prog], stdout=out, env=proc_env).wait():
         raise SystemExit(1)
     out.close()
@@ -354,8 +354,8 @@
 
 
 def doxygen():
-    if not os.path.exists('doc/trace-source-list.h'):
-        Params.warning("doc/trace-source-list.h does not exist; run waf check to generate it.")
+    if not os.path.exists('doc/introspected-doxygen.h'):
+        Params.warning("doc/introspected-doxygen.h does not exist; run waf check to generate it.")
 
     ## run doxygen
     doxygen_config = os.path.join('doc', 'doxygen.conf')