Make Simulator::IsExpired parameter const, to reflect the fact that the EventId is not changed. EventId::IsExpired and EventId::IsRunning also made const.
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Thu, 12 Jul 2007 12:41:37 +0100
changeset 927 b5bc396a29b0
parent 926 1fdec986d774
child 928 218063b19458
Make Simulator::IsExpired parameter const, to reflect the fact that the EventId is not changed. EventId::IsExpired and EventId::IsRunning also made const.
src/simulator/event-id.cc
src/simulator/event-id.h
src/simulator/simulator.cc
src/simulator/simulator.h
--- 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".
    */