A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::WifiMacQueueContainer Class Reference

Class for the container used by WifiMacQueue. More...

#include "wifi-mac-queue-container.h"

+ Collaboration diagram for ns3::WifiMacQueueContainer:

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, iteratorExtractAllExpiredMpdus () 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, iteratorExtractExpiredMpdus (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, iteratorGetAllExpiredMpdus () const
 Get the range [first, last) of iterators pointing to all the MPDUs queued in the container queue storing MPDUs with expired lifetime.
 
Ptr< WifiMpduGetItem (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 ContainerQueueGetQueue (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, iteratorDoExtractExpiredMpdus (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_tm_nBytesPerQueue
 size in bytes of the container queues
 
std::unordered_map< WifiContainerQueueId, ContainerQueuem_queues
 the container queues
 

Detailed Description

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.

Member Typedef Documentation

◆ const_iterator

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.

◆ ContainerQueue

Type of a queue held by the container.

Definition at line 117 of file wifi-mac-queue-container.h.

◆ iterator

using ns3::WifiMacQueueContainer::iterator = ContainerQueue::iterator

iterator over elements in a container queue

Definition at line 119 of file wifi-mac-queue-container.h.

Member Function Documentation

◆ clear()

void ns3::WifiMacQueueContainer::clear ( )

Erase all elements from the container.

Definition at line 34 of file wifi-mac-queue-container.cc.

References m_expiredQueue, m_nBytesPerQueue, and m_queues.

◆ DoExtractExpiredMpdus()

std::pair< WifiMacQueueContainer::iterator, WifiMacQueueContainer::iterator > ns3::WifiMacQueueContainer::DoExtractExpiredMpdus ( ContainerQueue queue) const
private

Transfer non-inflight MPDUs with expired lifetime in the given container queue to the container queue storing MPDUs with expired lifetime.

Parameters
queuethe given container queue
Returns
the range [first, last) of iterators pointing to the MPDUs transferred to the container queue storing MPDUs with expired lifetime

Definition at line 125 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ erase()

WifiMacQueueContainer::iterator ns3::WifiMacQueueContainer::erase ( const_iterator  pos)

Erase the specified elements from the container.

Parameters
positerator to the element to remove
Returns
iterator following the removed element

Definition at line 57 of file wifi-mac-queue-container.cc.

References GetQueueId(), m_expiredQueue, m_nBytesPerQueue, m_queues, and NS_ASSERT.

+ Here is the call graph for this function:

◆ ExtractAllExpiredMpdus()

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.

Returns
the range [first, last) of iterators pointing to the MPDUs transferred to the container queue storing MPDUs with expired lifetime

Definition at line 178 of file wifi-mac-queue-container.cc.

References DoExtractExpiredMpdus(), m_expiredQueue, and m_queues.

Referenced by WifiExtractExpiredMpdusTest::DoRun(), and ns3::WifiMacQueue::ExtractAllExpiredMpdus().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ExtractExpiredMpdus()

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.

Parameters
queueIdthe QueueId identifying the container queue
Returns
the range [first, last) of iterators pointing to the MPDUs transferred to the container queue storing MPDUs with expired lifetime

Definition at line 119 of file wifi-mac-queue-container.cc.

References DoExtractExpiredMpdus(), and m_queues.

Referenced by WifiExtractExpiredMpdusTest::DoRun(), and ns3::WifiMacQueue::ExtractExpiredMpdus().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetAllExpiredMpdus()

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.

Returns
the range [first, last) of iterators pointing to all the MPDUs queued in the container queue storing MPDUs with expired lifetime

Definition at line 197 of file wifi-mac-queue-container.cc.

References m_expiredQueue.

Referenced by ns3::WifiMacQueue::WipeAllExpiredMpdus().

+ Here is the caller graph for this function:

◆ GetItem()

Ptr< WifiMpdu > ns3::WifiMacQueueContainer::GetItem ( const const_iterator  it) const

Return the WifiMpdu included in the element pointed to by the given iterator.

Parameters
itthe given iterator
Returns
the item included in the element pointed to by the given iterator

Definition at line 74 of file wifi-mac-queue-container.cc.

◆ GetNBytes()

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.

Parameters
queueIdthe given queue ID
Returns
true if the given queue does not exist in the container or is empty, false otherwise

Definition at line 109 of file wifi-mac-queue-container.cc.

References m_nBytesPerQueue, and m_queues.

Referenced by ns3::WifiMacQueue::GetNBytes().

+ Here is the caller graph for this function:

◆ GetQueue()

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.

Parameters
queueIdthe given QueueId
Returns
a const reference to the container queue identified by the given QueueId

Definition at line 103 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().

+ Here is the caller graph for this function:

◆ GetQueueId()

WifiContainerQueueId ns3::WifiMacQueueContainer::GetQueueId ( Ptr< const WifiMpdu mpdu)
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.

Parameters
mpduthe given MPDU
Returns
the QueueId identifying the container queue in which the given MPDU is (or is to be) enqueued

Definition at line 80 of file wifi-mac-queue-container.cc.

References 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(), WifiExtractExpiredMpdusTest::Enqueue(), 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insert()

WifiMacQueueContainer::iterator ns3::WifiMacQueueContainer::insert ( const_iterator  pos,
Ptr< WifiMpdu item 
)

Insert the given item at the specified location in the container.

Parameters
positerator before which the item will be inserted
itemthe item to insert in the container
Returns
iterator pointing to the inserted item

Definition at line 42 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_expiredQueue

ContainerQueue ns3::WifiMacQueueContainer::m_expiredQueue
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().

◆ m_nBytesPerQueue

std::unordered_map<WifiContainerQueueId, uint32_t> ns3::WifiMacQueueContainer::m_nBytesPerQueue
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().

◆ m_queues

std::unordered_map<WifiContainerQueueId, ContainerQueue> ns3::WifiMacQueueContainer::m_queues
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().


The documentation for this class was generated from the following files: