#include <DropTailQueue.h>
Inheritance diagram for DropTailQueue:

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 |
| cOutVector | qlenVec |
| cOutVector | dropVec |
| 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 }
| void DropTailQueue::sendOut | ( | cMessage * | msg | ) | [protected, virtual] |
cOutVector DropTailQueue::dropVec [protected] |
int DropTailQueue::frameCapacity [protected] |
cOutVector DropTailQueue::qlenVec [protected] |
cQueue DropTailQueue::queue [protected] |
1.4.7