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 | |
using | ContainerQueue = std::list<WifiMacQueueElem> |
Type of a queue held by the container. | |
using | iterator = ContainerQueue::iterator |
iterator over elements in a container queue | |
Public Member Functions | |
void | clear () |
Erase all elements from the container. | |
iterator | erase (const_iterator pos) |
Erase the specified elements from the container. | |
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. | |
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. | |
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. | |
Ptr< WifiMpdu > | GetItem (const const_iterator it) const |
Return the WifiMpdu included in the element pointed to by the given iterator. | |
uint32_t | GetNBytes (const WifiContainerQueueId &queueId) const |
Get the total size of the MPDUs stored in the queue identified by the given QueueId. | |
const ContainerQueue & | GetQueue (const WifiContainerQueueId &queueId) const |
Get a const reference to the container queue identified by the given QueueId. | |
iterator | insert (const_iterator pos, Ptr< WifiMpdu > item) |
Insert the given item at the specified location in the container. | |
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. | |
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. | |
Private Attributes | |
ContainerQueue | m_expiredQueue |
queue storing MPDUs with expired lifetime | |
std::unordered_map< WifiContainerQueueId, uint32_t > | m_nBytesPerQueue |
size in bytes of the container queues | |
std::unordered_map< WifiContainerQueueId, ContainerQueue > | m_queues |
the container queues | |
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 103 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 111 of file wifi-mac-queue-container.h.
using ns3::WifiMacQueueContainer::ContainerQueue = std::list<WifiMacQueueElem> |
Type of a queue held by the container.
Definition at line 107 of file wifi-mac-queue-container.h.
using ns3::WifiMacQueueContainer::iterator = ContainerQueue::iterator |
iterator over elements in a container queue
Definition at line 109 of file wifi-mac-queue-container.h.
void ns3::WifiMacQueueContainer::clear | ( | ) |
Erase all elements from the container.
Definition at line 23 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 116 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 46 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 169 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 110 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 188 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 63 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 100 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 94 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 69 of file wifi-mac-queue-container.cc.
References ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetAddr2(), ns3::WifiMacHeader::GetQosTid(), ns3::Mac48Address::IsBroadcast(), 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_GROUPCAST, 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(), WifiExtractExpiredMpdusTest::Enqueue(), erase(), ns3::WifiMacQueueSchedulerImpl< Priority, Compare >::InitQueueInfo(), ns3::WifiMacQueue::Insert(), 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 31 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 210 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 212 of file wifi-mac-queue-container.h.
Referenced by clear(), DoExtractExpiredMpdus(), erase(), GetNBytes(), and insert().
|
mutableprivate |
the container queues
Definition at line 209 of file wifi-mac-queue-container.h.
Referenced by clear(), erase(), ExtractAllExpiredMpdus(), ExtractExpiredMpdus(), GetNBytes(), GetQueue(), and insert().