#include <DropTailQueue.h>
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 |
Drop-front queue. See NED for more info.
Definition at line 28 of file DropTailQueue.h.
| cMessage * DropTailQueue::dequeue | ( | ) | [protected, virtual] |
Redefined from PassiveQueueBase.
Implements PassiveQueueBase.
Definition at line 56 of file DropTailQueue.cc.
| bool DropTailQueue::enqueue | ( | cMessage * | msg | ) | [protected, virtual] |
Redefined from PassiveQueueBase.
Implements PassiveQueueBase.
Definition at line 39 of file DropTailQueue.cc.
{
if (frameCapacity && queue.length() >= frameCapacity)
{
EV << "Queue full, dropping packet.\n";
delete msg;
dropVec.record(1);
return true;
}
else
{
queue.insert(msg);
qlenVec.record(queue.length());
return false;
}
}
| void DropTailQueue::initialize | ( | ) | [protected, virtual] |
Reimplemented from PassiveQueueBase.
Definition at line 25 of file DropTailQueue.cc.
{
PassiveQueueBase::initialize();
queue.setName("l2queue");
qlenVec.setName("queue length");
dropVec.setName("drops");
outGate = gate("out");
// configuration
frameCapacity = par("frameCapacity");
}
| void DropTailQueue::sendOut | ( | cMessage * | msg | ) | [protected, virtual] |
Redefined from PassiveQueueBase.
Implements PassiveQueueBase.
Definition at line 69 of file DropTailQueue.cc.
{
send(msg, outGate);
}
cOutVector DropTailQueue::dropVec [protected] |
Definition at line 40 of file DropTailQueue.h.
Referenced by enqueue(), and initialize().
int DropTailQueue::frameCapacity [protected] |
Definition at line 32 of file DropTailQueue.h.
Referenced by enqueue(), and initialize().
cGate* DropTailQueue::outGate [protected] |
Definition at line 36 of file DropTailQueue.h.
Referenced by initialize(), and sendOut().
cOutVector DropTailQueue::qlenVec [protected] |
Definition at line 39 of file DropTailQueue.h.
Referenced by dequeue(), enqueue(), and initialize().
cQueue DropTailQueue::queue [protected] |
Definition at line 35 of file DropTailQueue.h.
Referenced by dequeue(), enqueue(), and initialize().
1.7.1