From 48119eba2ae4c86ea61b96f070b3d8dcb7e78f30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Sun, 1 Apr 2018 11:10:39 +0200 Subject: [PATCH] wifi: Cleanup WifiMacQueue --- src/wifi/model/wifi-mac-queue.cc | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/wifi/model/wifi-mac-queue.cc b/src/wifi/model/wifi-mac-queue.cc index be4058f94..5a306f2c4 100644 --- a/src/wifi/model/wifi-mac-queue.cc +++ b/src/wifi/model/wifi-mac-queue.cc @@ -43,7 +43,7 @@ WifiMacQueue::GetTypeId (void) .AddConstructor () .AddAttribute ("MaxDelay", "If a packet stays longer than this delay in the queue, it is dropped.", TimeValue (MilliSeconds (500)), - MakeTimeAccessor (&WifiMacQueue::m_maxDelay), + MakeTimeAccessor (&WifiMacQueue::SetMaxDelay), MakeTimeChecker ()) .AddAttribute ("DropPolicy", "Upon enqueue with full queue, drop oldest (DropOldest) or newest (DropNewest) packet", EnumValue (DROP_NEWEST), @@ -68,15 +68,12 @@ void WifiMacQueue::SetMaxDelay (Time delay) { NS_LOG_FUNCTION (this << delay); - m_maxDelay = delay; } Time WifiMacQueue::GetMaxDelay (void) const { - NS_LOG_FUNCTION (this); - return m_maxDelay; } @@ -100,7 +97,6 @@ bool WifiMacQueue::Enqueue (Ptr item) { NS_LOG_FUNCTION (this << item); - NS_ASSERT_MSG (GetMode () == QueueBase::QUEUE_MODE_PACKETS, "WifiMacQueues must be in packet mode"); // if the queue is full, remove the first stale packet (if any) encountered @@ -127,7 +123,6 @@ bool WifiMacQueue::PushFront (Ptr item) { NS_LOG_FUNCTION (this << item); - NS_ASSERT_MSG (GetMode () == QueueBase::QUEUE_MODE_PACKETS, "WifiMacQueues must be in packet mode"); // if the queue is full, remove the first stale packet (if any) encountered @@ -154,7 +149,6 @@ Ptr WifiMacQueue::Dequeue (void) { NS_LOG_FUNCTION (this); - for (auto it = Head (); it != Tail (); ) { if (!TtlExceeded (it)) @@ -171,7 +165,6 @@ WifiMacQueue::DequeueByTidAndAddress (uint8_t tid, WifiMacHeader::AddressType type, Mac48Address dest) { NS_LOG_FUNCTION (this << dest); - for (auto it = Head (); it != Tail (); ) { if (!TtlExceeded (it)) @@ -193,7 +186,6 @@ Ptr WifiMacQueue::DequeueFirstAvailable (const Ptr blockedPackets) { NS_LOG_FUNCTION (this); - for (auto it = Head (); it != Tail (); ) { if (!TtlExceeded (it)) @@ -215,7 +207,6 @@ Ptr WifiMacQueue::Peek (void) const { NS_LOG_FUNCTION (this); - for (auto it = Head (); it != Tail (); it++) { // skip packets that stayed in the queue for too long. They will be @@ -234,7 +225,6 @@ WifiMacQueue::PeekByTidAndAddress (uint8_t tid, WifiMacHeader::AddressType type, Mac48Address dest) { NS_LOG_FUNCTION (this << dest); - for (auto it = Head (); it != Tail (); ) { if (!TtlExceeded (it)) @@ -256,7 +246,6 @@ Ptr WifiMacQueue::PeekFirstAvailable (const Ptr blockedPackets) { NS_LOG_FUNCTION (this); - for (auto it = Head (); it != Tail (); ) { if (!TtlExceeded (it)) @@ -294,7 +283,6 @@ bool WifiMacQueue::Remove (Ptr packet) { NS_LOG_FUNCTION (this << packet); - for (auto it = Head (); it != Tail (); ) { if (!TtlExceeded (it)) @@ -317,9 +305,7 @@ WifiMacQueue::GetNPacketsByTidAndAddress (uint8_t tid, WifiMacHeader::AddressTyp Mac48Address dest) { NS_LOG_FUNCTION (this << dest); - uint32_t nPackets = 0; - for (auto it = Head (); it != Tail (); ) { if (!TtlExceeded (it)) @@ -341,7 +327,6 @@ bool WifiMacQueue::IsEmpty (void) { NS_LOG_FUNCTION (this); - for (auto it = Head (); it != Tail (); ) { if (!TtlExceeded (it)) @@ -358,7 +343,6 @@ uint32_t WifiMacQueue::GetNPackets (void) { NS_LOG_FUNCTION (this); - // remove packets that stayed in the queue for too long for (auto it = Head (); it != Tail (); ) { @@ -374,7 +358,6 @@ uint32_t WifiMacQueue::GetNBytes (void) { NS_LOG_FUNCTION (this); - // remove packets that stayed in the queue for too long for (auto it = Head (); it != Tail (); ) {