QueueWithQoS Class Reference

#include <QueueWithQoS.h>

Inheritance diagram for QueueWithQoS:

AbstractQueue

List of all members.


Detailed Description

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.

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
EnqueueHookqosHook


Constructor & Destructor Documentation

QueueWithQoS::QueueWithQoS (  )  [inline]

00042 {}


Member Function Documentation

void QueueWithQoS::initialize (  )  [protected, virtual]

Reimplemented from AbstractQueue.

00023 {
00024     AbstractQueue::initialize();
00025 
00026     delay = par("procDelay");
00027     qosHook = check_and_cast<EnqueueHook *>(createOne(par("qosBehaviorClass")));
00028     qosHook->setModule(this);
00029 }

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.

00033 {
00034     qosHook->enqueue(msg, queue);
00035 }

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:

  1. simply return the the same pointer (usual behaviour), or
  2. discard the message and return NULL pointer (the effect being this message being ignored)
  3. or modify the message, wrap in into another message etc, and return the (new) message's pointer.

Most straightforward implementation: return msg;

Implements AbstractQueue.

00038 {
00039     return PK(qosHook->dropIfNotNeeded(msg));
00040 }

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.

00043 {
00044     return delay;
00045 }


Member Data Documentation

simtime_t QueueWithQoS::delay [protected]

Referenced by initialize(), and startService().


The documentation for this class was generated from the following files:

Generated on Fri Mar 20 18:51:20 2009 for INET Framework for OMNeT++/OMNEST by  doxygen 1.5.5