#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 |
void QueueBase::initialize | ( | ) | [protected, virtual] |
Reimplemented from AbstractQueue.
Reimplemented in IP, and IPv6.
Referenced by IPv6::initialize(), and IP::initialize().
00023 { 00024 AbstractQueue::initialize(); 00025 delay = par("procDelay"); 00026 }
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.
00029 { 00030 queue.insert(msg); 00031 }
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.
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.
00039 { 00040 return delay; 00041 }
simtime_t QueueBase::delay [protected] |
Referenced by initialize(), and startService().