1. MPDUs with expired lifetime are already discarded:
- when a QosTxop releases/requests the channel
- when we check if there are pending BlockAckReq frames
hence, it is useless (and sometimes troublesome) to check
for MPDUs with expired lifetime at every packet dequeue
2. Dequeue{ByTid, ByAddress, ...} were not used and hence
removed (one can use a Peek* method and then Dequeue())
3. Given that a WifiMacQueueItem stores an iterator, add a
Dequeue method (the only one in addition to the default one)
that receives a WifiMacQueueItem and dequeues it in constant time
So far, when A-MSDU aggregation is performed, MPDUs containing the
constituent MSDUs are kept in the queue until the MPDU containing
the A-MSDU (which is kept out of the queue) is transmitted.
Now, as soon as A-MSDU aggregation is performed, MPDUs containing
the constituent MSDUs are dequeued and the MPDU containing the
A-MSDU is enqueued in their place.
The specialized functions were kept for better code readability
and only had a few code differences (Otherwise the prior `RunIf`
would have worked but the code would have looked complex).
Using `if constexpr` makes code less redundant and easier to
read as the common code is grouped now.
Signed-off-by: Ameya Deshpande <ameyanrd@outlook.com>
Since ns-3 supports C++17 constructs now, we can make use
of `if constexpr` as it evaluates the condition inside it
only for that instantiation (distinction happens at compile
time itself).
Signed-off-by: Ameya Deshpande <ameyanrd@outlook.com>
This change improves the performance of Nix in bigger topologies as
it uses the `unordered_map` which has better performance than
`GetObject<Ip> ()` as it reads through the list.
This `unordered_map` will be created along with `IpAddress` to `Ptr<Node>`
`unordered_map`. Since it is a static member, it will be only time over
all the `NixVectorRouting` instances.
Signed-off-by: Ameya Deshpande <ameyanrd@outlook.com>
For hierarchical mobility models, calling GetPosition () can trigger
another course change, causing it to be written into the course change
currently being written. This can be avoided by calling GetPosition() first.