9#ifndef WIFI_MAC_QUEUE_CONTAINER_H
10#define WIFI_MAC_QUEUE_CONTAINER_H
15#include "ns3/deprecated.h"
16#include "ns3/mac48-address.h"
21#include <unordered_map>
101 std::optional<Mac48Address>
addr1,
102 std::optional<Mac48Address>
addr2,
103 std::optional<tid_t>
tid)
141 std::optional<tid_t> tid = std::nullopt)
155inline WifiContainerQueueId
158 std::optional<tid_t> tid = std::nullopt)
173inline WifiContainerQueueId
177 std::optional<tid_t> tid = std::nullopt)
194struct std::hash<
ns3::WifiContainerQueueId>
319 mutable std::unordered_map<WifiContainerQueueId, ContainerQueue>
322 mutable std::unordered_map<WifiContainerQueueId, uint32_t>
Smart pointer class similar to boost::intrusive_ptr.
Class for the container used by WifiMacQueue.
const ContainerQueue & GetQueue(const WifiContainerQueueId &queueId) const
Get a const reference to the container queue identified by the given QueueId.
void clear()
Erase all elements from the container.
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.
ContainerQueue::iterator iterator
iterator over elements in a container queue
std::unordered_map< WifiContainerQueueId, uint32_t > m_nBytesPerQueue
size in bytes of the container queues
uint32_t GetNBytes(const WifiContainerQueueId &queueId) const
Get the total size of the MPDUs stored in the queue identified by the given QueueId.
Ptr< WifiMpdu > GetItem(const const_iterator it) const
Return the WifiMpdu included in the element pointed to by the given iterator.
std::pair< iterator, iterator > ExtractAllExpiredMpdus() const
Transfer non-inflight MPDUs with expired lifetime in all the container queues to the container queue ...
iterator insert(const_iterator pos, Ptr< WifiMpdu > item)
Insert the given item at the specified location in the container.
std::unordered_map< WifiContainerQueueId, ContainerQueue > m_queues
the container queues
std::list< WifiMacQueueElem > ContainerQueue
Type of a queue held by the container.
iterator erase(const_iterator pos)
Erase the specified elements from the container.
std::pair< iterator, iterator > GetAllExpiredMpdus() const
Get the range [first, last) of iterators pointing to all the MPDUs queued in the container queue stor...
ContainerQueue::const_iterator const_iterator
const iterator over elements in a container queue
ContainerQueue m_expiredQueue
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 Queu...
std::pair< iterator, iterator > DoExtractExpiredMpdus(ContainerQueue &queue) const
Transfer non-inflight MPDUs with expired lifetime in the given container queue to the container queue...
#define NS_DEPRECATED_3_46(msg)
Tag for things deprecated in version ns-3.46.
WifiContainerQueueId MakeWifiUnicastQueueId(WifiContainerQueueType type, Mac48Address addr1, std::optional< tid_t > tid=std::nullopt)
Helper function to create WifiContainerQueueId for unicast queues.
WifiContainerQueueId MakeWifiGroupcastQueueId(WifiContainerQueueType type, Mac48Address addr1, Mac48Address addr2, std::optional< tid_t > tid=std::nullopt)
Helper function to create WifiContainerQueueId for groupcast queues.
WifiContainerQueueId MakeWifiBroadcastQueueId(WifiContainerQueueType type, Mac48Address addr2, std::optional< tid_t > tid=std::nullopt)
Helper function to create WifiContainerQueueId for broadcast queues.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static constexpr auto WIFI_UNICAST
Deprecated frame types enums.
std::ostream & operator<<(std::ostream &os, const Angles &a)
static constexpr auto WIFI_GROUPCAST
static constexpr auto WIFI_BROADCAST
WifiRcvAddr
enumeration of frame types based on receiver address
WifiContainerQueueType
enumeration of container queue types
Structure identifying a container queue.
std::optional< Mac48Address > addr1
the receiver address for unicast and groupcast queues, or nullopt otherwise
std::optional< Mac48Address > addr2
the transmitter address for broadcast and groupcast queues, or nullopt otherwise
auto operator<=>(const WifiContainerQueueId &rhs) const =default
Three-way comparison operator.
std::optional< tid_t > tid
the TID for QoS data queues, or nullopt otherwise
WifiContainerQueueId(WifiContainerQueueType type, WifiRcvAddr addrType, std::optional< Mac48Address > addr1, std::optional< Mac48Address > addr2, std::optional< tid_t > tid)
Constructor.
WifiContainerQueueType type
the container queue type
WifiRcvAddr addrType
the type of receiver address
std::size_t operator()(ns3::WifiContainerQueueId queueId) const
The functor.