Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

DropTailQueue Class Reference

#include <DropTailQueue.h>

Inheritance diagram for DropTailQueue:

PassiveQueueBase IPassiveQueue List of all members.

Detailed Description

Drop-tail queue. See NED for more info.


Protected Member Functions

virtual void initialize ()
virtual bool enqueue (cMessage *msg)
virtual cMessage * dequeue ()

Protected Attributes

int frameCapacity
cQueue queue
cOutVector qlenVec
cOutVector dropVec


Member Function Documentation

cMessage * DropTailQueue::dequeue  )  [protected, virtual]
 

Redefined from PassiveQueueBase.

Implements PassiveQueueBase.

00056 {
00057     if (queue.empty())
00058         return NULL;
00059 
00060    cMessage *pk = (cMessage *)queue.pop();
00061 
00062     // statistics
00063     qlenVec.record(queue.length());
00064 
00065     return pk;
00066 }

bool DropTailQueue::enqueue cMessage *  msg  )  [protected, virtual]
 

Redefined from PassiveQueueBase.

Implements PassiveQueueBase.

00039 {
00040     if (frameCapacity && queue.length() >= frameCapacity)
00041     {
00042         EV << "Queue full, dropping packet.\n";
00043         delete msg;
00044         dropVec.record(1);
00045         return true;
00046     }
00047     else
00048     {
00049         queue.insert(msg);
00050         qlenVec.record(queue.length());
00051         return false;
00052     }
00053 }

void DropTailQueue::initialize  )  [protected, virtual]
 

Reimplemented from PassiveQueueBase.

00027 {
00028     PassiveQueueBase::initialize();
00029     queue.setName("l2queue");
00030 
00031     qlenVec.setName("queue length");
00032     dropVec.setName("drops");
00033 
00034     // configuration
00035     frameCapacity = par("frameCapacity");
00036 }


Member Data Documentation

cOutVector DropTailQueue::dropVec [protected]
 

int DropTailQueue::frameCapacity [protected]
 

cOutVector DropTailQueue::qlenVec [protected]
 

cQueue DropTailQueue::queue [protected]
 


The documentation for this class was generated from the following files:
Generated on Sat Apr 1 20:52:21 2006 for INET Framework for OMNeT++/OMNEST by  doxygen 1.4.1