ReportDTQueue Class Reference

#include <ReportDTQueue.h>

List of all members.

Public Member Functions

virtual int queueSize ()

Protected Member Functions

virtual void initialize ()
virtual bool enqueue (cMessage *msg)
virtual cMessagedequeue ()
virtual void sendOut (cMessage *msg)

Protected Attributes

int frameCapacity
cQueue queue
cGateoutGate
cOutVector qlenVec
cOutVector dropVec

Detailed Description

The Report Drop Tail Queue class header Drop-front queue the is able to report the queue size. See NED for more info.


Member Function Documentation

cMessage * ReportDTQueue::dequeue (  )  [protected, virtual]

Redefined from PassiveQueueBase.

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

bool ReportDTQueue::enqueue ( cMessage msg  )  [protected, virtual]

Redefined from PassiveQueueBase.

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

void ReportDTQueue::initialize (  )  [protected, virtual]

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

virtual int ReportDTQueue::queueSize (  )  [inline, virtual]

Report the size of the queue

00067 {return queue.length();}

void ReportDTQueue::sendOut ( cMessage msg  )  [protected, virtual]

Redefined from PassiveQueueBase.

00072 {
00073     send(msg, outGate);
00074 }


Member Data Documentation


The documentation for this class was generated from the following files:
Generated on Thu Jun 14 17:12:42 2012 for PAL by  doxygen 1.6.3