slight reorganization and naming change for added realtime methods
authorCraig Dowell <craigdo@ee.washington.edu>
Tue, 14 Oct 2008 22:52:41 -0700
changeset 3801 dc1f5e534e56
parent 3800 804beebf1ba5
child 3802 b796f3c38e3e
slight reorganization and naming change for added realtime methods
samples/main-test-sync.cc
src/simulator/realtime-simulator-impl.cc
src/simulator/realtime-simulator-impl.h
src/simulator/realtime-simulator.cc
src/simulator/realtime-simulator.h
src/simulator/simulator.cc
src/simulator/simulator.h
src/simulator/wscript
--- a/samples/main-test-sync.cc	Fri Oct 10 21:01:50 2008 -0700
+++ b/samples/main-test-sync.cc	Tue Oct 14 22:52:41 2008 -0700
@@ -97,7 +97,7 @@
       //
       // Exercise the realtime relative now path
       //
-      RealtimeSimulatorExtension::ScheduleRealNow (&inserted_function);
+      RealtimeSimulator::ScheduleRealtimeNow (&inserted_function);
       usleep (1000);
     }
 }
@@ -112,7 +112,7 @@
       //
       // Exercise the realtime relative schedule path
       //
-      RealtimeSimulatorExtension::ScheduleReal (Seconds (0), &inserted_function);
+      RealtimeSimulator::ScheduleRealtime (Seconds (0), &inserted_function);
       usleep (1000);
     }
 }
@@ -128,7 +128,7 @@
   // 
   // Make sure ScheduleRealNow works when the system isn't running
   //
-  RealtimeSimulatorExtension::ScheduleRealNow(&first_function);
+  RealtimeSimulator::ScheduleRealtimeNow(&first_function);
 
   // 
   // drive the progression of m_currentTs at a ten millisecond rate
--- a/src/simulator/realtime-simulator-impl.cc	Fri Oct 10 21:01:50 2008 -0700
+++ b/src/simulator/realtime-simulator-impl.cc	Tue Oct 14 22:52:41 2008 -0700
@@ -629,7 +629,7 @@
 // Schedule an event for a _relative_ time in the future.
 //
 EventId
-RealtimeSimulatorImpl::ScheduleReal (Time const &time, const Ptr<EventImpl> &event)
+RealtimeSimulatorImpl::ScheduleRealtime (Time const &time, const Ptr<EventImpl> &event)
 {
   NS_LOG_FUNCTION (time << event);
 
@@ -638,7 +638,7 @@
     CriticalSection cs (m_mutex);
 
     uint64_t ts = m_synchronizer->GetCurrentRealtime () + time.GetTimeStep ();
-    NS_ASSERT_MSG (ts >= m_currentTs, "RealtimeSimulatorImpl::ScheduleReal(): schedule for time < m_currentTs");
+    NS_ASSERT_MSG (ts >= m_currentTs, "RealtimeSimulatorImpl::ScheduleRealtime(): schedule for time < m_currentTs");
     id = EventId (event, ts, m_uid);
     m_uid++;
     ++m_unscheduledEvents;
@@ -650,7 +650,7 @@
 }
 
 EventId
-RealtimeSimulatorImpl::ScheduleRealNow (const Ptr<EventImpl> &event)
+RealtimeSimulatorImpl::ScheduleRealtimeNow (const Ptr<EventImpl> &event)
 {
   NS_LOG_FUNCTION_NOARGS ();
   EventId id;
@@ -662,7 +662,7 @@
     // realtime clock.  If we're not, then m_currentTs is were we stopped.
     // 
     uint64_t ts = m_running ? m_synchronizer->GetCurrentRealtime () : m_currentTs;
-    NS_ASSERT_MSG (ts >= m_currentTs, "RealtimeSimulatorImpl::ScheduleRealNow(): schedule for time < m_currentTs");
+    NS_ASSERT_MSG (ts >= m_currentTs, "RealtimeSimulatorImpl::ScheduleRealrimeNow(): schedule for time < m_currentTs");
     id = EventId (event, ts, m_uid);
     m_uid++;
     ++m_unscheduledEvents;
@@ -674,7 +674,7 @@
 }
 
 Time
-RealtimeSimulatorImpl::RealNow (void) const
+RealtimeSimulatorImpl::RealtimeNow (void) const
 {
   return TimeStep (m_synchronizer->GetCurrentRealtime ());
 }
--- a/src/simulator/realtime-simulator-impl.h	Fri Oct 10 21:01:50 2008 -0700
+++ b/src/simulator/realtime-simulator-impl.h	Tue Oct 14 22:52:41 2008 -0700
@@ -69,11 +69,11 @@
   void Stop (Time const &time);
   EventId Schedule (Time const &time, const Ptr<EventImpl> &event);
   EventId ScheduleNow (const Ptr<EventImpl> &event);
-  EventId ScheduleReal (Time const &time, const Ptr<EventImpl> &event);
-  EventId ScheduleRealNow (const Ptr<EventImpl> &event);
+  EventId ScheduleRealtime (Time const &time, const Ptr<EventImpl> &event);
+  EventId ScheduleRealtimeNow (const Ptr<EventImpl> &event);
   EventId ScheduleDestroy (const Ptr<EventImpl> &event);
   Time Now (void) const;
-  Time RealNow (void) const;
+  Time RealtimeNow (void) const;
   void Remove (const EventId &ev);
   void Cancel (const EventId &ev);
   bool IsExpired (const EventId &ev) const;
--- a/src/simulator/realtime-simulator.cc	Fri Oct 10 21:01:50 2008 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2008 University of Washington
- *
- * 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
- */
-
-#include "simulator.h"
-#include "realtime-simulator.h"
-#include "realtime-simulator-impl.h"
-#include "event-impl.h"
-
-#include "ns3/assert.h"
-#include "ns3/log.h"
-
-NS_LOG_COMPONENT_DEFINE ("RealtimeSimulatorExtension");
-
-namespace ns3 {
-
-RealtimeSimulatorImpl *
-RealtimeSimulatorExtension::GetRealtimeImpl (void)
-{
-  RealtimeSimulatorImpl *impl = dynamic_cast<RealtimeSimulatorImpl *>(Simulator::GetImpl ());
-  NS_ASSERT_MSG (impl, 
-                 "RealtimeSimulatorExtension::GetImpl (): Underlying simulator implementation not realtime");
-  return impl;
-}
-
-Time
-RealtimeSimulatorExtension::RealNow (void)
-{
-  return GetRealtimeImpl ()->RealNow ();
-}
-
-EventId
-RealtimeSimulatorExtension::ScheduleReal (Time const &time, const Ptr<EventImpl> &ev)
-{
-  NS_LOG_FUNCTION (time << ev);
-  return GetRealtimeImpl ()->ScheduleReal (time, ev);
-}
-
-EventId
-RealtimeSimulatorExtension::ScheduleRealNow (const Ptr<EventImpl> &ev)
-{
-  NS_LOG_FUNCTION (ev);
-  return GetRealtimeImpl ()->ScheduleRealNow (ev);
-}
-
-EventId
-RealtimeSimulatorExtension::ScheduleReal (Time const &time, void (*f) (void))
-{
-  NS_LOG_FUNCTION (time << f);
-  return ScheduleReal (time, Simulator::MakeEvent (f));
-}
-
-EventId
-RealtimeSimulatorExtension::ScheduleRealNow (void (*f) (void))
-{
-  NS_LOG_FUNCTION (f);
-  return ScheduleRealNow (Simulator::MakeEvent (f));
-}
-
-} // namespace ns3
--- a/src/simulator/realtime-simulator.h	Fri Oct 10 21:01:50 2008 -0700
+++ b/src/simulator/realtime-simulator.h	Tue Oct 14 22:52:41 2008 -0700
@@ -32,7 +32,7 @@
  * events and will schedule events using the current real-time instead of 
  * the current simulation time.
  */
-class RealtimeSimulatorExtension 
+class RealtimeSimulator 
 {
 public:
   /**
@@ -49,7 +49,7 @@
    * @returns an id for the scheduled event.
    */
   template <typename MEM, typename OBJ>
-  static EventId ScheduleReal (Time const &time, MEM mem_ptr, OBJ obj);
+  static EventId ScheduleRealtime (Time const &time, MEM mem_ptr, OBJ obj);
 
   /**
    * @param time the relative expiration time of the event.
@@ -59,7 +59,7 @@
    * @returns an id for the scheduled event.
    */
   template <typename MEM, typename OBJ, typename T1>
-  static EventId ScheduleReal (Time const &time, MEM mem_ptr, OBJ obj, T1 a1);
+  static EventId ScheduleRealtime (Time const &time, MEM mem_ptr, OBJ obj, T1 a1);
 
   /**
    * @param time the relative expiration time of the event.
@@ -70,7 +70,7 @@
    * @returns an id for the scheduled event.
    */
   template <typename MEM, typename OBJ, typename T1, typename T2>
-  static EventId ScheduleReal (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2);
+  static EventId ScheduleRealtime (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2);
 
   /**
    * @param time the relative expiration time of the event.
@@ -83,7 +83,7 @@
    */
   template <typename MEM, typename OBJ, 
             typename T1, typename T2, typename T3>
-  static EventId ScheduleReal (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3);
+  static EventId ScheduleRealtime (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3);
 
   /**
    * @param time the relative expiration time of the event.
@@ -97,7 +97,7 @@
    */
   template <typename MEM, typename OBJ, 
             typename T1, typename T2, typename T3, typename T4>
-  static EventId ScheduleReal (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4);
+  static EventId ScheduleRealtime (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4);
 
   /**
    * @param time the relative expiration time of the event.
@@ -112,14 +112,14 @@
    */
   template <typename MEM, typename OBJ, 
             typename T1, typename T2, typename T3, typename T4, typename T5>
-  static EventId ScheduleReal (Time const &time, MEM mem_ptr, OBJ obj, 
+  static EventId ScheduleRealtime (Time const &time, MEM mem_ptr, OBJ obj, 
                            T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
   /**
    * @param time the relative expiration time of the event.
    * @param f the function to invoke
    * @returns an id for the scheduled event.
    */
-  static EventId ScheduleReal (Time const &time, void (*f) (void));
+  static EventId ScheduleRealtime (Time const &time, void (*f) (void));
 
   /**
    * @param time the relative expiration time of the event.
@@ -128,7 +128,7 @@
    * @returns an id for the scheduled event.
    */
   template <typename U1, typename T1>
-  static EventId ScheduleReal (Time const &time, void (*f) (U1), T1 a1);
+  static EventId ScheduleRealtime (Time const &time, void (*f) (U1), T1 a1);
 
   /**
    * @param time the relative expiration time of the event.
@@ -138,7 +138,7 @@
    * @returns an id for the scheduled event.
    */
   template <typename U1, typename U2, typename T1, typename T2>
-  static EventId ScheduleReal (Time const &time, void (*f) (U1,U2), T1 a1, T2 a2);
+  static EventId ScheduleRealtime (Time const &time, void (*f) (U1,U2), T1 a1, T2 a2);
 
   /**
    * @param time the relative expiration time of the event.
@@ -149,7 +149,7 @@
    * @returns an id for the scheduled event.
    */
   template <typename U1, typename U2, typename U3, typename T1, typename T2, typename T3>
-  static EventId ScheduleReal (Time const &time, void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3);
+  static EventId ScheduleRealtime (Time const &time, void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3);
 
   /**
    * @param time the relative expiration time of the event.
@@ -162,7 +162,7 @@
    */
   template <typename U1, typename U2, typename U3, typename U4, 
             typename T1, typename T2, typename T3, typename T4>
-  static EventId ScheduleReal (Time const &time, void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
+  static EventId ScheduleRealtime (Time const &time, void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
 
   /**
    * @param time the relative expiration time of the event.
@@ -176,7 +176,7 @@
    */
   template <typename U1, typename U2, typename U3, typename U4, typename U5,
             typename T1, typename T2, typename T3, typename T4, typename T5>
-  static EventId ScheduleReal (Time const &time, void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
+  static EventId ScheduleRealtime (Time const &time, void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
 
   /**
    * Schedule an event to expire Now. All events scheduled to
@@ -187,7 +187,7 @@
    * @param obj the object on which to invoke the member method
    */
   template <typename MEM, typename OBJ>
-  static EventId ScheduleRealNow (MEM mem_ptr, OBJ obj);
+  static EventId ScheduleRealtimeNow (MEM mem_ptr, OBJ obj);
 
   /**
    * @param mem_ptr member method pointer to invoke
@@ -196,7 +196,7 @@
    */
   template <typename MEM, typename OBJ, 
             typename T1>
-  static EventId ScheduleRealNow (MEM mem_ptr, OBJ obj, T1 a1);
+  static EventId ScheduleRealtimeNow (MEM mem_ptr, OBJ obj, T1 a1);
 
   /**
    * @param mem_ptr member method pointer to invoke
@@ -206,7 +206,7 @@
    */
   template <typename MEM, typename OBJ, 
             typename T1, typename T2>
-  static EventId ScheduleRealNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2);
+  static EventId ScheduleRealtimeNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2);
 
   /**
    * @param mem_ptr member method pointer to invoke
@@ -217,7 +217,7 @@
    */
   template <typename MEM, typename OBJ, 
             typename T1, typename T2, typename T3>
-  static EventId ScheduleRealNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3);
+  static EventId ScheduleRealtimeNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3);
 
   /**
    * @param mem_ptr member method pointer to invoke
@@ -229,7 +229,7 @@
    */
   template <typename MEM, typename OBJ, 
             typename T1, typename T2, typename T3, typename T4>
-  static EventId ScheduleRealNow (MEM mem_ptr, OBJ obj, 
+  static EventId ScheduleRealtimeNow (MEM mem_ptr, OBJ obj, 
                               T1 a1, T2 a2, T3 a3, T4 a4);
   /**
    * @param mem_ptr member method pointer to invoke
@@ -242,12 +242,12 @@
    */
   template <typename MEM, typename OBJ, 
             typename T1, typename T2, typename T3, typename T4, typename T5>
-  static EventId ScheduleRealNow (MEM mem_ptr, OBJ obj, 
+  static EventId ScheduleRealtimeNow (MEM mem_ptr, OBJ obj, 
                               T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
   /**
    * @param f the function to invoke
    */
-  static EventId ScheduleRealNow (void (*f) (void));
+  static EventId ScheduleRealtimeNow (void (*f) (void));
 
   /**
    * @param f the function to invoke
@@ -255,7 +255,7 @@
    */
   template <typename U1,
             typename T1>
-  static EventId ScheduleRealNow (void (*f) (U1), T1 a1);
+  static EventId ScheduleRealtimeNow (void (*f) (U1), T1 a1);
 
   /**
    * @param f the function to invoke
@@ -264,7 +264,7 @@
    */
   template <typename U1, typename U2,
             typename T1, typename T2>
-  static EventId ScheduleRealNow (void (*f) (U1,U2), T1 a1, T2 a2);
+  static EventId ScheduleRealtimeNow (void (*f) (U1,U2), T1 a1, T2 a2);
 
   /**
    * @param f the function to invoke
@@ -274,7 +274,7 @@
    */
   template <typename U1, typename U2, typename U3,
             typename T1, typename T2, typename T3>
-  static EventId ScheduleRealNow (void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3);
+  static EventId ScheduleRealtimeNow (void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3);
 
   /**
    * @param f the function to invoke
@@ -285,7 +285,7 @@
    */
   template <typename U1, typename U2, typename U3, typename U4,
             typename T1, typename T2, typename T3, typename T4>
-  static EventId ScheduleRealNow (void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
+  static EventId ScheduleRealtimeNow (void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4);
 
   /**
    * @param f the function to invoke
@@ -297,12 +297,12 @@
    */
   template <typename U1, typename U2, typename U3, typename U4, typename U5,
             typename T1, typename T2, typename T3, typename T4, typename T5>
-  static EventId ScheduleRealNow (void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
+  static EventId ScheduleRealtimeNow (void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
 
   /**
    * Return the "current normalized real-time".
    */
-  static Time RealNow (void);
+  static Time RealtimeNow (void);
 
   /**
    * \param time delay until the event expires
@@ -312,7 +312,7 @@
    * This method will be typically used by language bindings
    * to delegate events to their own subclass of the EventImpl base class.
    */
-  static EventId ScheduleReal (Time const &time, const Ptr<EventImpl> &event);  
+  static EventId ScheduleRealtime (Time const &time, const Ptr<EventImpl> &event);  
 
   /**
    * \param event the event to schedule
@@ -321,176 +321,176 @@
    * This method will be typically used by language bindings
    * to delegate events to their own subclass of the EventImpl base class.
    */
-  static EventId ScheduleRealNow (const Ptr<EventImpl> &event);
+  static EventId ScheduleRealtimeNow (const Ptr<EventImpl> &event);
 private:
-  RealtimeSimulatorExtension ();
-  ~RealtimeSimulatorExtension ();
+  RealtimeSimulator ();
+  ~RealtimeSimulator ();
 
   static RealtimeSimulatorImpl *GetRealtimeImpl (void);
 };
 
 template <typename MEM, typename OBJ>
-EventId RealtimeSimulatorExtension::ScheduleReal (Time const &time, MEM mem_ptr, OBJ obj) 
+EventId RealtimeSimulator::ScheduleRealtime (Time const &time, MEM mem_ptr, OBJ obj) 
 {
-  return ScheduleReal (time, Simulator::MakeEvent (mem_ptr, obj));
+  return ScheduleRealtime (time, Simulator::MakeEvent (mem_ptr, obj));
 }
 
 template <typename MEM, typename OBJ,
           typename T1>
-EventId RealtimeSimulatorExtension::ScheduleReal (Time const &time, MEM mem_ptr, OBJ obj, T1 a1) 
+EventId RealtimeSimulator::ScheduleRealtime (Time const &time, MEM mem_ptr, OBJ obj, T1 a1) 
 {
-  return ScheduleReal (time, Simulator::MakeEvent (mem_ptr, obj, a1));
+  return ScheduleRealtime (time, Simulator::MakeEvent (mem_ptr, obj, a1));
 }
 
 template <typename MEM, typename OBJ, 
           typename T1, typename T2>
-EventId RealtimeSimulatorExtension::ScheduleReal (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2)
+EventId RealtimeSimulator::ScheduleRealtime (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2)
 {
-  return ScheduleReal (time, Simulator::MakeEvent (mem_ptr, obj, a1, a2));
+  return ScheduleRealtime (time, Simulator::MakeEvent (mem_ptr, obj, a1, a2));
 }
 
 template <typename MEM, typename OBJ,
           typename T1, typename T2, typename T3>
-EventId RealtimeSimulatorExtension::ScheduleReal (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3) 
+EventId RealtimeSimulator::ScheduleRealtime (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3) 
 {
-  return ScheduleReal (time, Simulator::MakeEvent (mem_ptr, obj, a1, a2, a3));
+  return ScheduleRealtime (time, Simulator::MakeEvent (mem_ptr, obj, a1, a2, a3));
 }
 
 template <typename MEM, typename OBJ, 
           typename T1, typename T2, typename T3, typename T4>
-EventId RealtimeSimulatorExtension::ScheduleReal (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4) 
+EventId RealtimeSimulator::ScheduleRealtime (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4) 
 {
-  return ScheduleReal (time, Simulator::MakeEvent (mem_ptr, obj, a1, a2, a3, a4));
+  return ScheduleRealtime (time, Simulator::MakeEvent (mem_ptr, obj, a1, a2, a3, a4));
 }
 
 template <typename MEM, typename OBJ, 
           typename T1, typename T2, typename T3, typename T4, typename T5>
-EventId RealtimeSimulatorExtension::ScheduleReal (Time const &time, MEM mem_ptr, OBJ obj, 
+EventId RealtimeSimulator::ScheduleRealtime (Time const &time, MEM mem_ptr, OBJ obj, 
                              T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) 
 {
-  return ScheduleReal (time, Simulator::MakeEvent (mem_ptr, obj, a1, a2, a3, a4, a5));
+  return ScheduleRealtime (time, Simulator::MakeEvent (mem_ptr, obj, a1, a2, a3, a4, a5));
 }
 
 template <typename U1, typename T1>
-EventId RealtimeSimulatorExtension::ScheduleReal (Time const &time, void (*f) (U1), T1 a1) 
+EventId RealtimeSimulator::ScheduleRealtime (Time const &time, void (*f) (U1), T1 a1) 
 {
-  return ScheduleReal (time, Simulator::MakeEvent (f, a1));
+  return ScheduleRealtime (time, Simulator::MakeEvent (f, a1));
 }
 
 template <typename U1, typename U2, 
           typename T1, typename T2>
-EventId RealtimeSimulatorExtension::ScheduleReal (Time const &time, void (*f) (U1,U2), T1 a1, T2 a2) 
+EventId RealtimeSimulator::ScheduleRealtime (Time const &time, void (*f) (U1,U2), T1 a1, T2 a2) 
 {
-  return ScheduleReal (time, Simulator::MakeEvent (f, a1, a2));
+  return ScheduleRealtime (time, Simulator::MakeEvent (f, a1, a2));
 }
 
 template <typename U1, typename U2, typename U3,
           typename T1, typename T2, typename T3>
-EventId RealtimeSimulatorExtension::ScheduleReal (Time const &time, void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3)
+EventId RealtimeSimulator::ScheduleRealtime (Time const &time, void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3)
 {
-  return ScheduleReal (time, Simulator::MakeEvent (f, a1, a2, a3));
+  return ScheduleRealtime (time, Simulator::MakeEvent (f, a1, a2, a3));
 }
 
 template <typename U1, typename U2, typename U3, typename U4,
           typename T1, typename T2, typename T3, typename T4>
-EventId RealtimeSimulatorExtension::ScheduleReal (Time const &time, void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4) 
+EventId RealtimeSimulator::ScheduleRealtime (Time const &time, void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4) 
 {
-  return ScheduleReal (time, Simulator::MakeEvent (f, a1, a2, a3, a4));
+  return ScheduleRealtime (time, Simulator::MakeEvent (f, a1, a2, a3, a4));
 }
 
 template <typename U1, typename U2, typename U3, typename U4, typename U5,
           typename T1, typename T2, typename T3, typename T4, typename T5>
-EventId RealtimeSimulatorExtension::ScheduleReal (Time const &time, void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) 
+EventId RealtimeSimulator::ScheduleRealtime (Time const &time, void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) 
 {
-  return ScheduleReal (time, Simulator::MakeEvent (f, a1, a2, a3, a4, a5));
+  return ScheduleRealtime (time, Simulator::MakeEvent (f, a1, a2, a3, a4, a5));
 }
 
 template <typename MEM, typename OBJ>
 EventId
-RealtimeSimulatorExtension::ScheduleRealNow (MEM mem_ptr, OBJ obj) 
+RealtimeSimulator::ScheduleRealtimeNow (MEM mem_ptr, OBJ obj) 
 {
-  return ScheduleRealNow (Simulator::MakeEvent (mem_ptr, obj));
+  return ScheduleRealtimeNow (Simulator::MakeEvent (mem_ptr, obj));
 }
 
 template <typename MEM, typename OBJ, 
           typename T1>
 EventId
-RealtimeSimulatorExtension::ScheduleRealNow (MEM mem_ptr, OBJ obj, T1 a1) 
+RealtimeSimulator::ScheduleRealtimeNow (MEM mem_ptr, OBJ obj, T1 a1) 
 {
-  return ScheduleRealNow (Simulator::MakeEvent (mem_ptr, obj, a1));
+  return ScheduleRealtimeNow (Simulator::MakeEvent (mem_ptr, obj, a1));
 }
 
 template <typename MEM, typename OBJ, 
           typename T1, typename T2>
 EventId
-RealtimeSimulatorExtension::ScheduleRealNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2) 
+RealtimeSimulator::ScheduleRealtimeNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2) 
 {
-  return ScheduleRealNow (Simulator::MakeEvent (mem_ptr, obj, a1, a2));
+  return ScheduleRealtimeNow (Simulator::MakeEvent (mem_ptr, obj, a1, a2));
 }
 
 template <typename MEM, typename OBJ, 
           typename T1, typename T2, typename T3>
 EventId
-RealtimeSimulatorExtension::ScheduleRealNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3) 
+RealtimeSimulator::ScheduleRealtimeNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3) 
 {
-  return ScheduleRealNow (Simulator::MakeEvent (mem_ptr, obj, a1, a2, a3));
+  return ScheduleRealtimeNow (Simulator::MakeEvent (mem_ptr, obj, a1, a2, a3));
 }
 
 template <typename MEM, typename OBJ, 
           typename T1, typename T2, typename T3, typename T4>
 EventId
-RealtimeSimulatorExtension::ScheduleRealNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4) 
+RealtimeSimulator::ScheduleRealtimeNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4) 
 {
-  return ScheduleRealNow (Simulator::MakeEvent (mem_ptr, obj, a1, a2, a3, a4));
+  return ScheduleRealtimeNow (Simulator::MakeEvent (mem_ptr, obj, a1, a2, a3, a4));
 }
 
 template <typename MEM, typename OBJ, 
           typename T1, typename T2, typename T3, typename T4, typename T5>
 EventId
-RealtimeSimulatorExtension::ScheduleRealNow (MEM mem_ptr, OBJ obj, 
+RealtimeSimulator::ScheduleRealtimeNow (MEM mem_ptr, OBJ obj, 
                         T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) 
 {
-  return ScheduleRealNow (Simulator::MakeEvent (mem_ptr, obj, a1, a2, a3, a4, a5));
+  return ScheduleRealtimeNow (Simulator::MakeEvent (mem_ptr, obj, a1, a2, a3, a4, a5));
 }
 
 template <typename U1,
           typename T1>
 EventId
-RealtimeSimulatorExtension::ScheduleRealNow (void (*f) (U1), T1 a1) 
+RealtimeSimulator::ScheduleRealtimeNow (void (*f) (U1), T1 a1) 
 {
-  return ScheduleRealNow (Simulator::MakeEvent (f, a1));
+  return ScheduleRealtimeNow (Simulator::MakeEvent (f, a1));
 }
 
 template <typename U1, typename U2,
           typename T1, typename T2>
 EventId
-RealtimeSimulatorExtension::ScheduleRealNow (void (*f) (U1,U2), T1 a1, T2 a2) 
+RealtimeSimulator::ScheduleRealtimeNow (void (*f) (U1,U2), T1 a1, T2 a2) 
 {
-  return ScheduleRealNow (Simulator::MakeEvent (f, a1, a2));
+  return ScheduleRealtimeNow (Simulator::MakeEvent (f, a1, a2));
 }
 
 template <typename U1, typename U2, typename U3,
           typename T1, typename T2, typename T3>
 EventId
-RealtimeSimulatorExtension::ScheduleRealNow (void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3)
+RealtimeSimulator::ScheduleRealtimeNow (void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3)
 {
-  return ScheduleRealNow (Simulator::MakeEvent (f, a1, a2, a3));
+  return ScheduleRealtimeNow (Simulator::MakeEvent (f, a1, a2, a3));
 }
 
 template <typename U1, typename U2, typename U3, typename U4,
           typename T1, typename T2, typename T3, typename T4>
 EventId
-RealtimeSimulatorExtension::ScheduleRealNow (void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4) 
+RealtimeSimulator::ScheduleRealtimeNow (void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4) 
 {
-  return ScheduleRealNow (Simulator::MakeEvent (f, a1, a2, a3, a4));
+  return ScheduleRealtimeNow (Simulator::MakeEvent (f, a1, a2, a3, a4));
 }
 
 template <typename U1, typename U2, typename U3, typename U4, typename U5,
           typename T1, typename T2, typename T3, typename T4, typename T5>
 EventId
-RealtimeSimulatorExtension::ScheduleRealNow (void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) 
+RealtimeSimulator::ScheduleRealtimeNow (void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) 
 {
-  return ScheduleRealNow (Simulator::MakeEvent (f, a1, a2, a3, a4, a5));
+  return ScheduleRealtimeNow (Simulator::MakeEvent (f, a1, a2, a3, a4, a5));
 }
 
 }; // namespace ns3
--- a/src/simulator/simulator.cc	Fri Oct 10 21:01:50 2008 -0700
+++ b/src/simulator/simulator.cc	Tue Oct 14 22:52:41 2008 -0700
@@ -19,8 +19,10 @@
  */
 
 #include "simulator.h"
+#include "realtime-simulator.h"
 #include "simulator-impl.h"
 #include "default-simulator-impl.h"
+#include "realtime-simulator-impl.h"
 #include "scheduler.h"
 #include "map-scheduler.h"
 #include "event-impl.h"
@@ -288,6 +290,49 @@
   NS_FATAL_ERROR ("TODO");
 }
 
+RealtimeSimulatorImpl *
+RealtimeSimulator::GetRealtimeImpl (void)
+{
+  RealtimeSimulatorImpl *impl = dynamic_cast<RealtimeSimulatorImpl *>(Simulator::GetImpl ());
+  NS_ASSERT_MSG (impl, 
+                 "RealtimeSimulator::GetImpl (): Underlying simulator implementation not realtime");
+  return impl;
+}
+
+Time
+RealtimeSimulator::RealtimeNow (void)
+{
+  return GetRealtimeImpl ()->RealtimeNow ();
+}
+
+EventId
+RealtimeSimulator::ScheduleRealtime (Time const &time, const Ptr<EventImpl> &ev)
+{
+  NS_LOG_FUNCTION (time << ev);
+  return GetRealtimeImpl ()->ScheduleRealtime (time, ev);
+}
+
+EventId
+RealtimeSimulator::ScheduleRealtimeNow (const Ptr<EventImpl> &ev)
+{
+  NS_LOG_FUNCTION (ev);
+  return GetRealtimeImpl ()->ScheduleRealtimeNow (ev);
+}
+
+EventId
+RealtimeSimulator::ScheduleRealtime (Time const &time, void (*f) (void))
+{
+  NS_LOG_FUNCTION (time << f);
+  return ScheduleRealtime (time, Simulator::MakeEvent (f));
+}
+
+EventId
+RealtimeSimulator::ScheduleRealtimeNow (void (*f) (void))
+{
+  NS_LOG_FUNCTION (f);
+  return ScheduleRealtimeNow (Simulator::MakeEvent (f));
+}
+
 
 } // namespace ns3
 
--- a/src/simulator/simulator.h	Fri Oct 10 21:01:50 2008 -0700
+++ b/src/simulator/simulator.h	Tue Oct 14 22:52:41 2008 -0700
@@ -56,7 +56,7 @@
  */
 class Simulator 
 {
-  friend class RealtimeSimulatorExtension;
+  friend class RealtimeSimulator;
 
 public:
   /**
--- a/src/simulator/wscript	Fri Oct 10 21:01:50 2008 -0700
+++ b/src/simulator/wscript	Tue Oct 14 22:52:41 2008 -0700
@@ -61,7 +61,6 @@
         'heap-scheduler.cc',
         'event-impl.cc',
         'simulator.cc',
-        'realtime-simulator.cc',
         'default-simulator-impl.cc',
         'timer.cc',
         'watchdog.cc',