#include <QueueWithQoS.h>
Public Member Functions | |
QueueWithQoS () | |
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 |
EnqueueHook * | qosHook |
Queue with constant processing time, with integrated QoS behaviour. Processing time is taken from the "procDelay" module parameter, and QoS class from the "qosBehaviourClass" module parameter.
Leaves the endService(cMessage *msg) method of AbstractQueue undefined.
Definition at line 35 of file QueueWithQoS.h.
QueueWithQoS::QueueWithQoS | ( | ) | [inline] |
Definition at line 42 of file QueueWithQoS.h.
{}
void QueueWithQoS::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 32 of file QueueWithQoS.cc.
cPacket * QueueWithQoS::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 37 of file QueueWithQoS.cc.
{ return PK(qosHook->dropIfNotNeeded(msg)); }
void QueueWithQoS::initialize | ( | ) | [protected, virtual] |
Reimplemented from AbstractQueue.
Definition at line 22 of file QueueWithQoS.cc.
{ AbstractQueue::initialize(); delay = par("procDelay"); qosHook = check_and_cast<EnqueueHook *>(createOne(par("qosBehaviorClass"))); qosHook->setModule(this); }
simtime_t QueueWithQoS::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 42 of file QueueWithQoS.cc.
{ return delay; }
simtime_t QueueWithQoS::delay [protected] |
Definition at line 38 of file QueueWithQoS.h.
Referenced by initialize(), and startService().
EnqueueHook* QueueWithQoS::qosHook [protected] |
Definition at line 39 of file QueueWithQoS.h.
Referenced by arrival(), arrivalWhenIdle(), and initialize().