add an overload of the TraceSource::AddCallback method
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Wed, 05 Sep 2007 12:34:53 +0200
changeset 1414 1e57b16f97fd
parent 1413 a84b1ece69a2
child 1415 ac1df67308e6
add an overload of the TraceSource::AddCallback method
src/core/trace-source.cc
src/core/trace-source.h
src/core/wscript
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/core/trace-source.cc	Wed Sep 05 12:34:53 2007 +0200
@@ -0,0 +1,31 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2007 INRIA
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
+ */
+#include "trace-source.h"
+#include "trace-context.h"
+
+namespace ns3 {
+
+void 
+TraceSource::AddCallback (CallbackBase const & callback)
+{
+  AddCallback (callback, TraceContext ());
+}
+
+} // namespace ns3
--- a/src/core/trace-source.h	Wed Sep 05 12:08:57 2007 +0200
+++ b/src/core/trace-source.h	Wed Sep 05 12:34:53 2007 +0200
@@ -23,6 +23,9 @@
 
 namespace ns3 {
 
+class CallbackBase;
+class TraceContext;
+
 /**
  * \brief the base class for all trace sources
  *
@@ -41,6 +44,10 @@
    */
   virtual void AddCallback (CallbackBase const & callback, TraceContext const & context) = 0;
   /**
+   * \param callback the callback to connect to this trace source
+   */
+  void AddCallback (CallbackBase const & callback);
+  /**
    * \param callback the callback to disconnect from this trace source
    */
   virtual void RemoveCallback (CallbackBase const & callback) = 0;
--- a/src/core/wscript	Wed Sep 05 12:08:57 2007 +0200
+++ b/src/core/wscript	Wed Sep 05 12:34:53 2007 +0200
@@ -49,6 +49,7 @@
         'callback-trace-source.cc',
         'composite-trace-resolver.cc',
         'trace-doc.cc',
+        'trace-source.cc',
         ]
 
     if sys.platform == 'win32':