#include <QueueBase.h>
Public Member Functions | |
QueueBase () | |
Protected Member Functions | |
virtual void | initialize () |
virtual void | arrival (cPacket *msg) |
virtual cPacket * | arrivalWhenIdle (cPacket *msg) |
virtual simtime_t | startService (cPacket *msg) |
Protected Attributes | |
simtime_t | delay |
Queue with constant processing time. Leaves the endService(cMessage *msg) method of AbstractQueue undefined.
Definition at line 29 of file QueueBase.h.
QueueBase::QueueBase | ( | ) | [inline] |
Definition at line 35 of file QueueBase.h.
{}
void QueueBase::arrival | ( | cPacket * | msg | ) | [protected, virtual] |
Functions to (re)define behaviour Called when a message arrives at the module. The method should either enqueue this message (usual behaviour), or discard it. It may also wrap the it into another message, and insert that one in the queue.
Most straightforward implementation: queue.insert(msg);
Implements AbstractQueue.
Definition at line 28 of file QueueBase.cc.
{ queue.insert(msg); }
cPacket * QueueBase::arrivalWhenIdle | ( | cPacket * | msg | ) | [protected, virtual] |
Called when a message arrives at the module when the queue is empty. The message doesn't need to be enqueued in this case, it can start service immmediately. This method may:
Most straightforward implementation: return msg;
Implements AbstractQueue.
Definition at line 33 of file QueueBase.cc.
{
return msg;
}
void QueueBase::initialize | ( | ) | [protected, virtual] |
Reimplemented from AbstractQueue.
Reimplemented in IP, and IPv6.
Definition at line 22 of file QueueBase.cc.
{ AbstractQueue::initialize(); delay = par("procDelay"); }
simtime_t QueueBase::startService | ( | cPacket * | msg | ) | [protected, virtual] |
Called when a message starts service, and should return the service time.
Example implementation: return 1.0;
Implements AbstractQueue.
Definition at line 38 of file QueueBase.cc.
{ return delay; }
simtime_t QueueBase::delay [protected] |
Definition at line 32 of file QueueBase.h.
Referenced by initialize(), and startService().