document EventId
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Wed, 06 Sep 2006 14:46:09 +0200
changeset 70 fcd8da09ef75
parent 69 a56eda76b6fa
child 71 62546bded467
document EventId
src/simulator/event-id.h
src/simulator/simulator.h
--- a/src/simulator/event-id.h	Wed Sep 06 14:35:40 2006 +0200
+++ b/src/simulator/event-id.h	Wed Sep 06 14:46:09 2006 +0200
@@ -27,11 +27,23 @@
 
 class EventImpl;
 
+/**
+ * \brief an identifier for simulation events.
+ */
 class EventId {
 public:
     EventId ();
     EventId (EventImpl *impl, uint64_t ns, uint32_t uid);
+	/**
+	 * This method is syntactic sugar for the ns3::Simulator::cancel
+	 * method.
+	 */
     void cancel (void);
+	/**
+	 * This method is syntactic sugar for the ns3::Simulator::isExpired
+	 * method.
+	 * \returns true if the event has expired, false otherwise.
+	 */
     bool isExpired (void);
 public:
     /* The following methods are semi-private
--- a/src/simulator/simulator.h	Wed Sep 06 14:35:40 2006 +0200
+++ b/src/simulator/simulator.h	Wed Sep 06 14:46:09 2006 +0200
@@ -551,20 +551,35 @@
         return schedule (time, ev);
     }
     /**
-     * Unschedule the event. i.e.: the removed event never expires.
+     * Remove an event from the event list. 
+	 * This method has the same visible effect as the 
+	 * ns3::Simulator::cancel method or the ns3::EventId::cancel method
+	 * but its algorithmic complexity is much higher: it has often 
+	 * O(log(n)) complexity, sometimes O(n), sometimes worse.
+	 *
      * @param id the event to remove from the list of scheduled events.
      */
     static void remove (EventId id);
-    /*
-      XXX
+    /**
+	 * Set the cancel bit on this event: the event's associated function
+	 * will not be invoked when it expires. 
+	 * This method has the same visible effect as the 
+	 * ns3::Simulator::remove method but its algorithmic complexity is 
+	 * much lower: it has O(1) complexity.
+	 * This method has the exact same semantics as ns3::EventId::cancel.
+	 * 
+	 * @param id the event to cancel
      */
     static void cancel (EventId id);
-    /*
-      XXX
+    /**
+	 * This method has O(1) complexity
+	 *
+	 * @param id the event to test for expiration
+	 * @returns true if the event has expired, false otherwise.
      */
     static bool isExpired (EventId id);
     /**
-     * Return the "current time".
+     * Return the "current simulation time".
      */
     static Time now (void);
 private: