Make Simulator::IsExpired parameter const, to reflect the fact that the EventId is not changed. EventId::IsExpired and EventId::IsRunning also made const.
--- a/src/simulator/event-id.cc Fri Jul 13 10:40:10 2007 +0200
+++ b/src/simulator/event-id.cc Thu Jul 12 12:41:37 2007 +0100
@@ -45,12 +45,12 @@
}
}
bool
-EventId::IsExpired (void)
+EventId::IsExpired (void) const
{
return Simulator::IsExpired (*this);
}
bool
-EventId::IsRunning (void)
+EventId::IsRunning (void) const
{
return !IsExpired ();
}
--- a/src/simulator/event-id.h Fri Jul 13 10:40:10 2007 +0200
+++ b/src/simulator/event-id.h Thu Jul 12 12:41:37 2007 +0100
@@ -44,8 +44,8 @@
* method.
* \returns true if the event has expired, false otherwise.
*/
- bool IsExpired (void);
- bool IsRunning (void);
+ bool IsExpired (void) const;
+ bool IsRunning (void) const;
public:
/* The following methods are semi-private
* they are supposed to be invoked only by
--- a/src/simulator/simulator.cc Fri Jul 13 10:40:10 2007 +0200
+++ b/src/simulator/simulator.cc Thu Jul 12 12:41:37 2007 +0100
@@ -266,7 +266,7 @@
}
bool
-SimulatorPrivate::IsExpired (EventId ev)
+SimulatorPrivate::IsExpired (const EventId ev)
{
if (ev.GetEventImpl () == 0 ||
ev.GetTs () < m_currentTs ||
--- a/src/simulator/simulator.h Fri Jul 13 10:40:10 2007 +0200
+++ b/src/simulator/simulator.h Thu Jul 12 12:41:37 2007 +0100
@@ -529,7 +529,7 @@
* @param id the event to test for expiration
* @returns true if the event has expired, false otherwise.
*/
- static bool IsExpired (EventId id);
+ static bool IsExpired (const EventId id);
/**
* Return the "current simulation time".
*/