A Discrete-Event Network Simulator
API
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 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, iteratorExtractAllExpiredMpdus () 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, 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. More...
 
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. More...
 
Ptr< WifiMpduGetItem (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 ContainerQueueGetQueue (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, 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. 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, ContainerQueuem_queues
 the container queues More...
 

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 32 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 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().

+ 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 55 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 176 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 117 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 195 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 72 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 107 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 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().

+ Here is the caller graph for this function:

◆ GetQueueId()

◆ 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 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().

+ 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: