# HG changeset patch # User Mathieu Lacage # Date 1190988856 -7200 # Node ID 96172e357b93e8ffcc6449fced782915e830e118 # Parent b10b13bad5e98e5e6ff3f0dd5b601903f31a8bda add a Timer::Schedule (delay) method diff -r b10b13bad5e9 -r 96172e357b93 src/simulator/timer.cc --- a/src/simulator/timer.cc Fri Sep 28 13:27:37 2007 +0200 +++ b/src/simulator/timer.cc Fri Sep 28 16:14:16 2007 +0200 @@ -84,6 +84,12 @@ void Timer::Schedule (void) { + Schedule (m_delay); +} + +void +Timer::Schedule (Time delay) +{ NS_ASSERT (m_impl != 0); if (m_flags & CHECK_ON_SCHEDULE) { @@ -100,7 +106,7 @@ { Simulator::Remove (m_event); } - m_event = m_impl->Schedule (m_delay); + m_event = m_impl->Schedule (delay); if (m_flags & GARBAGE_COLLECT) { SimulationSingleton::Get ()->Track (m_event); diff -r b10b13bad5e9 -r 96172e357b93 src/simulator/timer.h --- a/src/simulator/timer.h Fri Sep 28 13:27:37 2007 +0200 +++ b/src/simulator/timer.h Fri Sep 28 16:14:16 2007 +0200 @@ -190,12 +190,18 @@ * \return true if there is a currently-running event, false otherwise. */ bool IsRunning (void) const; - /** * Schedule a new event using the currently-configured delay, function, * and arguments. */ void Schedule (void); + /** + * \param delay the delay to use + * + * Schedule a new event using the specified delay (ignore the delay set by + * Timer::SetDelay), function, and arguments. + */ + void Schedule (Time delay); private: template