document trace source signature
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Tue, 28 Aug 2007 12:42:27 +0200
changeset 1378 69391eb72cb3
parent 1377 2fcc78ee9558
child 1379 f323d2dcdaf6
document trace source signature
src/core/trace-doc.cc
src/core/trace-doc.h
src/core/wscript
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/core/trace-doc.cc	Tue Aug 28 12:42:27 2007 +0200
@@ -0,0 +1,67 @@
+#include "trace-doc.h"
+
+namespace ns3 {
+
+TraceDoc::TraceDoc (std::string help)
+  : m_help (help)
+{}
+TraceDoc::TraceDoc (std::string help,
+		    std::string arg0Type,
+		    std::string arg0Help)
+  : m_help (help)
+{
+  m_argVector.push_back (std::make_pair (arg0Type, arg0Help));
+}
+TraceDoc::TraceDoc (std::string help,
+		    std::string arg0Type,
+		    std::string arg0Help,
+		    std::string arg1Type,
+		    std::string arg1Help)
+{
+  m_argVector.push_back (std::make_pair (arg0Type, arg0Help));
+  m_argVector.push_back (std::make_pair (arg1Type, arg1Help));
+}
+TraceDoc::TraceDoc (std::string help,
+		    std::string arg0Type,
+		    std::string arg0Help,
+		    std::string arg1Type,
+		    std::string arg1Help,
+		    std::string arg2Type,
+		    std::string arg2Help)
+{
+  m_argVector.push_back (std::make_pair (arg0Type, arg0Help));
+  m_argVector.push_back (std::make_pair (arg1Type, arg1Help));
+  m_argVector.push_back (std::make_pair (arg2Type, arg2Help));
+}
+TraceDoc::TraceDoc (std::string help,
+		    std::string arg0Type,
+		    std::string arg0Help,
+		    std::string arg1Type,
+		    std::string arg1Help,
+		    std::string arg2Type,
+		    std::string arg2Help,
+		    std::string arg3Type,
+		    std::string arg3Help)
+{
+  m_argVector.push_back (std::make_pair (arg0Type, arg0Help));
+  m_argVector.push_back (std::make_pair (arg1Type, arg1Help));
+  m_argVector.push_back (std::make_pair (arg2Type, arg2Help));
+  m_argVector.push_back (std::make_pair (arg3Type, arg3Help));
+}
+std::string 
+TraceDoc::GetHelp (void)
+{
+  return m_help;
+}
+TraceDoc::Iterator 
+TraceDoc::ArgsBegin (void) const
+{
+  return m_argVector.begin ();
+}
+TraceDoc::Iterator 
+TraceDoc::ArgsEnd (void) const
+{
+  return m_argVector.end ();
+}
+
+} // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/core/trace-doc.h	Tue Aug 28 12:42:27 2007 +0200
@@ -0,0 +1,50 @@
+#ifndef TRACE_DOC_H
+#define TRACE_DOC_H
+
+#include <vector>
+#include <string>
+
+namespace ns3 {
+
+class TraceDoc
+{
+  typedef std::vector<std::pair<std::string,std::string> > ArgVector;
+public:
+  typedef ArgVector::const_iterator Iterator;
+
+  TraceDoc (std::string help);
+  TraceDoc (std::string help,
+	    std::string arg0Type,
+	    std::string arg0Help);
+  TraceDoc (std::string help,
+	    std::string arg0Type,
+	    std::string arg0Help,
+	    std::string arg1Type,
+	    std::string arg1Help);
+  TraceDoc (std::string help,
+	    std::string arg0Type,
+	    std::string arg0Help,
+	    std::string arg1Type,
+	    std::string arg1Help,
+	    std::string arg2Type,
+	    std::string arg2Help);
+  TraceDoc (std::string help,
+	    std::string arg0Type,
+	    std::string arg0Help,
+	    std::string arg1Type,
+	    std::string arg1Help,
+	    std::string arg2Type,
+	    std::string arg2Help,
+	    std::string arg3Type,
+	    std::string arg3Help);
+  std::string GetHelp (void);
+  Iterator ArgsBegin (void) const;
+  Iterator ArgsEnd (void) const;
+private:
+  ArgVector m_argVector;
+  std::string m_help;
+};
+
+} // namespace ns3
+
+#endif /* TRACE_DOC_H */
--- a/src/core/wscript	Tue Aug 28 12:06:15 2007 +0200
+++ b/src/core/wscript	Tue Aug 28 12:42:27 2007 +0200
@@ -48,6 +48,7 @@
         'trace-resolver.cc',
         'callback-trace-source.cc',
         'composite-trace-resolver.cc',
+        'trace-doc.cc',
         ]
 
     if sys.platform == 'win32':
@@ -89,5 +90,6 @@
         'trace-resolver.h',
         'composite-trace-resolver.h',
         'array-trace-resolver.h',
+        'trace-doc.h',
         ]