Class for the container used by WifiMacQueue. More...
#include "wifi-mac-queue-container.h"
Public Types | |
using | const_iterator = ContainerQueue::const_iterator |
const iterator over elements in a container queue More... | |
using | ContainerQueue = std::list< WifiMacQueueElem > |
Type of a queue held by the container. More... | |
using | iterator = ContainerQueue::iterator |
iterator over elements in a container queue More... | |
Public Member Functions | |
void | clear () |
Erase all elements from the container. More... | |
iterator | erase (const_iterator pos) |
Erase the specified elements from the container. More... | |
std::pair< iterator, iterator > | ExtractAllExpiredMpdus () const |
Transfer non-inflight MPDUs with expired lifetime in all the container queues to the container queue storing MPDUs with expired lifetime. More... | |
std::pair< iterator, iterator > | ExtractExpiredMpdus (const WifiContainerQueueId &queueId) const |
Transfer non-inflight MPDUs with expired lifetime in the container queue identified by the given QueueId to the container queue storing MPDUs with expired lifetime. More... | |
std::pair< iterator, iterator > | GetAllExpiredMpdus () const |
Get the range [first, last) of iterators pointing to all the MPDUs queued in the container queue storing MPDUs with expired lifetime. More... | |
Ptr< WifiMpdu > | GetItem (const const_iterator it) const |
Return the WifiMpdu included in the element pointed to by the given iterator. More... | |
uint32_t | GetNBytes (const WifiContainerQueueId &queueId) const |
Get the total size of the MPDUs stored in the queue identified by the given QueueId. More... | |
const ContainerQueue & | GetQueue (const WifiContainerQueueId &queueId) const |
Get a const reference to the container queue identified by the given QueueId. More... | |
iterator | insert (const_iterator pos, Ptr< WifiMpdu > item) |
Insert the given item at the specified location in the container. More... | |
Static Public Member Functions | |
static WifiContainerQueueId | GetQueueId (Ptr< const WifiMpdu > mpdu) |
Return the QueueId identifying the container queue in which the given MPDU is (or is to be) enqueued. More... | |
Private Member Functions | |
std::pair< iterator, iterator > | DoExtractExpiredMpdus (ContainerQueue &queue) const |
Transfer non-inflight MPDUs with expired lifetime in the given container queue to the container queue storing MPDUs with expired lifetime. More... | |
Private Attributes | |
ContainerQueue | m_expiredQueue |
queue storing MPDUs with expired lifetime More... | |
std::unordered_map< WifiContainerQueueId, uint32_t > | m_nBytesPerQueue |
size in bytes of the container queues More... | |
std::unordered_map< WifiContainerQueueId, ContainerQueue > | m_queues |
the container queues More... | |
Class for the container used by WifiMacQueue.
This container holds multiple container queues organized in an hash table whose keys are WifiContainerQueueId tuples identifying the container queues.
Definition at line 113 of file wifi-mac-queue-container.h.
using ns3::WifiMacQueueContainer::const_iterator = ContainerQueue::const_iterator |
const iterator over elements in a container queue
Definition at line 121 of file wifi-mac-queue-container.h.
Type of a queue held by the container.
Definition at line 117 of file wifi-mac-queue-container.h.
using ns3::WifiMacQueueContainer::iterator = ContainerQueue::iterator |
iterator over elements in a container queue
Definition at line 119 of file wifi-mac-queue-container.h.
void ns3::WifiMacQueueContainer::clear | ( | ) |
Erase all elements from the container.
Definition at line 32 of file wifi-mac-queue-container.cc.
References m_expiredQueue, m_nBytesPerQueue, and m_queues.
|
private |
Transfer non-inflight MPDUs with expired lifetime in the given container queue to the container queue storing MPDUs with expired lifetime.
queue | the given container queue |
Definition at line 123 of file wifi-mac-queue-container.cc.
References ns3::AC_UNDEF, GetQueueId(), m_expiredQueue, m_nBytesPerQueue, ns3::Simulator::Now(), and NS_ASSERT.
Referenced by ExtractAllExpiredMpdus(), and ExtractExpiredMpdus().
WifiMacQueueContainer::iterator ns3::WifiMacQueueContainer::erase | ( | const_iterator | pos | ) |
Erase the specified elements from the container.
pos | iterator to the element to remove |
Definition at line 55 of file wifi-mac-queue-container.cc.
References GetQueueId(), m_expiredQueue, m_nBytesPerQueue, m_queues, and NS_ASSERT.
std::pair< WifiMacQueueContainer::iterator, WifiMacQueueContainer::iterator > ns3::WifiMacQueueContainer::ExtractAllExpiredMpdus | ( | ) | const |
Transfer non-inflight MPDUs with expired lifetime in all the container queues to the container queue storing MPDUs with expired lifetime.
Definition at line 176 of file wifi-mac-queue-container.cc.
References DoExtractExpiredMpdus(), m_expiredQueue, and m_queues.
Referenced by WifiExtractExpiredMpdusTest::DoRun(), and ns3::WifiMacQueue::ExtractAllExpiredMpdus().
std::pair< WifiMacQueueContainer::iterator, WifiMacQueueContainer::iterator > ns3::WifiMacQueueContainer::ExtractExpiredMpdus | ( | const WifiContainerQueueId & | queueId | ) | const |
Transfer non-inflight MPDUs with expired lifetime in the container queue identified by the given QueueId to the container queue storing MPDUs with expired lifetime.
queueId | the QueueId identifying the container queue |
Definition at line 117 of file wifi-mac-queue-container.cc.
References DoExtractExpiredMpdus(), and m_queues.
Referenced by WifiExtractExpiredMpdusTest::DoRun(), and ns3::WifiMacQueue::ExtractExpiredMpdus().
std::pair< WifiMacQueueContainer::iterator, WifiMacQueueContainer::iterator > ns3::WifiMacQueueContainer::GetAllExpiredMpdus | ( | ) | const |
Get the range [first, last) of iterators pointing to all the MPDUs queued in the container queue storing MPDUs with expired lifetime.
Definition at line 195 of file wifi-mac-queue-container.cc.
References m_expiredQueue.
Referenced by ns3::WifiMacQueue::WipeAllExpiredMpdus().
Ptr< WifiMpdu > ns3::WifiMacQueueContainer::GetItem | ( | const const_iterator | it | ) | const |
Return the WifiMpdu included in the element pointed to by the given iterator.
it | the given iterator |
Definition at line 72 of file wifi-mac-queue-container.cc.
uint32_t ns3::WifiMacQueueContainer::GetNBytes | ( | const WifiContainerQueueId & | queueId | ) | const |
Get the total size of the MPDUs stored in the queue identified by the given QueueId.
queueId | the given queue ID |
Definition at line 107 of file wifi-mac-queue-container.cc.
References m_nBytesPerQueue, and m_queues.
Referenced by ns3::WifiMacQueue::GetNBytes().
const WifiMacQueueContainer::ContainerQueue & ns3::WifiMacQueueContainer::GetQueue | ( | const WifiContainerQueueId & | queueId | ) | const |
Get a const reference to the container queue identified by the given QueueId.
The container queue is created if it does not exist.
queueId | the given QueueId |
Definition at line 101 of file wifi-mac-queue-container.cc.
References m_queues.
Referenced by WifiExtractExpiredMpdusTest::DoRun(), WifiExtractExpiredMpdusTest::Enqueue(), ns3::WifiMacQueue::GetNPackets(), ns3::WifiMacQueue::Insert(), ns3::WifiMacQueue::Peek(), ns3::WifiMacQueue::PeekByQueueId(), and ns3::WifiMacQueue::PeekFirstAvailable().
|
static |
Return the QueueId identifying the container queue in which the given MPDU is (or is to be) enqueued.
Note that the given MPDU must not contain a control frame.
mpdu | the given MPDU |
Definition at line 78 of file wifi-mac-queue-container.cc.
References first::address, ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetAddr2(), ns3::WifiMacHeader::GetQosTid(), ns3::WifiMacHeader::IsCtl(), ns3::Mac48Address::IsGroup(), ns3::WifiMacHeader::IsMgt(), ns3::WifiMacHeader::IsQosData(), ns3::WIFI_BROADCAST, ns3::WIFI_CTL_QUEUE, ns3::WIFI_DATA_QUEUE, ns3::WIFI_MGT_QUEUE, ns3::WIFI_QOSDATA_QUEUE, and ns3::WIFI_UNICAST.
Referenced by ns3::WifiMacQueue::DoEnqueue(), DoExtractExpiredMpdus(), ns3::FcfsWifiQueueScheduler::DoNotifyDequeue(), ns3::FcfsWifiQueueScheduler::DoNotifyEnqueue(), ns3::FcfsWifiQueueScheduler::DoNotifyRemove(), ns3::WifiMacQueue::Enqueue(), erase(), ns3::WifiMacQueueSchedulerImpl< Priority, Compare >::InitQueueInfo(), insert(), ns3::WifiMacQueue::Insert(), ns3::WifiMacQueueSchedulerImpl< Priority, Compare >::NotifyDequeue(), ns3::WifiMacQueueSchedulerImpl< Priority, Compare >::NotifyRemove(), ns3::WifiMacQueue::PeekByQueueId(), and ns3::WifiMacQueue::PeekFirstAvailable().
WifiMacQueueContainer::iterator ns3::WifiMacQueueContainer::insert | ( | const_iterator | pos, |
Ptr< WifiMpdu > | item | ||
) |
Insert the given item at the specified location in the container.
pos | iterator before which the item will be inserted |
item | the item to insert in the container |
Definition at line 40 of file wifi-mac-queue-container.cc.
References GetQueueId(), m_nBytesPerQueue, m_queues, NS_ABORT_MSG_IF, and NS_ABORT_MSG_UNLESS.
Referenced by WifiExtractExpiredMpdusTest::Enqueue().
|
mutableprivate |
queue storing MPDUs with expired lifetime
Definition at line 220 of file wifi-mac-queue-container.h.
Referenced by clear(), DoExtractExpiredMpdus(), erase(), ExtractAllExpiredMpdus(), and GetAllExpiredMpdus().
|
mutableprivate |
size in bytes of the container queues
Definition at line 222 of file wifi-mac-queue-container.h.
Referenced by clear(), DoExtractExpiredMpdus(), erase(), GetNBytes(), and insert().
|
mutableprivate |
the container queues
Definition at line 219 of file wifi-mac-queue-container.h.
Referenced by clear(), erase(), ExtractAllExpiredMpdus(), ExtractExpiredMpdus(), GetNBytes(), GetQueue(), and insert().