Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

PriorityPacketQueue Class Reference

Gives the appearance of a single queue. More...

#include <PriorityPacketQueue.h>

List of all members.

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


Detailed Description

Gives the appearance of a single queue.

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.


Constructor & Destructor Documentation

PriorityPacketQueue::PriorityPacketQueue
 

Definition at line 14 of file PriorityPacketQueue.cpp.

PriorityPacketQueue::~PriorityPacketQueue
 

Definition at line 27 of file PriorityPacketQueue.cpp.


Member Function Documentation

void PriorityPacketQueue::add Node * fromNode,
NpPacket * packet
 

Add the packet to the queue.

Definition at line 81 of file PriorityPacketQueue.cpp.

Referenced by NetworkLayer::handlePacket().

void PriorityPacketQueue::getNext Node ** fromNode,
NpPacket ** packet
 

Gets the next highest priority packet.

Definition at line 44 of file PriorityPacketQueue.cpp.

Referenced by NetworkLayer::processPacketsImpl().

bool PriorityPacketQueue::isEmpty
 

Return true if there are no packets in the queue.

Definition at line 113 of file PriorityPacketQueue.cpp.

void PriorityPacketQueue::print std::ostream & out
 

Print out the queue.

Definition at line 123 of file PriorityPacketQueue.cpp.


Member Data Documentation

ThreadMessageQueue<PacketInfo>* PriorityPacketQueue::m_controlQueue [private]
 

Definition at line 18 of file PriorityPacketQueue.h.

ThreadMessageQueue<PacketInfo>* PriorityPacketQueue::m_dataQueue [private]
 

Definition at line 19 of file PriorityPacketQueue.h.

bool PriorityPacketQueue::m_dead [private]
 

Definition at line 24 of file PriorityPacketQueue.h.

Mutex PriorityPacketQueue::m_lock [private]
 

Definition at line 22 of file PriorityPacketQueue.h.

Condition PriorityPacketQueue::m_ready [private]
 

Definition at line 21 of file PriorityPacketQueue.h.


The documentation for this class was generated from the following files:
Generated at Thu Jul 11 13:31:58 2002 for Peekabooty by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001