add an abstract base to CallbackTraceSource
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Sun, 12 Aug 2007 18:27:30 +0200
changeset 1344 2e0770120285
parent 1343 421d8d4712f9
child 1345 eb06ae6eb180
add an abstract base to CallbackTraceSource
src/core/callback-trace-source.h
--- a/src/core/callback-trace-source.h	Sun Aug 12 18:00:15 2007 +0200
+++ b/src/core/callback-trace-source.h	Sun Aug 12 18:27:30 2007 +0200
@@ -29,6 +29,14 @@
 
 namespace ns3 {
 
+class CallbackTraceSourceBase 
+{
+public:
+  virtual ~CallbackTraceSourceBase () {}
+  virtual void AddCallback (CallbackBase const & callback, TraceContext const & context) = 0;
+  virtual void RemoveCallback (CallbackBase const & callback) = 0;
+};
+
 
 /**
  * \brief log arbitrary number of parameters to a matching ns3::Callback
@@ -39,11 +47,11 @@
  */
 template<typename T1 = empty, typename T2 = empty, 
          typename T3 = empty, typename T4 = empty>
-class CallbackTraceSource {
+class CallbackTraceSource : public CallbackTraceSourceBase {
 public:
   CallbackTraceSource ();
-  void AddCallback (CallbackBase const & callback, TraceContext const & context);
-  void RemoveCallback (CallbackBase const & callback);
+  virtual void AddCallback (CallbackBase const & callback, TraceContext const & context);
+  virtual void RemoveCallback (CallbackBase const & callback);
   void operator() (void) const;
   void operator() (T1 a1) const;
   void operator() (T1 a1, T2 a2) const;