bug 204: implement Queue::DequeueAll.
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Wed Jun 04 09:22:37 2008 -0700 (20 months ago)
changeset 32145c73d8f952bf
parent 3213 08a0424399fb
child 3215 c5a74196e87a
bug 204: implement Queue::DequeueAll.
src/node/queue.cc
src/node/queue.h
     1.1 --- a/src/node/queue.cc	Wed Jun 04 09:19:16 2008 -0700
     1.2 +++ b/src/node/queue.cc	Wed Jun 04 09:22:37 2008 -0700
     1.3 @@ -100,8 +100,11 @@
     1.4  void
     1.5  Queue::DequeueAll (void)
     1.6  {
     1.7 -  NS_LOG_FUNCTION_NOARGS ();
     1.8 -  NS_ASSERT_MSG (0, "Don't know what to do with dequeued packets!");
     1.9 +  NS_LOG_FUNCTION (this);
    1.10 +  while (!IsEmpty ())
    1.11 +    {
    1.12 +      Dequeue ();
    1.13 +    }
    1.14  }
    1.15  
    1.16  Ptr<Packet>
     2.1 --- a/src/node/queue.h	Wed Jun 04 09:19:16 2008 -0700
     2.2 +++ b/src/node/queue.h	Wed Jun 04 09:22:37 2008 -0700
     2.3 @@ -69,7 +69,7 @@
     2.4    Ptr<Packet> Peek (void) const;
     2.5  
     2.6    /**
     2.7 -   * XXX Doesn't do anything right now, think its supposed to flush the queue
     2.8 +   * Flush the queue.
     2.9     */
    2.10    void DequeueAll (void);
    2.11    /**