--- a/src/core/model/realtime-simulator-impl.cc Sat Nov 10 18:45:37 2012 +0100
+++ b/src/core/model/realtime-simulator-impl.cc Sat Nov 10 19:16:38 2012 +0100
@@ -65,7 +65,7 @@
RealtimeSimulatorImpl::RealtimeSimulatorImpl ()
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
m_stop = false;
m_running = false;
@@ -89,12 +89,13 @@
RealtimeSimulatorImpl::~RealtimeSimulatorImpl ()
{
+ NS_LOG_FUNCTION (this);
}
void
RealtimeSimulatorImpl::DoDispose (void)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
while (!m_events->IsEmpty ())
{
Scheduler::Event next = m_events->RemoveNext ();
@@ -108,7 +109,7 @@
void
RealtimeSimulatorImpl::Destroy ()
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
//
// This function is only called with the private version "disconnected" from
@@ -133,7 +134,7 @@
void
RealtimeSimulatorImpl::SetScheduler (ObjectFactory schedulerFactory)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << schedulerFactory);
Ptr<Scheduler> scheduler = schedulerFactory.Create<Scheduler> ();
@@ -155,7 +156,7 @@
void
RealtimeSimulatorImpl::ProcessOneEvent (void)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
//
// The idea here is to wait until the next event comes due. In the case of
// a realtime simulation, we want real time to be consumed between events.
@@ -385,7 +386,7 @@
bool
RealtimeSimulatorImpl::IsFinished (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
bool rc;
{
CriticalSection cs (m_mutex);
@@ -401,7 +402,7 @@
uint64_t
RealtimeSimulatorImpl::NextTs (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
NS_ASSERT_MSG (m_events->IsEmpty () == false,
"RealtimeSimulatorImpl::NextTs(): event queue is empty");
Scheduler::Event ev = m_events->PeekNext ();
@@ -411,7 +412,7 @@
void
RealtimeSimulatorImpl::Run (void)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
NS_ASSERT_MSG (m_running == false,
"RealtimeSimulatorImpl::Run(): Simulator already running");
@@ -473,27 +474,28 @@
bool
RealtimeSimulatorImpl::Running (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_running;
}
bool
RealtimeSimulatorImpl::Realtime (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_synchronizer->Realtime ();
}
void
RealtimeSimulatorImpl::Stop (void)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
m_stop = true;
}
void
RealtimeSimulatorImpl::Stop (Time const &time)
{
+ NS_LOG_FUNCTION (this << time);
Simulator::Schedule (time, &Simulator::Stop);
}
@@ -503,7 +505,7 @@
EventId
RealtimeSimulatorImpl::Schedule (Time const &time, EventImpl *impl)
{
- NS_LOG_FUNCTION (time << impl);
+ NS_LOG_FUNCTION (this << time << impl);
Scheduler::Event ev;
{
@@ -533,7 +535,7 @@
void
RealtimeSimulatorImpl::ScheduleWithContext (uint32_t context, Time const &time, EventImpl *impl)
{
- NS_LOG_FUNCTION (time << impl);
+ NS_LOG_FUNCTION (this << context << time << impl);
{
CriticalSection cs (m_mutex);
@@ -569,7 +571,7 @@
EventId
RealtimeSimulatorImpl::ScheduleNow (EventImpl *impl)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << impl);
Scheduler::Event ev;
{
CriticalSection cs (m_mutex);
@@ -590,6 +592,7 @@
Time
RealtimeSimulatorImpl::Now (void) const
{
+ NS_LOG_FUNCTION (this);
return TimeStep (m_currentTs);
}
@@ -599,7 +602,7 @@
void
RealtimeSimulatorImpl::ScheduleRealtimeWithContext (uint32_t context, Time const &time, EventImpl *impl)
{
- NS_LOG_FUNCTION (context << time << impl);
+ NS_LOG_FUNCTION (this << context << time << impl);
{
CriticalSection cs (m_mutex);
@@ -620,14 +623,14 @@
void
RealtimeSimulatorImpl::ScheduleRealtime (Time const &time, EventImpl *impl)
{
- NS_LOG_FUNCTION (time << impl);
+ NS_LOG_FUNCTION (this << time << impl);
ScheduleRealtimeWithContext (GetContext (), time, impl);
}
void
RealtimeSimulatorImpl::ScheduleRealtimeNowWithContext (uint32_t context, EventImpl *impl)
{
- NS_LOG_FUNCTION (context << impl);
+ NS_LOG_FUNCTION (this << context << impl);
{
CriticalSection cs (m_mutex);
@@ -653,20 +656,21 @@
void
RealtimeSimulatorImpl::ScheduleRealtimeNow (EventImpl *impl)
{
- NS_LOG_FUNCTION (impl);
+ NS_LOG_FUNCTION (this << impl);
ScheduleRealtimeNowWithContext (GetContext (), impl);
}
Time
RealtimeSimulatorImpl::RealtimeNow (void) const
{
+ NS_LOG_FUNCTION (this);
return TimeStep (m_synchronizer->GetCurrentRealtime ());
}
EventId
RealtimeSimulatorImpl::ScheduleDestroy (EventImpl *impl)
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this << impl);
EventId id;
{
@@ -692,6 +696,7 @@
// If the event has expired, there is no delay until it runs. It is not the
// case that there is a negative time until it runs.
//
+ NS_LOG_FUNCTION (this << &id);
if (IsExpired (id))
{
return TimeStep (0);
@@ -703,6 +708,7 @@
void
RealtimeSimulatorImpl::Remove (const EventId &id)
{
+ NS_LOG_FUNCTION (this << &id);
if (id.GetUid () == 2)
{
// destroy events.
@@ -742,6 +748,7 @@
void
RealtimeSimulatorImpl::Cancel (const EventId &id)
{
+ NS_LOG_FUNCTION (this << &id);
if (IsExpired (id) == false)
{
id.PeekEventImpl ()->Cancel ();
@@ -751,6 +758,7 @@
bool
RealtimeSimulatorImpl::IsExpired (const EventId &ev) const
{
+ NS_LOG_FUNCTION (this << &ev);
if (ev.GetUid () == 2)
{
if (ev.PeekEventImpl () == 0 ||
@@ -796,6 +804,7 @@
{
// XXX: I am fairly certain other compilers use other non-standard
// post-fixes to indicate 64 bit constants.
+ NS_LOG_FUNCTION (this);
return TimeStep (0x7fffffffffffffffLL);
}
@@ -803,40 +812,42 @@
uint32_t
RealtimeSimulatorImpl::GetSystemId (void) const
{
+ NS_LOG_FUNCTION (this);
return 0;
}
uint32_t
RealtimeSimulatorImpl::GetContext (void) const
{
+ NS_LOG_FUNCTION (this);
return m_currentContext;
}
void
RealtimeSimulatorImpl::SetSynchronizationMode (enum SynchronizationMode mode)
{
- NS_LOG_FUNCTION (mode);
+ NS_LOG_FUNCTION (this << mode);
m_synchronizationMode = mode;
}
RealtimeSimulatorImpl::SynchronizationMode
RealtimeSimulatorImpl::GetSynchronizationMode (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_synchronizationMode;
}
void
RealtimeSimulatorImpl::SetHardLimit (Time limit)
{
- NS_LOG_FUNCTION (limit);
+ NS_LOG_FUNCTION (this << limit);
m_hardLimit = limit;
}
Time
RealtimeSimulatorImpl::GetHardLimit (void) const
{
- NS_LOG_FUNCTION_NOARGS ();
+ NS_LOG_FUNCTION (this);
return m_hardLimit;
}