wifi: Implement a WifiMacQueue-specific Flush() method

This commit is contained in:
Stefano Avallone
2023-07-19 17:03:38 +02:00
committed by Stefano Avallone
parent 0569e6ad89
commit 70a32c145b
2 changed files with 16 additions and 0 deletions

View File

@@ -398,6 +398,17 @@ WifiMacQueue::Remove(Ptr<const WifiMpdu> mpdu)
return DoRemove(it);
}
void
WifiMacQueue::Flush()
{
NS_LOG_FUNCTION(this);
// there may be some expired MPDUs in the container queue storing MPDUs with expired lifetime,
// which will not be flushed by the Flush() method of the base class.
WipeAllExpiredMpdus();
Queue<WifiMpdu, WifiMacQueueContainer>::Flush();
}
void
WifiMacQueue::Replace(Ptr<const WifiMpdu> currentItem, Ptr<WifiMpdu> newItem)
{

View File

@@ -212,6 +212,11 @@ class WifiMacQueue : public Queue<WifiMpdu, ns3::WifiMacQueueContainer>
*/
Ptr<WifiMpdu> Remove(Ptr<const WifiMpdu> item);
/**
* Flush the queue.
*/
void Flush();
/**
* Replace the given current item with the given new item. Actually, the current
* item is dequeued and the new item is enqueued in its place. In this way,