Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4443)

Issue 313370043: network: The Queue class holds a list of packets (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
7 years, 3 months ago by Stefano Avallone
Modified:
7 years ago
CC:
ns-3-reviews_googlegroups.com
Visibility:
Public.

Description

This patch modifies the Queue class to allow subclasses to perform additional enqueue/dequeue/peek/remove operations which can manipulate any element in the queue (as required by WifiMacQueue). Now, the Queue class: - defines a std::list<Ptr<Item>> (subclasses no longer define their own containers) - has virtual public Enqueue/Dequeue/Peek/Remove methods that are undefined and must be defined by every subclass - the only way subclasses have to manipulate the queue is through the following methods: + bool Queue<Item>::DoEnqueue (ConstIterator pos, Ptr<Item> item) + Ptr<Item> Queue<Item>::DoDequeue (ConstIterator pos) + Ptr<const Item> Queue<Item>::DoPeek (ConstIterator pos) const + Ptr<Item> Queue<Item>::DoRemove (ConstIterator pos) Two protected methods (ConstIterator Head (void) const e ConstIterator Tail (void) const) are provided to allow subclasses to access any item in the queue. As an example: template <typename Item> bool DropTailQueue<Item>::Enqueue (Ptr<Item> item) { NsLog (LOG_DEBUG, "Enqueue ", this, item); return DoEnqueue (Tail (), item); } - subclasses can define additional public methods, as an example: bool WifiMacQueue::PushFront (Ptr<WifiMacQueueItem> item) { [...] return DoEnqueue (Head (), item); }

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+184 lines, -110 lines) Patch
M CHANGES.html View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M src/network/doc/queue.rst View 1 2 2 chunks +47 lines, -27 lines 0 comments Download
M src/network/utils/drop-tail-queue.h View 1 2 6 chunks +24 lines, -30 lines 0 comments Download
M src/network/utils/queue.h View 1 2 10 chunks +107 lines, -53 lines 0 comments Download

Messages

Total messages: 3
Stefano Avallone
7 years, 3 months ago (2017-01-19 23:26:35 UTC) #1
Mohit P. Tahiliani
On 2017/01/19 23:26:35, Stefano Avallone wrote: The patch looks good to me. Thanks, Mohit P. ...
7 years, 2 months ago (2017-01-21 17:39:39 UTC) #2
Stefano Avallone
7 years, 2 months ago (2017-01-24 17:19:46 UTC) #3
Changes with respect to the first version:

- removed the PendingPacket method

- updated the models documentation
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b