#include <ReportDTQueue.h>
Public Member Functions | |
virtual int | queueSize () |
Protected Member Functions | |
virtual void | initialize () |
virtual bool | enqueue (cMessage *msg) |
virtual cMessage * | dequeue () |
virtual void | sendOut (cMessage *msg) |
Protected Attributes | |
int | frameCapacity |
cQueue | queue |
cGate * | outGate |
cOutVector | qlenVec |
cOutVector | dropVec |
The Report Drop Tail Queue class header Drop-front queue the is able to report the queue size. See NED for more info.
cMessage * ReportDTQueue::dequeue | ( | ) | [protected, virtual] |
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] |
void ReportDTQueue::sendOut | ( | cMessage * | msg | ) | [protected, virtual] |
Redefined from PassiveQueueBase.
00072 { 00073 send(msg, outGate); 00074 }
cOutVector ReportDTQueue::dropVec [protected] |
int ReportDTQueue::frameCapacity [protected] |
cGate* ReportDTQueue::outGate [protected] |
cOutVector ReportDTQueue::qlenVec [protected] |
cQueue ReportDTQueue::queue [protected] |