utils/print-introspected-doxygen.cc
changeset 2945 8e9f4dc59d8b
parent 2944 d8806baadedb
child 2951 2a3db8645225
--- a/utils/print-introspected-doxygen.cc	Thu Apr 10 11:50:47 2008 -0700
+++ b/utils/print-introspected-doxygen.cc	Thu Apr 10 12:24:36 2008 -0700
@@ -46,6 +46,21 @@
   os << "</ul>" << std::endl;
 }
 
+void
+PrintTraceSources (TypeId tid, std::ostream &os)
+{
+  os << "<ul>"<<std::endl;
+  for (uint32_t i = 0; i < tid.GetTraceSourceN (); ++i)
+    {
+      os << "<li><b>" << tid.GetTraceSourceName (i) << "</b>: "
+	 << tid.GetTraceSourceHelp (i)
+	 << std::endl;
+      os << "</li>" << std::endl;
+    }
+  os << "</ul>"<<std::endl;
+}
+
+
 class StaticInformation
 {
 public:
@@ -263,29 +278,39 @@
 	  std::cout << "Attributes defined for this type:" << std::endl;
 	  PrintAttributes (tid, std::cout);
 	}
-      bool hasAttributesInParent = false;
-      TypeId tmp = tid.GetParent ();
-      while (tmp.GetParent () != tmp)
-	{
-	  if (tmp.GetAttributeN () != 0)
-	    {
-	      hasAttributesInParent = true;
-	    }
-	  tmp = tmp.GetParent ();
-	}
-      if (hasAttributesInParent)
+      {
+	TypeId tmp = tid.GetParent ();
+	while (tmp.GetParent () != tmp)
+	  {
+	    if (tmp.GetAttributeN () != 0)
+	      {
+		std::cout << "Attributes defined in parent class " << tmp.GetName () << ":<br>" << std::endl;
+		PrintAttributes (tmp, std::cout);
+	      }
+	    tmp = tmp.GetParent ();
+	  }
+      }
+      if (tid.GetTraceSourceN () == 0)
 	{
-	  tmp = tid.GetParent ();
-	  while (tmp.GetParent () != tmp)
-	    {
-	      if (tmp.GetAttributeN () != 0)
-		{
-		  std::cout << "Attributes defined in parent class " << tmp.GetName () << ":<br>" << std::endl;
-		  PrintAttributes (tmp, std::cout);
-		}
-	      tmp = tmp.GetParent ();
-	    }
+	  std::cout << "No TraceSources defined for this type." << std::endl;
+	}
+      else
+	{
+	  std::cout << "TraceSources defined for this type:" << std::endl;
+	  PrintTraceSources (tid, std::cout);
 	}
+      {
+	TypeId tmp = tid.GetParent ();
+	while (tmp.GetParent () != tmp)
+	  {
+	    if (tmp.GetTraceSourceN () != 0)
+	      {
+		std::cout << "TraceSources defined in parent class " << tmp.GetName () << ":<br>" << std::endl;
+		PrintTraceSources (tmp, std::cout);
+	      }
+	    tmp = tmp.GetParent ();
+	  }
+      }
       std::cout << "*/" << std::endl;
     }