#include <PriorityPacketQueue.h>
Public Methods | |
PriorityPacketQueue () | |
~PriorityPacketQueue () | |
void | getNext (Node **fromNode, NpPacket **packet) |
Gets the next highest priority packet. More... | |
void | add (Node *fromNode, NpPacket *packet) |
Add the packet to the queue. More... | |
bool | isEmpty () |
Return true if there are no packets in the queue. More... | |
void | print (std::ostream &) |
Print out the queue. More... | |
Private Attributes | |
ThreadMessageQueue< PacketInfo > * | m_controlQueue |
ThreadMessageQueue< PacketInfo > * | m_dataQueue |
Condition | m_ready |
Mutex | m_lock |
bool | m_dead |
The queue will appear to order packets into levels of priority, where higher priority packets will be placed in front of lower priority packets. Those packets of the same priority will be added and removed in FIFO order.
For this implementation, control packets have a higher priority than data packets.
Definition at line 7 of file PriorityPacketQueue.h.
|
Definition at line 14 of file PriorityPacketQueue.cpp. |
|
Definition at line 27 of file PriorityPacketQueue.cpp. |
|
Add the packet to the queue.
Definition at line 81 of file PriorityPacketQueue.cpp. Referenced by NetworkLayer::handlePacket().
|
|
Gets the next highest priority packet.
Definition at line 44 of file PriorityPacketQueue.cpp. Referenced by NetworkLayer::processPacketsImpl().
|
|
Return true if there are no packets in the queue.
Definition at line 113 of file PriorityPacketQueue.cpp. |
|
Print out the queue.
Definition at line 123 of file PriorityPacketQueue.cpp. |
|
Definition at line 18 of file PriorityPacketQueue.h. |
|
Definition at line 19 of file PriorityPacketQueue.h. |
|
Definition at line 24 of file PriorityPacketQueue.h. |
|
Definition at line 22 of file PriorityPacketQueue.h. |
|
Definition at line 21 of file PriorityPacketQueue.h. |