src/core/trace-resolver.cc
changeset 1370 d5339e1c95df
parent 1363 849b30d0ea86
child 1371 bebf690257c9
--- a/src/core/trace-resolver.cc	Mon Aug 27 20:45:49 2007 +0200
+++ b/src/core/trace-resolver.cc	Mon Aug 27 20:46:10 2007 +0200
@@ -75,4 +75,34 @@
   return subpath;
 }
 
+void 
+TraceResolver::SourceCollection::AddUnique (std::string path, const TraceContext &context,
+                                            std::string help)
+{
+  for (SourceVector::const_iterator i = m_sources.begin (); i != m_sources.end (); i++)
+    {
+      if (i->path == path &&
+          i->help == help &&
+          context.IsSimilar (i->context))
+        {
+          return;
+        }
+    }
+  struct Source source;
+  source.path = path;
+  source.context = context;
+  source.help = help;
+  m_sources.push_back (source);
+}
+void 
+TraceResolver::SourceCollection::Print (std::ostream &os) const
+{
+  for (SourceVector::const_iterator i = m_sources.begin (); i != m_sources.end (); i++)
+    {
+      os << i->path << " [";
+      i->context.PrintAvailable (os, " ");
+      os << "] " << i->help << std::endl;
+    }
+}
+
 }//namespace ns3