From 1a5577bc3dde9b67be4adf6ebc7dd514b2a4b9dd Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Wed, 4 Jun 2008 09:22:37 -0700 Subject: [PATCH] bug 204: implement Queue::DequeueAll. --- src/node/queue.cc | 7 +++++-- src/node/queue.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/node/queue.cc b/src/node/queue.cc index 6aa0f4c45..082641b2d 100644 --- a/src/node/queue.cc +++ b/src/node/queue.cc @@ -100,8 +100,11 @@ Queue::Dequeue (void) void Queue::DequeueAll (void) { - NS_LOG_FUNCTION_NOARGS (); - NS_ASSERT_MSG (0, "Don't know what to do with dequeued packets!"); + NS_LOG_FUNCTION (this); + while (!IsEmpty ()) + { + Dequeue (); + } } Ptr diff --git a/src/node/queue.h b/src/node/queue.h index dba69f5ad..b39e2ac71 100644 --- a/src/node/queue.h +++ b/src/node/queue.h @@ -69,7 +69,7 @@ public: Ptr Peek (void) const; /** - * XXX Doesn't do anything right now, think its supposed to flush the queue + * Flush the queue. */ void DequeueAll (void); /**