From 97fef32b2201a2f452c85fb30249cf3f90c9258a Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Thu, 8 Apr 2010 10:49:59 +0200 Subject: [PATCH] deprecate simulator API --- src/simulator/simulator.cc | 20 ++++++-------------- src/simulator/simulator.h | 31 +++++++++++++++---------------- 2 files changed, 21 insertions(+), 30 deletions(-) diff --git a/src/simulator/simulator.cc b/src/simulator/simulator.cc index dd2e77594..d91501b6b 100644 --- a/src/simulator/simulator.cc +++ b/src/simulator/simulator.cc @@ -217,20 +217,17 @@ Simulator::Schedule (Time const &time, const Ptr &ev) return DoSchedule (time, GetPointer (ev)); } -void -Simulator::ScheduleWithContext (uint32_t context, Time const &time, const Ptr &ev) -{ - NS_LOG_FUNCTION (time << context << ev); - return DoScheduleWithContext (context, time, GetPointer (ev)); -} - EventId Simulator::ScheduleNow (const Ptr &ev) { NS_LOG_FUNCTION (ev); return DoScheduleNow (GetPointer (ev)); } - +void +Simulator::ScheduleWithContext (uint32_t context, const Time &time, EventImpl *impl) +{ + return GetImpl ()->ScheduleWithContext (context, time, impl); +} EventId Simulator::ScheduleDestroy (const Ptr &ev) { @@ -242,11 +239,6 @@ Simulator::DoSchedule (Time const &time, EventImpl *impl) { return GetImpl ()->Schedule (time, impl); } -void -Simulator::DoScheduleWithContext (uint32_t context, Time const &time, EventImpl *impl) -{ - return GetImpl ()->ScheduleWithContext (context, time, impl); -} EventId Simulator::DoScheduleNow (EventImpl *impl) { @@ -270,7 +262,7 @@ void Simulator::ScheduleWithContext (uint32_t context, Time const &time, void (*f) (void)) { NS_LOG_FUNCTION (time << context << f); - return DoScheduleWithContext (context, time, MakeEvent (f)); + return ScheduleWithContext (context, time, MakeEvent (f)); } EventId diff --git a/src/simulator/simulator.h b/src/simulator/simulator.h index a0c5d58dc..a9a4dc5fb 100644 --- a/src/simulator/simulator.h +++ b/src/simulator/simulator.h @@ -102,11 +102,11 @@ public: */ static bool IsFinished (void); /** - * If Simulator::isFinished returns true, the behavior of this + * If Simulator::IsFinished returns true, the behavior of this * method is undefined. Otherwise, it returns the microsecond-based * time of the next event expected to be scheduled. */ - static Time Next (void); + static Time Next (void) NS_DEPRECATED; /** * Run the simulation until one of: @@ -121,7 +121,7 @@ public: /** * Process only the next simulation event, then return immediately. */ - static void RunOneEvent (void); + static void RunOneEvent (void) NS_DEPRECATED; /** * If an event invokes this method, it will be the last @@ -751,7 +751,7 @@ public: * This method will be typically used by language bindings * to delegate events to their own subclass of the EventImpl base class. */ - static void ScheduleWithContext (uint32_t context, Time const &time, const Ptr &event); + static void ScheduleWithContext (uint32_t context, const Time &time, EventImpl *event); /** * \param event the event to schedule @@ -781,7 +781,6 @@ private: ~Simulator (); static EventId DoSchedule (Time const &time, EventImpl *event); - static void DoScheduleWithContext (uint32_t context, Time const &time, EventImpl *event); static EventId DoScheduleNow (EventImpl *event); static EventId DoScheduleDestroy (EventImpl *event); }; @@ -886,7 +885,7 @@ EventId Simulator::Schedule (Time const &time, void (*f) (U1,U2,U3,U4,U5), T1 a1 template void Simulator::ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj) { - DoScheduleWithContext (context, time, MakeEvent (mem_ptr, obj)); + ScheduleWithContext (context, time, MakeEvent (mem_ptr, obj)); } @@ -894,28 +893,28 @@ template void Simulator::ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj, T1 a1) { - return DoScheduleWithContext (context, time, MakeEvent (mem_ptr, obj, a1)); + return ScheduleWithContext (context, time, MakeEvent (mem_ptr, obj, a1)); } template void Simulator::ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2) { - return DoScheduleWithContext (context, time, MakeEvent (mem_ptr, obj, a1, a2)); + return ScheduleWithContext (context, time, MakeEvent (mem_ptr, obj, a1, a2)); } template void Simulator::ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3) { - return DoScheduleWithContext (context, time, MakeEvent (mem_ptr, obj, a1, a2, a3)); + return ScheduleWithContext (context, time, MakeEvent (mem_ptr, obj, a1, a2, a3)); } template void Simulator::ScheduleWithContext (uint32_t context, Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4) { - return DoScheduleWithContext (context, time, MakeEvent (mem_ptr, obj, a1, a2, a3, a4)); + return ScheduleWithContext (context, time, MakeEvent (mem_ptr, obj, a1, a2, a3, a4)); } template void Simulator::ScheduleWithContext (uint32_t context, Time const &time, void (*f) (U1), T1 a1) { - return DoScheduleWithContext (context, time, MakeEvent (f, a1)); + return ScheduleWithContext (context, time, MakeEvent (f, a1)); } template void Simulator::ScheduleWithContext (uint32_t context, Time const &time, void (*f) (U1,U2), T1 a1, T2 a2) { - return DoScheduleWithContext (context, time, MakeEvent (f, a1, a2)); + return ScheduleWithContext (context, time, MakeEvent (f, a1, a2)); } template void Simulator::ScheduleWithContext (uint32_t context, Time const &time, void (*f) (U1,U2,U3), T1 a1, T2 a2, T3 a3) { - return DoScheduleWithContext (context, time, MakeEvent (f, a1, a2, a3)); + return ScheduleWithContext (context, time, MakeEvent (f, a1, a2, a3)); } template void Simulator::ScheduleWithContext (uint32_t context, Time const &time, void (*f) (U1,U2,U3,U4), T1 a1, T2 a2, T3 a3, T4 a4) { - return DoScheduleWithContext (context, time, MakeEvent (f, a1, a2, a3, a4)); + return ScheduleWithContext (context, time, MakeEvent (f, a1, a2, a3, a4)); } template void Simulator::ScheduleWithContext (uint32_t context, Time const &time, void (*f) (U1,U2,U3,U4,U5), T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) { - return DoScheduleWithContext (context, time, MakeEvent (f, a1, a2, a3, a4, a5)); + return ScheduleWithContext (context, time, MakeEvent (f, a1, a2, a3, a4, a5)); }